Making WordPress faster on WordPress sites or blogs with a few hundred (or thousands) of posts, a bunch of plugins, comments and reasonable traffic becomes an essential task for the health of your site. And you have certainly noticed that our beloved platform is not always the fastest thing in the world…
The good news is that just a few optimizations can make a huge difference, especially if you’ve never taken on the task of making WordPress faster before. And even if you already have a good habit of keeping your WordPress running smoothly, think that what’s good can get even better – and a faster website benefits you, your visitors, and the Internet in general.
This is a guide to performance optimization best practices that I have gathered over many years of working with the platform. The idea is to always keep it up to date – so if you have any suggestions (or even a question), leave a comment and join the discussion!
10 Steps to Make WordPress Faster
1. Track performance changes
Before you start making changes, go to the testing tool, enter your website address, and do a speed analysis. The tool uses Google PageSpeed Insights and Core Web Vitals to evaluate your website’s performance and the result is a score from 0 to 100 for ‘Mobile’ and ‘Desktop’. The closer to 100, the better.
Note the result. This tool analyzes different performance criteria like load time, code optimization, etc. It’s important to have this upfront data before proceeding so you can see exactly how much performance your site has gained.
Done? Well, you’ve tested your site’s loading speed, but you need to eliminate another variable: the speed of your own internet connection. With this, you can be sure that what is slow is the website, not your access. Take the test below to measure your connection speed. If it’s below the contract, then take that into account, too, as the impact on your site’s (and any other’s) loading speed will be significant:
2. Make a backup
Don’t even start making important changes without having a good backup of your site first! It’s true that most of the tips here are a little “invasive”, but backing up is good basic practice, and we’ve even talked about it before (and how not to adopt this habit is a huge mistake!). Then make a backup using your hosting dashboard or a plugin like BackWPup.
That said…
3. The role of website hosting
Take a quick look: Is your hosting helping or hindering your site’s growth? Remember to differentiate well the quality of service from the category of service your site fits into. If your WordPress site gets tens of thousands of visits a day, don’t expect $1.99/month shared hosting to support the demand.
But, on the other hand, if your site does not receive any absurd visits and is still slow, there may be a problem with the quality of the hosting service. Keep this in mind when applying the following techniques, so that, in the end, you’ll decide if it’s time to change your WordPress hosting.
4. It’s time for the general cleaning!
It’s not much use worrying about the next steps (and even changing hosting) without first doing a GOOD cleaning in your WordPress installation. Not even a top-of-the-line dedicated server solves the problem of slowness if your WP is in poor repair – which is why it’s worth it:
– Disable and DELETE unnecessary plugins
Do a good review of activated plugins and seriously consider deactivating those that are not absolutely necessary. It could be that you forgot a maintenance plugin activated (even if configured to make your site public), or that plugin that simulates snow is not that interesting anymore. The great truth is that each plugin activated in your installation has an impact on the overall performance of the website, as in many cases their code is loaded on each page of the website, even if the plugin does not have a function there.
So do this review, disable and DELETE unnecessary plugins. Even if inactive, some plugins can represent important security holes. Not using, delete. You can always reinstall it again if needed.
– See which plugins impact website load time the most
Well, now that only the plugins necessary for the site to function remain, it’s time to find out if any of them are stealing the show and asking the server more attention than it should. Yes, it happens! Badly coded or misconfigured plugins are no rarity.
And how to know? Install P3 (Plugin Performance Profiler) and activate it. A new option will appear in the Tools menu (P3 Plugin Profiler). On the plugin page, click ‘Start scan’, then ‘Auto scan’. Wait for the process, which may take several minutes. In the results, you will be able to see exactly which plugins steal the most loading time, and even the time taken to load the theme, WordPress core, etc. For those who need more advanced data, the plugin also shows how much memory was used, how many database queries, etc. Don’t be surprised if the impact of plugins on loading is large, this is somewhat normal. But if a plugin stands out too much, try to disable it, if possible, or replace it with another one with the same function.
– Clean up post revisions and optimize the database
Every time you create and update new posts and pages, WordPress saves a version – called a ‘revision’ – that can be restored in the event of a disaster. An absolutely brilliant and advanced feature, but it has a little problem: old revisions are not automatically deleted. The textual content of posts and pages is stored in the database, and therefore, the accumulation of unnecessary revisions can result in an inflated and inefficient database – and believe me, large databases are slow and have a relevant impact on time. site loading.
The good news is that there is a very efficient plugin that deletes old revisions, as well as trash content, SPAM comments and other unnecessary things. And once that’s done, it optimizes the database tables to get everything in order. Optimize Database after Deleting Revisions does the magic and, like the other plugins listed on this page, we use and approve.
Of course, of course: if you followed the advice to backup before starting the optimizations, then there’s nothing to worry about. Despite being very secure, the plugin puts its hands directly on the database, and that’s no joke. Make a good backup before proceeding!
Extra: You can also control the maximum amount of revisions WordPress stores, or even turn this off completely. If you are comfortable editing the wp-config.php file, just enter the following:
define( 'WP_POST_REVISIONS', false );
This completely disables revisions. If you just want to limit the number of revisions stored (recommended), use the following:
define( 'WP_POST_REVISIONS', 3);
In this case, revisions are limited to 3 per post. You can use any number in place of 3 as long as it’s greater than zero (if you use zero, it’s the same as using “false” and this disables revisions).
5. Review use of third-party services
Your website likely uses various services that rely on third parties: Google Analytics, Facebook Like and Google +1 buttons, Twitter, etc. The problem is that many of these services do not use asynchronous loading, which makes the general loading of your WordPress also depend on the loading of external scripts. From experience, placing social share buttons can have a 1-2 second (!) impact on your site loading, and since it depends on third-party servers, there’s not much you can do about it…
…there wasn’t much to do. The Lazy Social Buttons plugin came to solve the problem once and for all. The strategy is very clever: the plugin displays ‘fake’ share buttons, and when a reader hovers over them, only then loads the real buttons (saving about 300Kb of data when loading the page for the first time, according to authors). Despite using a sophisticated strategy, installing and configuring the plugin is very simple. Worth implementing!
It is important to note that access statistics and analytics services, such as Google Analytics, have been using asynchronous javascript for a long time, and therefore their presence has no relevant impact on visitor wait time.
6. Too much beauty, too little efficiency?
With the virtually endless supply of themes on WordPress, I have no doubt that you’ve taken the time to choose the perfect look for your website or blog. But have you ever stopped to think that this also has an impact on performance?
The problem is that there are very poorly coded themes (some even with malware), dragging your installation into an ocean of inefficiency and wearing out your hosting more than necessary. If you made a diagnosis using the P3 plugin (see item 3), you must have seen the ‘theme’ item in the performance graph. If it’s taking up a large chunk of the chart, it’s time to seriously consider switching themes.
Do you doubt the impact this can have? If your WordPress is a little slow, try changing the theme to ‘Twenty Seventeen’ (preferably at a lower traffic time). Go to the site from a private tab (or after logging out) and see if there is any noticeable difference in load times. These are signs that the theme may be hindering the performance of the site, no matter how beautiful it is…
Opt for quality providers when choosing a theme. There are hundreds of them, which offer free and paid themes. The paid ones are usually of better quality, and even then you need to pan out a bit.
ElegantThemes themes are always beautiful, functional and well coded. The same goes for the numerous options available on ThemeForest, which is a marketplace that allows developers to sell their own themes. Site policies are strict about code quality.
As for ElegantThemes, they develop what in our opinion is simply the best visual builder on the market.
7. Install a caching plugin
The changes so far should have breathed new life into your site… but let’s move on to the next level, which is getting your WordPress to display static pages to visitors.
Because? Well, if you are not familiar with how the platform works: WordPress is programmed in PHP, a programming language that “runs” on the server. In addition, all website data is stored in a database, also processed on the server.
Every time a visitor accesses your website or blog, a request is made to the server, which fetches the data from the database, and, with the instructions of the PHP code, generates a page that is sent to the visitor’s browser. This happens every time someone visits a page on your site. The problem is that, with an increasing number of visitors, this process becomes very inefficient and ends up demanding a lot from the server. Result? The server ends up being busy for too long for each visitor, and pages load slowly.
And if it were possible, instead of querying the database and generating each page for each visitor, do this procedure once and save the result as static content (HTML) to be displayed to all visitors, no matter how many access the Same time? That would save the server quite a bit, right?
This is possible with the use of specialized plugins. These plugins do the work of generating static versions of all your WP pages and posts, storing them and displaying them to anyone who visits. The impact of this on performance is immense, and if you’ve never used a plugin like this before, you’ll see your site practically reborn.
One of the most popular and reliable plugins for this task is W3 Total Cache. Install it and activate it.
After activating, you will see a new menu – Performance. Click on the ‘General Settings’ submenu. There are many ways to configure and optimize W3, but let’s cover the basics that already work very well: simply set the following options to ‘Enabled’:
- page cache
- minify
- Database cache
- object cache
- browser cache
Click on ‘Save all settings’, and then access your site from a private tab or after logging off (the plugin by default does not serve the static version for the logged in user).
Browse the site a little, and return to the home page.
BOOOM.
Did you feel the difference? I bet so. If you’ve never used a WordPress caching plugin before, you’re in for a whole new world of performance. The actions so far have been enough to give your site a new lease of life, and I’m sure you’ll already notice big differences when you retest the zero point of this guide.
While the W3 is a good start, you can get even more performance with more professional options. The best performing caching plugin currently is WP-Rocket, which is not free (it costs $49 per year, around R$280).
The plugin is incredibly simple to operate – just activate it to immediately benefit from optimizations and advanced caching. It also includes minification, database cleanup tools and advanced options for those who need fine control. But for the user who doesn’t want to deal with it, just keep it active and it works perfectly.
WP-Rocket has consistently proven to be the highest performing caching option on the market. The fact that it’s a paid plugin may scare some people, but the performance gain is real and it’s worth every penny invested in it (it’s also worth remembering that if your site is on BlogLite, then you already have a WP-Rocket license installed and configured on your website at no additional cost).
8. Does your site have a lot of photos and media content? Use a CDN.
CDN is the acronym for Content Delivery Network. It is a sophisticated service that allows your site’s media content to be served from a network of servers distributed around the world, in such a way that the visitor receives the data from the geographically closest server. This unburdens the server on which the website is hosted, and, due to the proximity of the user’s media server, makes the overall website load faster.
There are many CDN services on the market aimed at small and medium sites (consider that a few years ago this type of service was only available for large sites because it was too expensive), and prices have been dropping over time.
Using a CDN can greatly improve the experience for your visitors, especially those accessing from slower connections. Over time, you can opt for a more complete CDN service, which can even be easily configured in the W3 plugin and WP-Rocket I talked about in the previous section.
Also, always properly compress your images before uploading. Also limit the dimensions of the images – think that it must be suitable for the web, so don’t upload that 500 megapixel photo you took with a professional camera – resize, compress and make life easier for those who access your site (especially when the person accesses from a cell phone using the data network).
9. Digging deeper: time to clean the database
If even after following the steps above your site is still sluggish, it might be a good time to do a deeper clean. In this step, make sure you’ve actually made a backup – as I insistently suggested in step 1 😉
That’s because the suggestions in this step change the database directly. If something goes wrong, you can easily recover everything.
Install and activate the WP-Sweep plugin. Its settings will be in Tools > Sweep.
In one fell swoop, this plugin is capable of automated cleaning of unnecessary data that is clogging up your database and potentially impacting your site’s performance. Some of the items that go into heavy cleaning are:
- Post and Page Revisions (WordPress ends up storing many versions of the same page/post over time, which is completely unnecessary for most people)
- Comments already deleted
- Comments rejected and marked as spam
- Orphaned entries in the database
- Duplicate entries in the database
- Transients stored in WordPress options table. Just as a curiosity, I was already surprised with a WP installation that had more than 1 million transients stored in the options table. It’s no surprise that after the cleanup, the site came to life again. Lots of life. By the way, transients are, in a very simplified way of saying, like a cache of complex database operations. They can be deleted without any problems because WordPress or plugins recreate this on demand.
As a bonus, WP-Sweep optimizes database tables. The only thing to note is that this entire cleaning process consumes a lot of processing resources and should be done at a time of lower traffic on the site. Otherwise, your visitors will be faced with an EVEN slower site as you try to get your house in order. Not cool.
10. Combine, compress, throw to corners
Do you think it’s over? There is still something to optimize in this warrior that your WordPress site has.
An advanced tactic is to combine and compress (or “minify”) the scripts that are loaded by your theme and active plugins. In most cases, JavaScript and CSS files.
By consolidating multiple files into one and using compression techniques, the visitor’s browser will make fewer connections to the server and will be able to download content more efficiently. Another good practice is to have all CSS loaded in the site header, and JS loaded in the footer whenever possible.
This whole process can be done by plugins (W3 Total Cache, which I mentioned above, has a basic function for this, and WP-Rocket does it in an advanced and automated way). Keep in mind that consolidating and repositioning scripts can “break” themes and plugins, depending on how they work. This is a strategy that is more advanced and requires a lot of trial and error to get the balance right.
Optimization for performance: a process…
I would like to end by saying that optimization actions are a habit, not a single action over time. A well-managed WordPress installation will always benefit from some or all of the above tips, and many of them (like cleaning plugins and post revisions) can be done with some frequency to keep everything in order and running as smoothly as possible.
The good news is that WordPress is getting better with every release, and with that there are good expectations that the issue of optimizing for performance will be a constant concern for developers. This, combined with the good practices of those who administer the sites, results in a healthy and always fast installation for visitors – who, by the way, are the absolute judges of our efforts.
If you host your WordPress on BlogLite, then there’s nothing to worry about: all of the above best practices (and many more, highly technical ones that wouldn’t fit in this article) are already in place.
What did you think of this guide? Have you implemented any of the tips? Do you have any suggestions that you tested and approved? Join the discussion in the comments!
And now? Did it work?
There is no performance optimization without accurate testing. So, after following the steps above, test your site again using our tool. Follow the steps in the performance report and you’ll soon have a super fast WordPress site! 🙂