Looking for WordPress speed optimization tips to speed up a slow website?
In this article, I will take into consideration GTmetrix, Pingdom, and PageSpeed Insights reports and show you how to make optimizations that will improve site load times. I will go over every action I’ve done to get “A” grades and speeds of under 1 second on my posts.
How to Optimize Slow WordPress Site
- GTmetrix vs. Pingdom vs. Google PageSpeed Insights
- Avoid EIG Hosting
- SiteGround (#1 WordPress Hosting)
- Upgrade to PHP 7+
- Cache Plugin Settings
- Serve Scaled Images
- Specify Image Dimensions
- Defer Parsing of JavaScript
- Add Expires Headers
- Minimize Redirects
- Keep WordPress Updated
- Find Slow Loading Pages in GA
1. GTmetrix vs. Pingdom vs. Google PageSpeed Insights
GTMetrix provides a great amount of recommendations, such as which images need to be optimized, PageSpeed and using a CDN to optimize the YSlow. In addition, the Waterfall tab shows things such as slow loading plugins, that you can then optimize or remove if that plugin may not be in much use.
My GTmetrix report below:
Pingdom is your best bet for website speed testing and it’s more accurate than GTmetrix regarding load times, and load times are really what matter much more than the grades that GTmetrix shows. Above all, the grades are there to help you know what you need to improve, in return also helping to reduce page load time.
My Pingdom report below:
Google PageSpeed Insights is great for 1 primary thing, and that is checking the server response times, which Google recommends to be <200ms. However, besides this handy feature, it is pretty useless. Server response times can be improved by upgrading plans with your hosting provider to include more server resources or by choosing a hosting provider such as SiteGround that has fast and secure servers in 5 geographical regions. This will help in loading content faster based on server location. Use of CDN can also help to mirror static files (such as images) to allow your website visitors to have the best performance. Switch to faster WordPress hosting like SiteGround, Kinsta, and DigitalOcean on Cloudways, who are currently the top 3 hosting providers.
2. Avoid EIG Hosting
EIG is a company which owns popular hosting providers such as Bluehost, HostGator, HostMonster, iPage, and over 60 other hosting companies. Yes, they are much cheaper, but they also pack way too many consumers on the same server and as you can imagine have bad reviews because of it. A lot of websites hosted by an EIG company have much higher server response times (we want the lowest server response time possible), because of this, I suggest to avoid using any of the following companies.
3. SiteGround (#1 WordPress Hosting)
SiteGround is used by popular SEO plugin creator, Yoast, and it’s also recommended by WordPress. You will see BlueHost is on the list (which is part of the EIG company), although it is also a great server provider, remember when comparing server load times, SiteGround is much faster. I’ve provided a summarized table to quickly show the difference between the 2 companies. Read my in detail post on SiteGround vs Bluehost. SiteGround is #1 in almost all Facebook polls and it gives users great load time improvements compared to major hosting companies such as: BlueHost, GoDaddy, HostGator, InMotion, and Dreamhost.
SiteGround | Bluehost | |
---|---|---|
Popularity | Medium | High |
Ease of use | Great | Good |
Hosting features | A lot | Some |
Speed | Great | Disappointing |
Uptime | Great | OK |
Server locations | 5 | 1 |
Site migration | First included | Paid extra |
Scalability | Good | Good |
Security | Secure | Secure |
Support | Great | OK |
Prices | Medium-high | Medium-low |
Conclusion | SiteGround provides great speed performance, 5 different server locations, and comes with a lot of hosting features. But, they are more expensive than BlueHost. | Bluehost offers more storage on a single server location and lower prices. Their speed performance is weaker and their support not as great as SiteGround. |
I have dedicated this post to primarily help people load their website faster. I cannot recommend you super cheap hosting because it’s most people’s largest regret when taking the time to build a website just to know it takes forever to load.
SiteGround has 3 plans to choose from:
If you carefully review the features page, you will see that higher plans include more server resources. The full comparison tabled structure shows that GrowBig gives you about 2x more server power than StartUp, and GoGeek. GoGeek is semi-dedicated hosting which gives you the best server resources for a startup. Purchasing GrowBig or GoGeek, you get free staging which is a great benefit when wanting to make website changes and quickly push those changes live.
Affiliate Disclaimer: If you choose to support my blog posts by signing up using my affiliate link, I greatly appreciate your support! My hosting reviews are based on at least 3-4 quality resources, in the form of real people using the service, tweets, and online research. If you don’t want to use my affiliate link, but want to sign up for SiteGround, you can use this non-affiliate link.
Consumers are known to switch to SiteGround because of their advanced speed technologies, and included cache setup for WordPress speed performance.
Get WordPress Hosting from SiteGround
4. Upgrade to PHP 7+
WordPress version 5+ has started to show warning messages to those websites running PHP versions below 7.0. Upgrading PHP versions is a must and it can actually make your website 2-3x faster!
Below is a chart showing what percentage of users are using PHP versions 5.2 – 7.4 to run their WordPress websites. We can see that nearly 45% of users are still using an outdated version. (PHP <7.0).
Your hosting company will not do an automatic upgrade for you to the latest version as this can run the risk of breaking your website because not all themes and plugins are compatible of the latest version of PHP. Although this can be a quick upgrade you can usually do yourself in cPanel.
Before upgrading the PHP version, I suggest you follow these 3 steps:
First: Install the Display PHP Version plugin to show your current PHP version. If you’re currently running the latest PHP version, no need to proceed with steps 2 and 3.
Step 2: Install PHP Compatibility Checker by WP Engine, and run a scan of the theme and plugins you’re using to make sure your website won’t break after the upgrade.
Step 3: Upgrade to PHP version 7+ that you tested and did not show any errors via the “Select PHP Version” within your hosting cPanel.
Subsequently, it is suggested to review your website after updating for any errors and to keep checking back on your website for the next 24 hours to make sure everything is working properly.
5. Cache Plugin Settings
When considering a free cache plugin, you cannot go wrong with the combination of W3 Total Cache and Autoptimize. They are both very easy to setup and provide great WordPress speed improvements. I will be providing my setup of W3 Total Cache and Autoptimize in the near future and will update this post with the links to the setup.
6. Serve Scaled Images
Images can be optimized in a number of ways. I personally prefer optimizing my images and saving them for the web in Photoshop. This usually does a great job, just be sure to size the images close to the actual size you need them for the web and not larger. If images are much larger than needed, when you run a website test on GTmetrix, you will see issues for “Serve scaled images”. It is very straight forward, and all you need to do to fix this issue is just find the image that is large and resize it to the size the GTmetrix report recommends and re-upload it.
7. Specify Image Dimensions
Manually specify the width and height of the image in HTML code. GTmetrix will provide you with the correct dimensions, find the image in the widget or HTML code and type in the width and height.
8. Defer Parsing of JavaScript
As always, first make sure to backup any file before modifying it. Open the functions.php file then add the following code, save it and you’re done. Double check your website and make sure everything continues to function properly and looks fine. If this code for any reason does not seem to fix the problem of parsing JavaScript, you can try the Scripts to Footer Plugin. If you need a more in-depth clarification, please contact me or leave a comment below.
if (!(is_admin() )) { function defer_parsing_of_js ( $url ) { if ( FALSE === strpos( $url, '.js' ) ) return $url; if ( strpos( $url, 'jquery.js' ) ) return $url; // return "$url' defer "; return "$url' defer onload='"; } add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 ); }
9. Add Expires Headers
Cache plugins such as WP Rocket and W3 Total Cache take care of this issue that shows the YSlow Score. However, if it “Add Expires Headers” still appears, then you can add the following code to the top of your .htacess file. (This is a hidden file, so you will likely need to update it within cPanel or with your preferred FTP client).
## EXPIRES HEADER CACHING ## <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access 1 year" ExpiresByType image/jpeg "access 1 year" ExpiresByType image/gif "access 1 year" ExpiresByType image/png "access 1 year" ExpiresByType image/svg "access 1 year" ExpiresByType text/css "access 1 month" ExpiresByType application/pdf "access 1 month" ExpiresByType application/javascript "access 1 month" ExpiresByType application/x-javascript "access 1 month" ExpiresByType image/x-icon "access 1 year" ExpiresDefault "access 2 days" </IfModule>
10. Minimize Redirects
In other words, you changed the www or http of your website, but did not change all links or images to reflect the same. However, if you happen to have a lot of links that show in the “Minimize redirects” section in the GTmetrix report, you may want to use the Better Search & Replace plugin to fix the issues in bulk.
11. Keep WordPress Updated
Whenever there is a stable update of WordPress, Theme, or Plugin, you should always updated them. This may or may not have an issue on speed, but it will likely patch any security issue if there happened to be one.
12. Find Slow Loading Pages in GA
Above all, using Google Analytics is not only great for tracking where your traffic is coming from and what pages are being viewed most. It also shows page load times (with recommendations). Find which posts are loading slow and review the pagespeed suggestions on how you can make that particular page/post faster. To view the page speed, login to your Google Analytics account that your website is on, from the left navigation bar, go to Behavior —> Site Speed —> Speed Suggestions. This will provide some suggestions, however, GTmetrix will likely do a better job at recommending what to solve for.