48-ways-speed-up-wordpress

48 Ways to Speed Up WordPress

You need a blazing fast website. You know all the stats about how people want sites to load in 2 seconds or less. If it takes too long, users will leave in droves, driving up your bounce rate. And high bounce rates will make your Google rank drop like a stone. Not cool.

Abandonment graph from Kissmetrics

But how do you speed up your site? And how do you speed it up if it’s a WordPress site? Isn’t WordPress synonymous with slow, bloated, and insecure as heck?

It is… but it’s not all WordPress’ fault. As a blogger or web developer, there’s actually a lot that you can do to get your site loading fast.

I scoured the web and combined my own knowledge with the research I found to bring you a mega list of almost 50 tips. You can implement many of these without needing much or any coding ability. At the end there are some more advanced ones that require dealing with coding and server settings.

Download a free mini guide with my top 5 picks for how you can speed up your WordPress site.

Your web host and server

This is probably the single most important factor– make sure you have a good web host and the right plan. Your server has a huge effect on your site speed– it’s the foundation that everything else sits on.

1. Know the limits of shared servers. They’re cheap and good to start out on, but just like sharing refrigerator space with roommates, sometimes they’ll take your stuff (or vice versa). Because all the server tenants share resources, things like uptime and site speed can suffer if there’s a resource hog or two.

2. Make sure you have enough CPUs (central processing units) and RAM (random access memory). The cheaper plans have fewer of both of these, and the more expensive ones will have more. It’s the difference between driving on the highway in a minivan full of soccer players versus zooming around in a supercharged Corvette.

Checking your site speed

3. Check your site speed using any of the following tools: Pingdom, Google PageSpeed Insights, or GTmetrix. If using Pingdom, select a server where most of your audience is to get an accurate read. One thing to keep in mind, especially with Google PageSpeed, is that it’s difficult to get a perfect 100 score. Just do what you can to reduce your load time and try to hit that 2 second mark.

4. Find slow pages by checking load times in Google Analytics, then click on Behavior > Site Speed > Speed Suggestions for what you can do about it. — tip from Online Media Masters

5. Check TTFB (time to first byte). It should be less than 500ms at most. This is one of the factors that will differentiate slower shared servers with the faster dedicted or semi-dedicated ones. — tip from Sparring Mind and WP Beginner.

WordPress Settings

6. Show excerpts instead of full posts on your homepage. In Settings > Reading, select “Summary” for what to show for each article.

7. Limit the # of posts displayed on the homepage. In Settings > Reading, set it to definitely less than 10 posts, and preferably 5 or so.

 

8. If you have a lot of comments, set WordPress Discussion settings to use the “Break comments into pages” option.

9. Turn off pingbacks and trackbacks in WordPress Settings > Discussion. They started out as a cool way to connect, but are just a method of spamming nowadays.

10. Set Gravatar to blank or Mystery Man, or even better, uncheck the Show Avatars checkbox. You don’t really need those, right?

 

Themes

11. Keep your WordPress core, theme, and plugins up to date. That will ensure that you get any new features that will increase performance of your site. This is also one of the best ways to keep your site secure.

12. Find a good theme or framework. Run the demo page through a speed test, and check reviews and responsiveness of authors. Some popular frameworks are Genesis by StudioPress, Divi, and X Theme.

Avoid too many or super complex plugins

13. Be very selective about the number of plugins that you install. In general, the more plugins you have, the bigger the load on your server.

14. However, not all plugins are alike. Plugins that involve a lot of database querying, making API calls, and loading stylesheets and scripts will slow your site down. Some of the usual suspects are related post plugins and broken link checker plugins. — tip from WP Engine

15. Deactivate and delete any plugins if you stop using them. This will ensure that your website doesn’t load code that it’s not using anymore.

16. In addition, go through each of your plugins that you are using, and disable any settings that you don’t really need.

17. Identify slow plugins using GTmetrix. In the waterfall tab, slow plugins will show up multiple times and have a long load time.

Plugins that can help

Use Optimization Plugins

18. One of the most annoying Google PageSpeed warning messages is the “render-blocking styles and scripts.” You can combat this with Autoptimize, a free plugin that will increase performance by doing a lot of things to minimize the load from your stylesheet, Javascript and HTML files. There is also a premium version with more features.

19. Cache your site content with a plugin like WP Super Cache, W3 Total Cache, or WP Rocket. Also use in conjunction with a CDN (content delivery network) for the maximum benefit. — tip from Bloggers Passion and WP Dev Shed.

20. Use WP Disable to easily turn off certain features in WordPress that can weigh down your website, like emojis, gravatars, etc.

WP Disable lets you control a lot of settings that you otherwise would need to manually edit your files to change.

21. Optimize your WordPress database with a plugin like WP-Optimize  or WP Sweep.

Choose Fast Plugins

22. Slider or slideshow plugins are very commonly used. Make sure you use a fast WordPress slider.

23. Also use a fast photo gallery plugin if you have a portfolio site. WP Beginner recommends Envira Gallery.

24. Find a social sharing plugin that isn’t too bloated, one option is Sassy Social Share which is lightweight  — tip from WP Rocket

25. Use the AMP plugin to use Google to load their version of your website for mobile users. It will prioritize readability and load time, so your design will be simplified, sometimes quite drastically. Online Media Masters has some good tips on how to test and get this working.

Audio and Video Media

Optimize and Resize Images

26. Use GTmetrix to determine the actual image size you need images to be, so your site isn’t loading and resizing an image that’s bigger than it needs to be. Then you can resize the images using one of the plugins in the next step. Just make sure to backup your images first in case something goes wrong.

27. Optimize and size images to not be too big. You can use plugins to resize and optimize. Just backup first before affecting any of your media items, and be careful to use the correct settings.

28. You can also use other tools like Imagify.io or Kraken.io to manually optimize your images before uploading them to your media library. — tip from ColorLib

I used Kraken.io to optimize all the images in this post!

29. Use JPGs for most of your images since they are compressed and will have a smaller filesize. Use PNGs if you need transparent backgrounds, and GIFs for animated images.

30. Instead of regular photos, if you use illustrations like text on designed backgrounds, you will save space because illustrations are a lot smaller files than photos. Even if you’re not a designer, you can make your own using free tools like Canva.

Reduce the Server Load of Existing Media

31. Delete any media library items that aren’t being used anymore in posts or pages. In your WordPress Media Library, filter for Unattached items, and then delete those. — tip from WP Engine

32. Use a CDN like Cloudflare or MaxCDN for serving up assets like images; this decreases load on your web server. A lot of web hosts integrate with Cloudflare, for example, and make it relatively easy to set up.

33. Use lazy loading for images and iframes (YouTube embeds, for example), either in your theme or via a plugin. This will only load those assets that you can see in the viewport, and load later ones as the user scrolls down.

34. Embed YouTube videos, don’t host upload the video files to your WordPress site. Video files are ginormous, and you definitely don’t want to be loading those from your server.

Advanced coding tips (requires editing your PHP files)

35. Minimize the number of revisions kept saved for posts. You can set the actual number of revisions to save in your wp-config file (Note: this is also handled by the WP Disable plugin).

36. Edit your PHP files instead of pinging the server for simple things, like loading Google Analytics, and loading menu and social media links. You can also replace PHP functions like bloginfo() with their actual value. Just make sure to make these changes in a child theme so they don’t get overwritten when you update.

37. Minify your stylesheet files– even if you don’t know a lot of coding, you can do this manually. First save a copy of your style.css file. Then run the file through an online CSS minifying tool, and use the output from the tool as your new style.css file. If anything breaks, you can restore it using your backup. — tip from WP Buffs

38. Use a task runner like Grunt, Gulp, or Webpack to minify and concatenate your separate stylesheet and JavaScript files into combined versions.

39. If you’re feeling extra ambitious, you can also manually disable plugin script and stylesheet files getting enqueued individually, and instead load the files manually in your combined JavaScript or stylesheet file.

40. Only load scripts on the pages that they are actually used. For example, disable the contact form plugin so that it only gets loaded on the actual contact form page, not other pages.

41. Load external scripts (script tags that use the src attribute) with the defer attribute. This seldom-used JavaScript feature allows the browser to download scripts, but not execute them until the DOM is done loading. This very simple fix will shave off load time from your scripts, especially if you have quite a lot of them.

Advanced server tips (requires editing server files and settings)

42. Make sure your server has enough resources to handle your site traffic. Generally it’s best to only run one website per server, unless you have a high powered server.

43. Make sure your server is located in the part of the world or country where most of your visitors live. The closer to the server your users are located geographically, the faster they will be able to load the site.

44. Use PHP 7, as it is super fast compared to older versions of PHP. However, PLEASE first check that your site will be compatible! You can run a PHP Compatibility Checker, but this isn’t 100% accurate. Ultimately, you will likely have to work with your host to test out PHP 7 first.

45. Disable other sites from directly loading your images, also known as hotlinking, by editing your htaccess file.

46. Set an expires header in your server config file for static assets (images, scripts, stylesheets). This tells the browser to cache these files and not fetch them from the server for the time period that you specify.

47. Enable Gzip or http compression on your server’s htaccess file. Sidenote: the caching plugins W3 Total Cache, WP Rocket, and WP Super Cache have similar functionality, so you can achieve this via one of those plugins.

48. Try to avoid using a lot of redirects, unless absolutely necessary. Some of them you should keep, like the ones that redirect from a non-www to a www domain, or vice versa (This helps your SEO). But let’s say you changed your domain name, and have a lot of 301 redirects from your old to your new site. Anytime a user loads one of the old links and gets redirected to the new link, the act of redirection will cause an additional load on the server. You can try avoiding this by linking only to the new URL, not the old one. — tip from Varvy

Strategies you can use now

There are a lot of tips to go through here– while they’re all good, there are a few that I would say are must haves.

To help you, I made a little cheat sheet of the top five picks, with steps that you can use to get your site loading faster.

 

Click here to download the free guide!

Download 5 Ways to Speed Up WordPress

Comments

W
WordPress development
Nov 25, 2017 at 6:06 pm

Heya! I'm at work browsing your blog from my new apple iphone!
Just wanted to say I love reading your blog and look
forward to all your posts! Carry on the superb work!

Reply
J
Jessica Oei
Dec 4, 2017 at 3:56 pm

Thanks! Glad you're enjoying the blog so far. We'll continue adding more content :)

Reply

Write a Comment

at
Reply