Content Marketing

10 Simple Ways to Make Your WordPress Site Faster

I've become obsessed with the speed of the site over the last six months, working systematically through each of my sites to improve their speed. Aside from the supposed SEO benefits, the faster your site is, the better the user experience. And the better the user experience, the higher the conversion rate – sales, leads, or newsletter subscribers; whatever the conversion of your site. And it's a good thing for your business – no matter what type of business model you have.

My three favorite resources for evaluating the speed of the site (and identifying the speed problems of the site to correct) are:

Well, the latter is a lie. I use Pagespeed Insights only to evaluate how Google evaluates the mobile user experience for my sites. Their recommendations for improving the speed of the site are limited and often vague. But it's still an important test to make sure that you reach a 100/100 mobile user experience score in Google's eyes.

I am not an expert server. This message is not meant to be an exhaustive guide. Most people with intermediate WordPress experience knowing use caching plugins (I use W3 Total Cache ) and a CDN (I use MaxCDN – affiliated). That said, over the past six months, I've discovered several other simple ways for website owners and bloggers to improve the speed of their site even if no technical team manages their website. Simple as easy to execute by following the basic instructions.

Milliseconds count – and add up. I share some of the ways that I've cut down on these milliseconds – in the simplest possible terms – below.

An Important Note

First of all, for all the tips that require you to edit the wp-config.php or functions.php file for your theme, I highly recommend create a backup of the current wp-config.php or functions.php file before editing it. If there is a problem, you can simply download the old copy of the file to your server via FTP or your file manager from your host's dashboard and restore the site to its normal state.

Reduce the number of post revisions recorded in your database

WordPress stores revisions posted in your database so that each time you click on the button backup, WordPress essentially archives the previous version of the publication. If you write articles in WordPress as I do and often click the Save button, you get a ton of revisions stored for each publication.

To illustrate the amount of data this may cause, I disabled my revision check by writing this post. My site ended up storing more than 100 revisions for this post. Apparently, I click a lot on the save button. Now, multiply this number of times all the posts on your site. This is a huge amount of (usually unnecessary) data stored in your database.

You can use the Better Delete Revision plugin to delete all the revisions currently stored in your database. Install the plugin, then go to Settings> Best remove review from your WordPress dashboard. Click on the Check Revision Posts plugin. This screen will display a list of the current revisions stored in your database. Scroll to the bottom of this page and click the button to delete them. Once done, go back to Settings> Best Remove Review from your WordPress Dashboard and click Optimize Your Database. This step will optimize your database now that you have deleted the revisions.

After historical revisions are removed and your database is cleaned up, you will want to prevent or limit future revisions.

To completely remove the revisions, add the following code to your wp-config.php file:

/ ** Disable post revisions. * /
define (& # 39; WP_POST_REVISIONS & # 39 ;, false);

To limit the number of revisions stored, add the following code to your wp-config.php file – by changing the number 2 for as many revisions you want to store the database:

/ ** Limits post revisions. * /
define (WP_POST_REVISIONS & # 39; 2);

But do not add the code above to the end of the wp-config.php file – place it after the define (& # 39; DB_COLLATE & # 39 ;,) line or it will not work.

 WP Revisions Code "width =" 1911 "height =" 1618 "class =" aligncenter full-size wp-image-26738 "/> </p>
<p> If you're not sure what the wp-config.php file is or how to modify it, you'll find a complete guide to <a href= here .

Optimize Your Images

Images can have a big impact on the speed of your site. Using a CDN will help you, but you should also compress your images without loss. You can find my tutorial complete to do it here.

You should also make sure to assign width and height attributes to your images.If you do not assign them, the browser should guess their dimensions until the image is loaded and the dimensions are known. adds an extra step that can negatively affect the loading time.

Removing unused styles from your CSS file

If you use W3 Total Cache to the maximum, then you are extend your CSS. But most of the time your CSS file will contain unnecessary code for your site that you can delete – making your minified CSS file even smaller.

For example, if you use a theme that has multiple color options, then each color has a separate CSS code for that color. Although it's great that a theme has eight color options, you only use one – which makes the code for the other seven color options just bloated. If you use the red version of your theme, you can remove the style for other colors. Or, if you do not use comments on your site and you do not plan to do so, you can remove the comment style. If your theme has a style for a wallet section that you will never use, you can also remove that style.

Important: Keep a copy of the original file in case you decide to change color, activate comments or

Remove query strings from static resources

If you run a WordPress site via GTMetrix, you will probably see your score missing in the "Delete" field. static resource query string "on the Page Speed ​​tab. If you click the arrow to view the specific problem, you will probably find that the style sheets for your plugins and some / wp-includes / files will be most if not all of the files listed.

To resolve this issue, you can add the following function to your theme's functions.php file:

// * Delete Query Strings static resources
function _remove_script_version ($ src) {
$ parts = explode (& gt; ver, # $ src);
return $ parts [0];
add_filter ('script_loader_src', '_remove_script_version', 15, 1);
add_filter ('style_loader_src', _remove_script_version & # 39; ;, 15, 1);

If you are not comfortable with the touch of the code, you can remove request strings with this plugin . However, I would not go into the plugin and add plugin bloat unless it is your only option.

Remove WP Emojis code

WordPress 4.2 added support emoji – which resulted in some CSS and JavaScript being silently added to your site's header. I do not use emojis on my WordPress sites, but that does not prevent me from loading the code to support emojis on all pages of my site – helping to inflate the code on the pages. If you do not use emojis for your site, you can remove the emoji code from your WordPress header by adding this function to the function file of your theme:

// * Remove WP emoji code
remove_action ("wp_head", &, print_emoji_detection_script & # 39 ;, 7);
remove_action ('wp_print_styles', & # 39; print_emoji_styles & # 39;);

For the altered code, there is also a plugin that will remove the code, but again, I recommend going on the code-based route as much as possible .

No comment? Then, no comment-reply.min.js needed

Important: If you allow comments on your site using the native WordPress comments, then you will want to skip this one.

However, if your site has comments turned off, then there is no need to slow down your site by making a request for a script that you do not need. To remove the comment-reply.min.js script from your footer, add the following code to your theme's function file:

// Delete comment-reply.min.js from the footer
function speed_clean_header_hook () {
wp_deregister_script (& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;);
add_action (& # 39; init; speed_clean_header_hook & # 39;);

To my knowledge, there is no plugin available this. If you know of one, do not hesitate to drop it in the comments below.

Side note: Andrew Norcross m pointed out that WP does not place the call of the comment script in your pages unless you have enabled comments on the page. However, I sometimes see the call on sites that have not activated them. He said that it is a thematic problem then and not a WordPress problem. But, he also noted that it is not dangerous to delete the script, so I will continue to do so. I would prefer not to call, but try to understand why some themes call it – even if comments are disabled.

Delete the WP embed script If you do not use it

Important: If you use the WP integration feature on your blog, the implementation will break them.

WordPress has an integration function that allows you to lazily integrate things from different resources. With this feature, I can incorporate a tweet simply by putting the old link to the tweet in my post or wrapping it in an integrated shortcode.

If you do not insert things in your WordPress site period – or if you're like me and you just use the old fashioned way to extract the full embed code from the original source, you can remove the call from the script to embed your code. To do this, add the following code to the function file for your theme:

// Remove the WP Integration Script
function speed_stop_loading_wp_embed () {
if (! Is_admin () ) {
wp_deregister_script (& wp-embed & nbsp;);
add_action (& # 39; init; speed_stop_loading_wp_embed & # 39;);

There is also a plugin that can do it for you – but again – I will recommend you to use the route based on the code if you can.

Keep your plugins to a minimum

The number of plugins I'm going to find on some WordPress sites I work with sometimes surprises me. I only recommend using a plugin if you are not able to run what the plugin does by adding code to your theme's function file. If there is a way (relatively simple) for me to avoid a plugin, I will try to do it.

You should not add plugins that are useless. If you are the only person who connects to your site, having a plugin to customize your WordPress login page is frivolous and will only make your database heavier.

Warning – plugins are not in question. The quality or poor quality of their coding largely explains whether or not they impact the speed of your site. Also, whether it's front-end plugins that add code to your page, or backend plugins that do not, that's also important. For the sake of simplicity though – and because I'm not a developer and I have no idea if it's coded well or not – if I can avoid using a plugin for a task, I will

disable and remove plugins that you do not actively use anymore. Too many times I will ask why there are three Pinterest sharing plugins enabled only to be told that two of them have not been used in years. If you stop using a plugin, you must disable it and delete it. This is not because you do not actively use the plugin on the front end that you do not insert code or calls to the files in your site code.

I also recommend you disable useless plugins

Evaluate the individual performance of plugins

When it comes to things you need to do a plugin, not all plugins are created from a performance point of view. The free plugin P3 (Plugin Performance Profiler) is a great tool for identifying low performing plugins.

Install the plugin, go to its dashboard under Tools> P3 from your WordPress dashboard and start your first scan. The result will show you which plugins slow down the performance of your site. If a certain plugin is a big culprit for hurting the speed of the site, you may want to look for an alternative plugin for the task that works best.

Gap Networks That Caused Massive Bloating

I was helping a friend who was having problems with his site taking forever to charge. We are talking about a loading time of more than 20 seconds. His site made 405 requests – yes, 405 – during loading.

The biggest speed problem on a single site that she knew was the result of using The Blogger Network as an advertising network; they called a ton of scripts from his code. The removal of this ad network alone dropped the load time of its site from 20 seconds to 7 seconds and reduced the number of requests that its site made to go from 405 to 175.

asks and adds 13+ seconds to its loading time.

That. East. Insane.

But a site owner has to make money and ad networks are one of the ways some sites do that. If you want to use an ad network, run an analysis of the speed of the site on your site, with or without the ad code, to see the impact of the latter on the performance of the site. All ad networks you use, including Google AdSense, call scripts in your site code, but not all ad networks penalize your site as much as the previous network. And the more you use ad networks, the longer the loading time will be slow.

Try to use ad networks that have the least effect on performance and try to limit the total number of ad networks you use in general.

What is your advice to improve the speed of your favorite site?

Got an extra tip to share? I would like to hear about this in the comments below.

Leave a Reply

Your email address will not be published. Required fields are marked *