WordPress optimization is a vital task to make sure your website is running as efficiently as possible. Optimizing WordPress involves caching, image compression, page speeds, cleaning the database and even website hosting.
In this guide, we plan on sharing everything you need to know about WordPress optimization and how to turbocharge your WordPress website. We’re going to look at specific WordPress optimization actions that you can take right now that will bring noticeable improvements to your WordPress site. You’ll also learn about WordPress optimization resources. Let’s dive in!
What is WordPress Optimization?WordPress optimization involves any effort to enhance website performance, efficiency and speed. An optimized WordPress website will load faster, run faster, improve your SEO, retain more traffic and create a better overall user experience (UX) for your visitors.
The process of WordPress optimization involves improving the performance of different aspects of your website, including:
- Image optimization (compression)
- Page speed
- Your website’s database
- Website hosting
- Software versions
- Code and scripts
Whether you’re running a small blog on low-cost shared hosting or a high-traffic corporate WordPress installation, optimizing your WordPress site and server to run efficiently is absolutely critical.
If you’re looking for a fast and effective optimizing fix with the smallest amount of hassle, head straight to this article’s Caching section. Often, WordPress caching is the best place to begin optimizing your site because you’ll notice immediate results without a lot of effort.
If you’re looking to fully optimize your site beyond standard caching optimization, you’ll definitely want to read the rest of the material in this guide. Remember that a fully optimized WordPress website not only improves the performance of your site, but it also improves the performance of your bottom line.
For those of you that manage multiple WordPress sites, most of the optimization techniques we’ll discuss will also apply to MU (WordPress multisite).
WordPress Optimization Explained
When it comes to WordPress optimization, a number of factors impact how well your WordPress website or blog performs. Some of the factors include (but aren’t limited to):
- Your hosting environment
- Your WordPress configuration and code
- Your software versions
- The number of images or graphics on your site, and their file sizes
In order to fully optimize a WordPress website, all of these areas need to be reviewed to see where improvements can be made, including implementing a WordPress caching system, compressing images, improving page speed, cleaning the WordPress database. Lastly, you’ll need to take an honest look at the quality of your website hosting.
Why Should I Optimize My WordPress Site?An optimized WordPress site will set your site up for the best possible success, so it’s worth the effort to audit your site’s performance, speed and efficiency.
To put it plainly, the amount of time that your site takes to load will directly influence how successful your site can be. A slow, inefficient site turns away visitors in droves. In general, a site that takes more than five seconds to load will result in extremely high bounce rates. No matter how well you market and promote your site, if it’s slow it’s probably going nowhere fast.
The Importance of Optimizing WordPress
A fast, optimized site also influences how your site is ranked in search engines. The faster your site is, the more Google will like it (and rank it up with the big boys). Beyond higher SEO rankings, you’ll also likely notice an increase in spider crawling by search engines after optimizing your site.
7 Areas of WordPress Optimization
As you look at undertaking the process of optimizing a WordPress site, there are five important areas of WordPress optimization. Let’s take a look at each of the areas.
1. WordPress Caching
WordPress caching helps your website load more quickly by reducing the amount of data transfer between your site visitor’s browser, your site’s WordPress database, and your website’s web server.
In short, WordPress caching is a critical part of WordPress optimization, or how you get your WordPress website to run as efficiently as possible.
WordPress caching can dramatically improve performance by reducing page load times. Instead of serving up dynamic content with each page load, WordPress can instead generate static HTML files to your visitors. This means faster page loading and less load on your server.
WordPress Caching Plugins
When it comes to WordPress caching, you can easily install one of the best WordPress caching plugins such as WP Super Cache and W3 Total Cache to cache all of your pages and posts as static files. Your server then feeds the static files to your users, thus reducing server processing load. For relatively static pages, this simple step can improve performance many fold. It’s important to understand that pages and posts with a lot of dynamic content are more difficult to configure in a caching tool. But it can still be done.
W3 Total Cache (W3TC) Plugin
The W3 Total Cache plugin combines the research of many authorities in web development. It provides a great user experience for WordPress developers.
The plugin is unique in its ability to optimize client-side and server-side performance. It adds useful optimization functionality that isn’t natively available.
W3TC helps your page caching by decreasing response times through the creation of static HTML page versions. It will automatically update cache if a page is edited or a comment is made.
It also caches database queries. This will allow your site to reduce how much time is required to generate a new page. Because of this, W3TC is useful for websites that have a lot of user comments.
W3TC also manages headers, such as cache-control, entity tag and expires. These control how web browsers cache files and can reduce server load while improving how the site performs for users.
You can use W3TC to optimize your WordPress installation in single- and multi-server environments, through dedicated or shared hosting.
WP Super Cache Plugin
WP Super Cache is a static page caching WordPress plugin. This plugin’s job is to generate HTML files that Apache serves directly. This is done without processing heavy PHP scripts, which helps make noticeable gains in speed on your site.
By using this plugin, your server will serve the cached pages at the identical speed that it serves standard graphic files.
If your site struggles to keep up with it’s daily load of traffic, give WP Super Cache a try. You’ll appreciate the results.
Caching on the Server Side
Caching on your web server is a more complicated endeavor that’s most commonly used on sites with extremely high levels of traffic. There are so many available options that it’s impossible to cover all of them in this article.
However, it’s important to know that adding Alternative PHP Cache (APC) to your server will help exponentially improve your site performance. You can also use Varnish Cache in conjunction with W3 Total Cache to save pages that are pre-built and stored to memory. They’re then quickly served to users without requiring any execution from PHP, Apache or WordPress stack.
2. Image Optimization & Compression
WordPress image optimization involves reducing the file size of images without negatively impacting the way the images appear on a screen to the naked eye.
There are several ways that images can be optimized for WordPress websites, using different tools and techniques. But no matter what the specific process is, the goal is to shrink the file size without noticing any loss in image quality.
Optimizing all of your WordPress site images should be at the top of your priority list for WordPress optimization. The process of optimizing your images will make your site weigh a lot less and load faster than it ever has, capturing more new users and making them come back for more content.
After all, no matter how great your content is, it won’t matter if users leave before they consume it. Utilizing smaller file sizes means that you can fill your site with even more images without weighing it down or making it run slower.
There are three main ways to optimize images for your WordPress website:
- WordPress image optimization plugins that allow you to do the work directly from your WordPress admin dashboard.
- Pre-upload image optimizer software/application – These applications can be either open-source software like an image optimizer or, at minimum, a photo editor, or paid apps that provide image size adjustment capabilities. Photoshop is an example of a premium software application that allows you to adjust image resolution to compress images for web usage.
- Free online services that compress and optimize your images prior to uploading them to WordPress.
Using A Pre-Upload Image Optimizer
Generally, optimizing an image means compressing it. An image optimizer, or compressor, is a software program that you install either on your personal device or access online via your web browser.
To use an image optimizer, you simply upload an image and allow the program to make slight changes to the pixels. These charges cannot be detected with the naked eye, which is why the process is sometimes referred to as lossless compression.
The same type of technique is applied when you compress an audio file into an MP3. In that process, the high frequencies get strategically reduced in a way that the ear cannot detect any change.
WordPress Image Optimization Plugins
If you’d like a WordPress image optimizer that works right within your WordPress content management system, an image optimization plugin is the way to go.
With a WordPress image optimizer plugin, all you do is upload your image to WordPress and the plugin will automatically compress it to the settings you’ve predefined. You can also compress and optimize each image manually if you prefer.
In the WordPress plugin repository, you’ll find dozens of plugins for optimizing images. Some of the best WordPress image optimization plugins options are:
Choose the one that’s easiest for you to work with and customize for your needs.
3. Page Speed Improvements
While we’re including “page speed” as an area of WordPress optimization, it’s also one of the ultimate goals. Page speed is incredibly important, especially since Google factors it into your SEO ranking:
Speeding up websites is important — not just to site owners, but to all Internet users. Faster sites create happy users and we’ve seen in our internal studies that when a site responds slowly, visitors spend less time there. —Official Google Webmaster Central Blog
Not convinced? Just check out this entire guide from Google on why speed matters. Since Google puts so much weight on the quality of user experience, you should too. Not only is page load time a key element in making sure visitors stick around, but it’s also been shown to increase overall page views, and ultimately, increase revenue.
WordPress optimization will speed up your page loading times, but you first need to do a few tasks to take a look at the current state of your page speeds.
10 Ways to Increase the WordPress Page Speed
There are several steps WordPress site owners can take on a regular basis to make sure their site is running at top speed.
1. Audit Your Plugins
While many plugins are well designed and have an almost unnoticeable effect on your site speed, other plugins will add hundreds of milliseconds to your load time (just multiply that by number of plugins on your site).
So, what can you do? Every 4-6 months you should go through your plugin list and do a mini-audit. Ask yourself:
- Do you no longer use a plugin?
- Is this plugin underperforming?
- Is the plugin calling deprecated functions?
- Are there new plugins that perform the function better?
2. Shrink Your Images
Back to the previous section, optimizing images can have one of the greatest impacts on your page load time, so be sure to optimize and compress your images so they load as efficiently as possible.
3. Implement a WordPress Caching Solution
Again, WordPress caching enables your server to send files to visitor’s computers as fast as possible. Using ANY caching option is going to be better than not doing any caching.
4. Get Rid of Post/Page Drafts, Revisions and Trash
If you have lots of post drafts, edits or revisions, it will eventually drag down your site. Why? Because it’s forcing your site’s database query to sort through more entries than it actually needs to sort through.
5. Turn off Pingbacks and Trackbacks
Pingbacks and Trackbacks are more often than not used by gray hat sites trying to eke out tiny bits of SEO. So, we suggest you turn them off completely.
6. Minify Your Code
Remember that browsers don’t really care what the code looks like, and every single white space in your source code take a little bit of time to load into your visitor’s browser. So minify it to gain just a little speed.
7. Customize High Traffic Pages
Spend some time figuring out which pages on your site are the highest-traffic pages/posts/content. Once you find your highest-traffic pages, start customizing the speed. Make sure you don’t have any unnecessary scripts running on those pages, all images are optimized, etc.
8. Optimize Your WordPress Database
We’ll cover more on this in the next section, but optimizing your WordPress database can help improve your page speed times. Why? Older WordPress sites will accumulate junk in the database over time (old plugins, themes, settings, etc.), so be sure to clean these out.
9. Make Your Scripts Sit in the Corner
The way a webpage is displayed on your visitor’s browser is by starting at the top of the file and going step-by-step until it reaches the end of the file. This means that if you have loaded up your <head> section with a TON of scripts, nothing else gets loaded until all the scripts finish loading.
Yes, you can check to see how many of the scripts can handle asynchronous loading so they won’t block the loading of the page, but you’ll probably find that it’s much easier to move the scripts to the bottom and the CSS files to the top.
10. Be Careful with External Scripts
We are not talking about scripts being pulled from CDNs or Google’s script server, but rather code/scripts used for Facebook or YouTube. Remember that every time you embed a video or use a social sharing plugin or even social comments, you have to be careful about how long it will take to load all those scripts (ESPECIALLY from Facebook). Consider if there is another way to accomplish the functionality WITHOUT requiring external scripts to load.
4. WordPress Database Optimization
With time and use, WordPress databases can become corrupted or need good overall housekeeping. This is where WordPress database optimization steps in.
You should optimize your WordPress database on a regular basis to keep it clean and functioning at its best. Without regular optimization, you’ll notice that your WordPress site speed will slow down over time. WordPress database optimization is a relatively simple process with a couple of different ways of getting it done.
Easy WordPress Database Optimization with iThemes Sync
iThemes Sync is great tool to help you manage multiple WordPress sites. Within the iThemes Sync dashboard, you can perform several database optimizations all at once, for all your WordPress sites.
Here are a few of the WordPress database optimizations performed by iThemes Sync. You can select all of these to run and iThemes Sync will go to work deleting the unnecessary bloat from your website.
- Delete Trackback URLs – Deletes URLs added to the “pinged” and “to_ping” columns in your posts table.
- Delete All Revisions – Deletes all revisions from posts, pages, and all other post-types.
- Delete All Trackbacks – Deletes all trackbacks from other sites stored in your comments table.
- Delete All Pingbacks – Deletes all pingbacks from other sites stored in your comments table.
- Delete All Auto-Drafts – Deletes all auto-drats from posts, pages, and all other post-types.
- Delete All Trashed Items – Deletes all posts, pages, menus, and all other post-types that have been trashed but not yet deleted.
- Delete Unapproved Comments – Deletes all comments waiting to be approved.
- Delete Trashed Comments – Deletes all trashed comments that have yet to be deleted.
- Delete Spam Comments – Deletes all comments that have been marked as spam.
- Delete Orphaned Commentmeta – Deletes all commentmeta that references a deleted comment.
- Delete Akismet Metadata – Deletes all metadata attached to comments by the Akismet plugin.
- Delete Stale Transient Options – Deletes all transient options that expired more than a week ago.
Optimize Database via phpMyAdmin
The first way of doing it is by logging back into phpMyAdmin and clicking on “Databases.” Here, you’ll see listed the database you want to optimize. Again, you’ll see all of the tables related to your website database.
From there, all you need to do is scroll down the page and click on “Check All.” Then navigate to the “With Selected” drop-down menu and choose “Optimize Tables.”
The system now optimizes all of your selected tables.
WordPress Database Optimization Plugins
If you’d rather optimize your WordPress database with a plugin, there are a couple of different ones that you can use. This may be a more comfortable option for you if you’re not excited about poking around in the database manually.
The first one is called WP-Optimize and can be found on the WordPress plugin repository.
This plugin is simple to install and operate for nearly anyone that manages a WordPress database. You can also use it to schedule an automatic optimization at any time of the day or night.
5. WordPress Hosting
The techniques you’ll have available to you for optimizing your site will be dependent on the setup of your host. But hosting built specifically for WordPress sites is always a good idea; these hosts already know what to do to optimize their servers and hardware for WordPress websites.
Shared WordPress hosting is the most common and likely the one you’re using. If you’re not sure about your hosting plan details, you’re probably on a shared host.
With shared hosting, your site is hosted on a server with many other sites. Your host company manages your server, which gives you very little control over the server settings that are run.
As such, the most relevant optimization areas for sites running on shared hosts are:
- Content offloading
- WordPress performance
As your site begins to grow, your host may require that you move onto a dedicated server. You’ll then have much more control over optimizing your site with server settings.
Dedicated Servers and Virtual Hosting
This hosting option gives you complete control over your website’s server. The server that runs your site may be a dedicated hardware piece or one of several virtual servers that share physical hardware.
The key with a dedicated server is that you have control over the settings you want to run. This control is important when you’re optimizing your site on the server level.
Number of Servers
For sites that bring in very high levels of traffic, it becomes necessary to use multiple site servers. If you’ve reached this level of performance, congratulations. You’re probably the envy of many of your competitors.
Note that your WordPress database can easily be moved to different serves and will only require a minor change to the .config file. Static files and image files can also be moved to alternative servers.
A tool such as Amazon’s Elastic Load Balancer will help you spread site traffic across a number of servers. But it’s not a simple tool and may require some WordPress training.
However, when employed correctly it is a great optimization tool for sites running on multiple servers.
Performance of Server Hardware
The way your server’s hardware performs will hugely impact site performance. For example, your processor speed, number of processors, amount of memory, disk space and storage mediums of your disks are all very important factors.
Most hosting providers typically offer higher performing hardware for a higher-than-standard price point. If you’re serious about optimization and site speed, talk to your host about increased hardware performance options.
We’ll cover this in a bit more detail in a minute.
CDNs and Geographical Distance Factors
Did you know that the physical distance between your website server and an individual site visitor actually affects how your site performs for that visitor?
And if that’s true for one visitor, then it’s true for all visitors.
By employing a Content Delivery Network (or CDN), you’ll be mirroring images and other static files across a number of geographic regions. This allows all site visitors to experience the most optimal performance, regardless of their physical location.
How much traffic is on your server? How is it configured to handle its load? Both of these factors will impact your site performance.
For example, if you’re not using a site caching solution, your site performance could slow to a relative halt if a high number of additional page requests hit the server. If they stack up, they can often crash your web or database servers.
When properly configured, a quality hosting solution will be able to handle very high amounts of traffic.
High levels of abusive traffic, like login Brute Force attacks, Distributed Denial-of-Service (DDoS) attacks and image hotlinking can often be devastating on server loads.
If you’re experiencing a sudden slow in server speed, there’s a chance you may need to identify and block one of these abusive traffic attacks.
Offloading your traffic to additional servers also reduces server load.
6. Software Versions
To run an optimized site, it’s important that you are always using the latest versions of software. This must be done in order to stay on top of bug fixes and other software upgrades that enhance site performance.
You may not think of plugins and themes as software, but they also fall under this umbrella when it comes to running the latest version of any themes or plugins you have running on your site. Be sure to always update WordPress, for both the optimization and security of your site.
Always run the latest versions of:
- WordPress core
Sometimes, a small bug fix in the software you’re running can make a big impact on your site optimization and performance. On the server side (or with your WordPress host), ensure that you’re currently running the latest versions of:
- Windows (or Linux)
- PHP (you may already have seen a WordPress PHP update required error message in your WordPress admin dashboard)
More on Optimizing PHP
There are a number of PHP accelerators that can dramatically improve how your PHP files perform. This will not just apply to your WordPress installation, but to all PHP files.
You can search, for example, for APC or OPcache PHP optimization to find the PHP accelerators that are available.
7. Code & Scripts
The theme you’re running has a very large impact on how your site performs. A lightweight, fast theme will perform more efficiently than that heavy theme laden with graphics and complex animations. All comes down to the code base of the theme.
Beyond the theme you run, the type and number of plugins (and the way they were coded) you have running on your site also helps dictate overall site performance. A simple step you can make right now to optimize your site is to deactivate and delete all plugins that aren’t needed.
It’s also vital to keep up with all WordPress core upgrades and updates when they’re released.
Note: If you’re currently running an older version of WordPress, take a minute to backup your site with a WordPress backup plugin like BackupBuddy. Then update your site to the current version of WordPress.
Tools To Test WordPress Performance
How do you know how your website is performing? It’s difficult to know for sure how your site is performing in different areas and regions if you’re not using a tool to measure it properly.
By using WebPageTest, you’ll be able to test your real-time site performance from different browsers, locations and connection speeds.
Beyond that, you can use the built-in developer tools in your browser (such as Chrome and Firefox) to measure your site’s performance before and after optimization efforts.
iThemes Sync also has a new tool to help you audit the audit the performance, SEO, web development best practices and accessibility of every website in your Sync Pro dashboard.
Harnessing the power of Google Lighthouse, you can get an instant report of how your website is performing with suggestions on how to make improvements.
How Do I Optimize My WordPress Site?
Now that we’ve covered the various areas of WordPress optimization, let’s cover how to optimize a WordPress site step-by-step.
WordPress Optimization Steps
1. Deactivate and delete all plugins that aren’t necessary
The easiest and often most effective way to improve the performance of your WordPress site is to take care of your plugins. Because it’s the easiest step you can take, let’s do that first.
After that, selectively disable the plugins that you’re running in order to measure how your server performs during each change. If you notice that one particular plugin significantly affects the performance of your site, dig into the documentation for that plugin or seek support. If the issue can’t be resolved, consider if you want to continue running the plugin or find a better alternative.
2. Implement a WordPress caching solution.
Caching can have a dramatic improvement for WordPress optimization. Either use a WordPress caching plugin or work with a host that provides server-level caching for your site.
3. Optimize your images
Do you have a lot of heavy images on your site that aren’t necessary? Could you replace some of them with text or remove them completely?
For the images that you are using, it’s important to optimize your image files and make sure they’re in a proper format. WordPress recommends that you only use these file types for images:
You can also optimize your images by combining multiple files into one single, optimized file. By reducing the number of files that your site needs to display, you can speed up page load times.
4. Review your web host’s performance
If you’re like most, you don’t necessarily want to pay more for web hosting. However, paying a bit more for higher levels of service can be an extremely effective way to optimize your site.
Simple things like increasing RAM or switching to a provider that features Solid State Drives will make a huge difference. Also, increasing processor speed and the number of processors running can help improve performance. Whenever possible, separate services that have different functions, such as MySQL and HTTP, on different servers.
Of course, it’s understandable if you don’t have the time or knowledge to perform all of these changes on your own. In that case, talk to your host about doing them for you.
Your provider should be able to upgrade your account or move it to an upgraded server that matches standard optimization recommendations. If you need to, you can always switch to a managed hosting solution.
5. Optimize Your Web Server (If Possible)
If you have access to your web server to make changes or improvements, you can configure your web server to increase site performance. This involves a wide array of techniques that include:
- Web server caching
- Setting caching headers
- Reducing load per visitor
For more customized information on how to perform these functions, you can search for the optimizations that are specific to your web server (“Apache optimization techniques,” for example).
Several web servers offer higher-speed versions for an added cost. An example is Apache Litespeed.
The plugin W3 Total Cache will offer integrated support for APC, OPcache and Memcache caching.
6. Optimize your WordPress database
Use the section on optimizing the WordPress database for more information on helping your database run more efficiently. Over time, your WordPress database will need a little housekeeping.
7. Test your website’s page speed and peformance
Use a tool like iThemes Sync or Google Lighthouse to audit your website’s speed and performance. These tools also help give more specific suggestions on what you can improve.
8. Keep improving!
As you make progress on your WordPress optimization efforts, be sure to add it to your list of WordPress maintenance tasks. When it comes to the task of optimizing WordPress, the work is ongoing (but worth it!)
More Optimization Plugins for WordPress
Some additional optimization plugins you’ll want to look into include:
- Hummingbird Page Speed Optimization
- Optimize Database after Deleting Revisions
- Smush Image Compression and Optimization
- EWWW Image Optimizer
- ShortPixel Image Optimizer
- LiteSpeed Cache
- WP Fastest Cache
- WP Rocket
Your Complete WordPress Optimization Guide
Throughout the years, there have been a ton of WordPress optimization articles and tutorials published about different ways you can optimize WordPress and speed up your website. We hope we’ve added another helpful guide on WordPress optimization.
Now that you’re equipped with the tools you’ll need to optimize your site, it’s time to get to work. But before you do, make sure your site is fully protected from malicious attacks with a WordPress security plugin like iThemes Security. By combining the best in security with the best in site optimization, your WordPress site will be running on all cylinders.