Wordpress slimming plan: let your website fly

Source: Internet
Author: User

Wordpress, as an excellent blog Program, has moved out of the blog field and is rampant in websites of various industries. I have also been familiar with and used wordpress blogs for more than half a year. I would like to share some tips on using this system. Today I will first share two wordpress slimming methods, make your wrodpress more concise and clean.

The first is image slimming. Many of my friends choose wordpress as their websites. They all see that their image processing functions are very powerful, such as dedecms and zblog, which we are familiar with (especially thumbnails) A website may require thumbnails of different sizes in different regions. wordpress is easy to crop, but dedecms only controls css, zblog does not have the thumbnail function.

However, if wordpress is improperly set, each image you upload will be cropped in three different sizes. Each image will contain four files. If you have five images at a time, you may use a thumbnail, but the system will automatically display 20 images, such as 4*5, which greatly wastes space. In this article, the author suggests that if the blog does not need the thumbnail function, set the background media settings and then set all the images to 0, for example:

  

 

 

In this way, the image system will not automatically crop the uploaded image. However, if you need Thumbnails, we recommend that you use the Thumbnails plug-in, for example (WP-Thumbnails). This plug-in can be designed to only target the first thumbnail or several images, you can also use the timthumb function supported by wordpress to crop the first image as a thumbnail and set the size as needed. This will not cause the system to automatically crop many but unused thumbnails, this greatly saves your space.

The second is the reduction of Page code. wordpress has a lot of default header code, but for our common webmaster, there is no need at all, so we need to remove the redundant code, it is best to retain the title, keyword, description, and css reference code of the webpage. In this case, you need to add the following code to the functions file of the topic:

Remove_action ('wp _ head', 'wp _ generator ');

Remove_action ('wp _ head', 'wlwmanifest _ link ');

Remove_action ('wp _ head', 'rsd _ link ');

Remove_action ('wp _ head', 'index _ rel_link '); // Removes the index link

Remove_action ('wp _ head', 'parent _ post_rel_link ', 10, 0); // Removes the prev link

Remove_action ('wp _ head', 'start _ post_rel_link ', 10, 0); // Removes the start link

Remove_action ('wp _ head', 'adjacent _ posts_rel_link_wp_head ', 10, 0); // Removes the relational links for the posts adjacent to the current post.

Remove_action ('wp _ head', 'feed _ links ', 2); // ° feed

Remove_action ('wp _ head', 'feed _ links_extra ', 3); // feed

Remove_action ('wp _ head', 'wp _ print_head_scripts ', 9 );

Remove_action ('wp _ head', 'rel _ canonical ');

Remove_action ('wp _ head', 'wp _ Your link_wp_head ', 10, 0 );

After adding this code, you can open your home page and view the source file. You will find that the web page header is clean. Today I would like to share with you these two wordpress slimming methods, while Lily cinema will continue to share with you high quality wordpress use skills, the article by Lily Cinema (http://www.lili1989.net) First red and black alliance, please indicate the source for reprinting. Thank you.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.