10 Easy Ways to Speed up WordPress Site
Today, more and more businesses are relying on the power of WordPress – so it’s no wonder that the loading speed of WordPress sites are now a key factor. Simply put, slow WordPress sites are bad for business. That’s why it’s so important to have a speedy website that is not only SEO friendly, but user friendly, resulting in great user engagement with high page views.
In this research article, our technical team have performed some in-house tests to see what makes a WordPress website speed up and eventually become more SEO friendly.
The steps that we took to Speed up our test WordPress site were:
- Installing WordPress Cache Plugin and Leverage Browser Caching
- Optimizing Images
- Enabling Gzip Compression, and
- Using a Content Delivery Network
After taking all of these steps, the site certainly showed some improvement in the speed, but it was not yet up to the mark. In the subsequent stages, we added a few more steps to make our experiment more comprehensive and result oriented.Beginner or intermediate wordpress knowledge and troubleshooting skill will help you to quickly follow each instructions suggested.
During the experiment, we used the Google Page Speed Insight tool to measure the actual page speed in the count of 100. The higher the score, the faster the speed. This tool also indicated the negative factors responsible for slowing down the WordPress site, and offering suggestions to speed up the WordPress site.
Throughout the testing, we used this tool to run a speed test on our customer’s blog, With very slow speed times, their aim was to urgently speed up their WordPress site. After performing all the following steps, we successfully resolved all the WordPress speed issues and scored 100/100 with the Google PageSpeed tool.
Here Are The Top 10 Easy Ways to Speed up Your WordPress Site
- Choose the Best Web Hosting Provider
- Install WordPress Cache Plugin & Leverage Browser Caching
- Optimize Images
- Enable Gzip Compression
- Empty Trash and Optimize WordPress Database
- Use Content Delivery Network
- Reduce Post Revisions and Disable Trackbacks & Pingbacks
- Split Comments & Long Posts Into Pages
- Don’t Upload Videos Directly to WordPress
1. Choose the Best Web Hosting Provider
Before you start to optimize your WordPress site, make sure that your web hosting provider isn’t slowing down your website. Web hosters frequently oversell their servers and that will impact your server response time.
If your server’s response time is higher than 200 ms, the Google PageSpeed test will show a red flag against “reduced server response time”. This means that your web hosting server is slow, and you need to contact your hosting provider to improve the response time. We conducted a PageSpeed test for our customer’s WordPress blog before migrating them to our hosting environment, you can see the test results below.
The test result is showing a red flag instructing us to “Reduce Server response time”, which was measured at around 4.2 seconds. Due to the poor server response time, the PageSpeed score is reduced to 68. WordPress sites with page load times under 2 seconds are said to be good, but you should make it as fast as you can. As per the PageSpeed insight, the server response should be under 200 ms.
What Is the PageSpeed Score Of Your WordPress Site? Click Here to Find Out.
After this test, we migrated our customer’s WordPress site to our highly Optimized WordPress Hosting platform, and a second PageSpeed test was performed. The results speak for themselves:
Google Page Speed Insight Server Response Time Feedback Fixed
After migration Server’s response time is reduced to 200 ms and “Reduce Server Response time” error is now resolved.
A hosting provider isn’t always the problem, sometimes you see poor response time, even if you’re hosted with a great web hosting provider. It’s because, your website is outgrown enough, and your current hosting plan is no longer capable of running your website optimally.
In that case, upgrade your WordPress hosting package to next higher plan, or more powerful hosting option such as VPS Hosting. If you don’t see improvement in server response time after upgrade, consider switching to a good hosting provider.
2. Install WordPress Cache Plugin & Leverage Browser Caching
After reducing server response time, the next error we will resolve is related to “caching” of content. Google highly recommends caching the static content of your WordPress and leveraging your browser’s caching facility. Caching the static content will easily speed up your WordPress site by 3 to 7 times.
Install Caching Plugin & Enable Browser Caching
After our extensive testing on a few WordPress Caching plugins, we found the following three very useful for caching functionality.
If you don’t want to use these plugins, you can also enable browser caching by adding Expires headers code to your .htaccess file.
A you can see from the image below, the Google PageSpeed score before installing any WordPress caching plugin was 64 / 100. The error that google showed for this poor score? ‘Leverage browser caching’.
Google Pate Speed Insight Score Before Enabling Caching Plugin
We decided to install W3 Total Cache plugin for content caching. After installing, we retested the page speed and the results were outstanding.
After installing W3 Total Cache caching plugin
Google Page Speed Score: 83 / 100 (improved)
Reason for this improvement: Leverage browser caching error is 95% corrected.
To speed up WordPress, W3 Total Cache plugin sets the expiration to all internal scripts. For example, your CSS scripts will be cached for 7 days, images will be cached for 30 days, e.t.c. After setting up this internal caching, the ‘leverage browser caching’ warning was 95% corrected.
Google Page Speed Insight Score After Enabling Caching Plugin
95% of errors under the Leverage browser caching were then corrected. 5% of the errors are still there, but they were due to 3rd party scripts like Facebook and Twitter, where this tool cannot set caching. There’s nothing much can be done as you don’t have control over their caching property. For this reason, you should not bother about completely removing the “leverage browser caching” error.
Removal of unnecessary characters and redundant code can greatly speed up WordPress by reducing page size in kilobytes.
Here is the WordPress page speed results showing feedback about minimizing CSS and JS files.
Google Page Speed Insights Minification Warning
According to the result, you can further speed up WordPress by reducing the number of calls to CSS & JS and by minimizing its page size.
WP-Minify Plugin Minifies the CSS, HTML & JS
Though some caching plugins like W3 Total Cache & WP Fastest Cache offer minification as an additional feature, we used WP Minify plugin to perform the minification job.Please make sure you keep minification active from one plugin at a time. For an instance, Minify enabled on both W3 total cache and WPMinify may cause plugin conflict so keep minification active on one plugin only.
Before installing any Minification plugin
Google Page Speed Score: 83 / 100
Reason for this poor score: Minify CSS, JS and HTML
Google Page Speed Insights Feedback for JS and CSS Minify
After installing WP Minify, the page speed test was performed and results are as following.
After installing WP Minify plugin
Google Page Speed Score: 84 / 100 (improved)
Google Page Speed Insight FeedBack Fixed By WP-Minify Plugin
Occasionally, after installing your minification plugin, these warnings remain partially unresolved.
4. Optimize Images
A WordPress site with great images looks beautiful, capturing the attention of more readers compared to normal text-based WordPress. But there’s a catch – as you upload more images, the size of your WordPress will increase, which in turn will slow down your blog.
To avoid these issues you should optimize your images before publishing them.
Free Online Tools to Optimize Images
You can use online tools such as Optimizilla or Image Optimizer to optimize your images without affecting the quality. These tools are simple – you just upload your images, select a few options and download the optimized images.
We love Optimizilla, because you can optimize 20 images at a time and select your choice of compression ratio and image quality.
Top WordPress Plugins to Optimize Images
WordPress has so many plugins that can automatically optimize your images as you upload them. Here a just a few of them:
Out of this list, we chose WP Smush plugin, installed it on WordPress and conducted a performance test. The test results were obtained before and after optimizing the images.
Before installing any Image Optimization plugin
Google Page Speed Score: 84/100
Reason for this poor score: Images are not optimized.
Google Page Speed Insight Score Before Optimizing the Images
We used WP Smush Image Optimizer plugin to optimize the blog images automatically.
WP-Smush Plugin Optimizes the Images
The test results after WP Smush plugin is activated. Notice that the warnings related to optimizing images has disappeared.
After installing WP Smush plugin
Google Page Speed Score: 92/100 (improved)
Reason for this improvement: WP Smush plugin optimized all the images.
Google Page Speed Insight Score After Optimizing the Images
Note that, with the free version of WP Smush Image Optimizer, you can only smush 50 images at a time. The rest of the images can be smush from WordPress media library as shown in below screen.
Smush Images From WordPress Media Library
If you are still receiving an image optimization warning, don’t worry. The Google PageSpeed tool provides an optimized version of those images. You can download them as shown in 3rd step.You can update these images from your DashBoard Media library or can update them from your webhosting account File Manager.Also, please make sure to clear your webserver caching if you are using any third party caching tool like Xvarnish on your webserver otherwise Google may keep showing you old images even after optimization.
5. Enable Gzip Compression
When visitors browse your WordPress site, browsers download web pages and render the content. If your WordPress pages are big in size and contain rich elements, it will increase the page loading time.
By enabling Gzip compression, you can reduce the size of transferred responses from server to client browsers. This will significantly reduce the amount of time to download the resources, the data usage, and improve the time of rendering your WordPress site on your client’s browser.
With Gzip compression, page size can be reduced by 50% to 70% which speed up WordPress blog. When Gzip isn’t enabled, PageSpeed Insight gives you a warning to enable compression.
1. Enabling Gzip Compression Using W3 Total Cache Plugin
One of the most popular caching plugins, W3 Total Cache, lets you Gzip your WordPress website. To enable Gzip compression, login to the WordPress Dashboard, go to Performance → Browser Cache, and check the checkbox ‘Enable HTTP (Gzip) Compression’.
Enable HTTP GZIP Compression Using W3 Total Cache Plugin
2. Enabling Gzip Compression via .htaccess
You can also enable the Gzip compression by adding the Gzip compression code to your .htaccess file.
3. Enabling Gzip Compression via Compression Plugin
Install one of the following WordPress plugins to enable Gzip compression.
These plugins add Gzip compression rules in .htaccess file using the mod_deflate module automatically, so you don’t need to tweak them.
To determine whether Gzip compression is enabled on your website or not, you can test your website here. This tool can actually show you how our bytes were saved by enabling Gzip compression. Check the example below how many bytes we saved on our test website.
URL Compression Test Website
Enabling Gzip compression with one of the above methods should fix Google PageSpeed Insights recommendation of ‘Enable Compression’.
Before installing any Compression plugin
Google Page Speed Score: 92/100
Reason for this warning: Compression is not enabled.
For this example, we enabled Gzip Compression via W3 Total Cache plugin, and you can see that Enable Compression warning is now removed with the result below.
After installing W3 Total Cache plugin for compression
Google Page Speed Score: 92/100
Reason for this improvement: Enable Compression warning is resolved.
Google Page Speed Insight Score After Enabling GZIP Compression
Fixing Above The Fold Content Warning
If you don’t want to use a plugin for this, you can add the following code to your functions.php file.
/*Add async to all scripts*/
# Add async to all remaining scripts
return str_replace( ' src', ' async="async" src', $tag );
add_filter( 'script_loader_tag', 'js_async_attr', 10 );
To fix the same warning for CSS, we used a WordPress plugin called Autoptimize. After installing this plugin, go to Settings → Autotomize. In the Autoptimize Settings, click on the ‘show advanced settings’ button located on the top right corner.Please make sure that minify is not active with W3 Total Cache or WPminify as it may cause conflict with Autoptimzer.
Once the advanced settings are populated, scroll down to CSS Options section. Check the checkbox Inline and Defer CSS, paste the fold CSS code (URL’s suggested by the google page Insight Tool under section “Eliminate render-blocking”, Open each URL on browser and get the fold .css code), and click on the ‘Save Changes and Empty Cache’ button.
After taking these steps, you can see that warning of eliminating render blocking in above the fold is gone.
Google Page Speed Score: 100/100
All Warnings Are Fixed For Desktop
All Warnings Are Fixed For Mobile
Remember, Google PageSpeed Insights is a performance tool that helps you to identify the ways to make your website faster, but that does not mean that you should always obsess about scoring 100/100 as it’s sometimes just not possible to fix all scenarios.
6. Empty Trash and Optimize WordPress Database
After using WordPress for a while, its database will have lots of information that you probably won’t need any more. Every time you save a new post or pages, WordPress creates a revision of that post or page.
For instance, if you edit a post 10 times you might have 9 copies of that post as revisions. This quickly adds lots of rarely-used data to your database tables, making them unnecessarily bloated and slower to access.
By removing unwanted revisions, drafts, moderated comments, trash pages/posts, spam comments, trash comments, orphan post meta, and other data, you can keep our database optimized and safe. By optimizing the database, you can increase the website speed and efficiency.
Optimize WordPress Database Using WP-Optimize
Top WordPress Plugins to Optimize Database
Below are some of the popular WordPress plugins used to optimize the WordPress database.
These plugins clean all unwanted data from the WordPress database and perform general MySQL database optimization queries without having to access PHPMyAdmin.
The plugin like WP-DB Manager also allows you schedule dates for regular database optimization. Make sure you take a database backup before using any plugin to optimize the database.
7. Use Content Delivery Network
CDN also promotes faster page loads, lifting Google page rankings as poor and slow loading websites will face more challenges to rank well in search engines.
Setting up CDN with WordPress is pretty straightforward – you can set it up within 5 minutes using a caching plugin like W3 Total Cache. In case you wish to integrate CDN with your WordPress website, check out our knowledgeable Tutorial.
To demonstrate how much CDN can improve the WordPress website speed, we’ve performed a small test on our local lab and achieved the below result.
The average Response Time before enabling CDN on WordPress website was 124.721 ms.
Response Time Of A WordPress Website Before Enabling CDN
After enabling CDN on WordPress website, the response time decreased to 26.346 ms.
Response Time Of A WordPress Website After Enabling CDN
8. Reduce Post Revisions and Disable Trackbacks & Pingbacks
Reducing Post Revisions
The WordPress Revisions System is programmed to store a record of each saved draft or published updates. It enables you to browse previous versions of your articles and restore them, but it can greatly increase the size of WordPress database.
For instance, if your article has 10 revisions, then WordPress Revision System will store each of these revisions in database which will take 10 times more space on database.
By default, WordPress saves an unlimited number of revisions, but you can limit it to more practical value (say 4 to 5). This can be achieved by adding the following code to wp-config.php file.
define( 'WP_POST_REVISIONS', 5 );
List of Post Revisions
If you wish to completely disable the WordPress post revision system, then just add the following one line code in wp-config.php file.
define( 'WP_POST_REVISIONS', false );
Note that WordPress post revision is very useful for bloggers, so we don’t recommend that you disable it completely.
Disabling Trackbacks & Pingbacks
Each time another blog/website links to your website, your website gets a notification, which in turn updates the database on the post, utilizing server resources.
Trackbacks and Pingbacks can be disabled from the WordPress Discussion Settings. Once you are logged into WordPress Dashboard, Go to Settings → Discussion, and then uncheck the first two checkboxes as shown below image.
Disabling Pingback and Trackback
9. Split Comments & Long Posts Into Pages
It is indeed a great sign to have an engaged audience who post a lot of comments on your blog. But as an adverse impact, loading those comments can really slow down your website speed.
WordPress has incorporated the feature of break comments to fix this. Go to your Settings → Discussion and check the checkbox ‘break comments into pages’.
Break Comments Into Pages
If your posts are very long with lots of images, it can increase the website load time. Splitting up these long posts into pages is the applicable solution here.
Just add the following code wherever you want to split the page. Ensure that you add this code line in Text mode rather Visual mode.
Any content added below <!–nextpage–>, will appear in next page of the post, and at end of the page, you’ll see pagination links as shown below.
Next Page Option
10. Don’t Upload Videos Directly to WordPress
Direct video upload can increase your bandwidth usage and your Web Hosting provider may charge you for that usage.
Secondly, videos can enormously increase your backup size which makes a website restoration pretty much difficult from the backup.
Alternatively, you can directly upload your video to one of the following video hosting providers to get an embed link.
Embedding a YouTube video on WordPress is super easy. Find the video you wish to embed from YouTube. Click the Share link and copy the video URL.
Copy Video URL From YouTube
Finally, paste the video’s URL directly on your post and click on Update button to get it embed automatically.
Paste YouTube Video URL in WodPress Post
We’ve listed the 10 top tweaks to help you speed up your WordPress website. The tests conducted in our lab prove that an effective implementation of these tweaks can greatly improve your WordPress site load speed. If you ever face slowness to your WordPress website, you’ll have handy tips to improve the page speed scores.
The following graph represents the Google PageSpeed score after each tweak we implemented on WordPress blog.
Google Page Score Vs. WordPress Tweaks
Do you know any other ways to speed up WordPress sites and improve load times? Please share them with us in the comments section. In case you need our help to improve the pagespeed score of your WordPress website, drop your website name in the comment section and we’ll get back to you.
Latest posts by Rahul Vaghasia (see all)
(Visited 1,333 times, 1 visits today)