WordPress speed-up optimization: Clean up redundant scripts in the HEAD header

888u

Last update at :2024-07-04,Edit by888u

WordPress is a very good CMS management system. Basically 90% of PHP blogs will use this content management system. The main reason is that it is convenient, stable, and rich in templates and plug-ins. Basically, as long as you can surf the Internet, you can Build your own blog website. However, most users just stay on using the program. As time goes by, we will find that our blog opens much slower, and the host provider will suspend the account because we occupy too much CPU.

Many times, we think that hosting providers are unreliable and deceptive. In fact, most of the reasons are due to the optimization of our website itself. Including Snail Blog, in addition to frequent minor repairs and additions to the theme interface, some scripts have not been optimized. In the past two days, I was designing a theme for a website and saw many useless lines of code in the header of the source code, so I checked the relevant information. We can optimize header files without affecting website performance.

remove_action( \\'wp_head\\', \\'feed_links_extra\\', 3 ); //Remove comments feedremove_action( \\'wp_head\\', \\'feed_links\\', 2 ); / /Remove article feedremove_action( \\'wp_head\\', \\'rsd_link\\' ); //Remote offline editor interface for Blog remove_action( \\'wp_head\\', \\'wlwmanifest_link\\' ) ; //Windows Live Writer interface remove_action( \\'wp_head\\', \\'index_rel_link\\' ); //Remove the index of the current page remove_action( \\'wp_head\\', \\'parent_post_rel_link\\ ', 10, 0 ); //Remove the urlremove_action( \\'wp_head\\', \\'start_post_rel_link\\', 10, 0 ); //Remove the urlremove_action( \\' of the first article wp_head\\', \\'wp_shortlink_wp_head\\', 10, 0 ); //Automatically generated short link remove_action( \\'wp_head\\', \\'adjacent_posts_rel_link\\', 10, 0 ); // /Remove urlremove_action( \\'wp_head\\', \\'wp_generator\\' ) of adjacent articles; // Remove version number

According to the above tips and comments, we can add the script to the FUNCTION.PHP (under the current theme) file, so that unnecessary lines of code are removed from the source code of our website, thereby improving the code execution rate and website speed. .

Recommended site search: Mainland China virtual host, free ASP space, free second-level domain name, how to cancel domain name registration, free proxy IP, server purchase, registration-free space, domain name error correction system, Hong Kong server purchase, domain name check,

WordPress speed-up optimization: Clean up redundant scripts in the HEAD header

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码