• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Antony Agnel

WordPress Enthusiast, Blogger and Software Engineer

  • Home
  • Category
    • General
    • Blogging
    • Marketing
      • Email
      • Social Media
      • SEO
    • WordPress
      • Hosting
      • Plugins
      • Themes
  • Deals
  • Blogging Resources
    • Start Blogging
  • Services
    • Projects
Home » WordPress » How to optimize WordPress for better performance
How to optimize WordPress for better performance

How to optimize WordPress for better performance

Updated: December 21, 2019 By Antony Agnel 9 Comments

Recently I came across a question on WordPress Development StackExchange asking for steps to optimize WordPress with regard to server load. Here’s a link to the question. Most of the answers were technical and couldn’t be understood by anyone new to WordPress. So I created this answer-like post to fix that shortcoming.

Table of Contents

  • Enable caching in WordPress
  • Use a Content Delivery Network
  • Use Genesis Framework for WordPress
  • Compress images
  • Remove query strings
  • Use Google’s AJAX Library API CDN
  • Optimize WordPress Database

Enable caching in WordPress

Install & activate the W3 Total Cache plugin for enabling caching functionality in your WordPress site. Activate page caching, database caching, object caching & browser caching feature from the plugin’s Settings page. Make sure you choose Alternative PHP Cache (APC / APCu) as the caching mechanism ‘if available’. Do NOT enable any minification in W3 Total Cache as there are many chances for you to break your site’s appearance and/or functionality. We’ll leave it to Cloudflare.

Use a Content Delivery Network

Once you’re done with configuring the rest of the plugin functionalities, set up Cloudflare for your website. Make sure you enable Cloudflare in W3 Total Cache settings too, under the Extensions menu.

Cloudflare is a Content Delivery Network which caches all the static contents (image files, CSS, JS, documents, etc.,) from your site and serves it to your visitors from their global servers. This can help speed up page load times and reduce the load on your server. For a list of file types that are cached by Cloudflare, check out this list. Moreover, Cloudflare has a free plan too.

In Cloudflare, set the caching level to standard and set browser cache expiration to something at least greater than 20 hours. Enable Always Online™ so that even if your server goes down, Cloudflare will serve your website’s static pages from their cache. Also, enable their auto minify feature (remember why I asked you to not enable minification is W3 Total Cache? Because Cloudflare does it better!) Then set Rocket Loader™ to automatic.

Here’s an excerpt of what Rocket Loader does :

  • Decreases the number of network requests by bundling JavaScript files, even third-party resources, to avoid slowing down page rendering.
  • Asynchronously loads scripts (including third-party scripts) so
    that they do not block the content of your page from loading
    immediately.
  • Caches scripts locally (using LocalStorage, available on most
    browsers and smartphones) so they aren’t re-fetched unless
    necessary.

More information can be found here.

Also Read: Redirect non-www URLs to www using Cloudflare

Use Genesis Framework for WordPress

If possible switch to the Genesis Framework by StudioPress for WordPress because their themes are clean, without any bloat. Genesis framework and their child themes are built with speed, security, and SEO in mind. I myself have tested it out around a few times and my Google PageSpeed scores were pretty damn good. Also if you’re using Genesis, then don’t forget to enable the ‘fragment cache’ extension in W3 Total Cache settings.

Since the Genesis Framework and all its child themes fall under the premium WordPress themes category (paid themes), not everyone can afford to buy them. So, I’ve got an excellent free Genesis theme alternative for you – GeneratePress, the new kid on the block whose performance can easily be compared to that of Genesis. Moreover, it is clean, simple and weighs less than 1 MB. GeneratePress is just a single theme but it offers all the best features of the Genesis framework – it is lightweight and fast, fully mobile responsive, secure and stable yet developer-friendly with full microdata integration.

Download GeneratePress

Bonus Reading –

  • Genesis Framework review
  • GeneratePress review

Compress images

Since now you’re using Cloudflare as a CDN, you can make use of a plugin like ‘Imagify‘ or ‘Compress JPEG & PNG images‘ by TingPNG to compress your images. Both are free plugins available in the WordPress.org plugin repository. Also, Imagify supports the powerful lossy compression algorithm.

Remove query strings

You should remove the query strings from static resources like CSS & JavaScript files using a plugin like Autoptimize, Swift Performance Lite, SG Optimizer, or W3 Total Cache. This is because resources with queries in the URL (“?” or “&”) are not cached by some proxy caching servers (remember, Cloudflare is also a proxy caching server) and makes it redundant.

Use Google’s AJAX Library API CDN

Then install the ‘Use Google Libraries‘ plugin by Jason Penney. This plugin allows your WordPress site to use Google’s AJAX Library API CDN rather than serving these files from your WordPress install directly.

Some of the key benefits are:

  • Increases the chance that a user already has these files cached.
  • Takes the extra load off your server.
  • Uses compressed versions of the libraries (when available).
  • Google’s servers are set up to negotiate HTTP compression with the requesting browser.

Optimize WordPress Database

Last but not least, use the ‘WP-Optimize‘ plugin by Team Updraft and Ruhani Rabin to clean and optimize your database so that it runs more efficiently. You can also consider limiting and disabling post revisions in WordPress. If you don’t know how to do that, I’ve got you covered. Click here to read how to limit or disable WordPress post revisions.

Hope this helps you with regard to optimizing WordPress to reduce server load.

Also Read: How to make WordPress site HackProof

Liked this post? Share it with your friends!

  • Share
  • Tweet
  • Publish

Related posts you might like

Filed Under: WordPress

About Antony Agnel

I love helping people use WordPress and get better at blogging. Been doing that for 5 years now. Read more →

Looking for the best managed WordPress hosting provider?

Migrate your website to SiteGround now and experience lightning-fast WordPress performance with the best-in-class security and 24/7 support.

Learn More

Reader Interactions

Comments

  1. Andy S says

    November 17, 2016 at 4:31 pm

    Hey. Nice guide you wrote here. I would add two other recommendations for image optimization. I used with good results ShortPixel, and Kraken.

    Reply
    • Antony Agnel says

      November 17, 2016 at 8:43 pm

      Howdy,

      Thanks for the recommendations Andy. I’ve tried ShortPixel earlier and found Imagify to offer better compression rates than ShortPixel. Haven’t tried Kraken Image Optimizer yet. Will give it a try and maybe I’ll post the results in a separate blog post.

      Reply
  2. Jordan says

    August 28, 2017 at 12:53 am

    Hey, love your posts man! Good content. But I was wondering if you, or anyone reading this, could expand on Cloudflare’s HSTS function and expand a little on it’s “Preload” & “Include Subdomains” Rules.

    I had a 7-Day long ticket support ticket with SiteGround over this because apparently the the “www” that you’re required to have with Cloudflare through SiteGround screws up the redirect that’s required for this function. So I was just wondering if anyone knew more about it.

    THANKS
    Jordan

    Reply
  3. Roseann Hampton says

    February 3, 2018 at 6:46 am

    Good to know your recommendation that Imagify works better than ShortPixel which is what I’ve been using. Thanks for sharing at The Blogger’s Pit Stop! Roseann from thisautoimmunelife.com

    Reply
    • Antony Agnel says

      February 7, 2018 at 6:38 pm

      Hey Roseann, it’s not that Imagify is better than ShortPixel or something. Both are good and nearly offer the same levels of compression. You can also checkout WP Smush image compression and optimization plugin by WPMU Dev.

      Reply
  4. Linda Barnby says

    February 3, 2018 at 9:47 am

    Thanks for making tech speak much easier to understand. Is this advice still current for 2018?

    Reply
    • Antony Agnel says

      February 7, 2018 at 6:44 pm

      You’re welcome Linda. Oh yes, this post is still relevant in 2018 and the advice is still as good as it was in 2017. Should I rename this post to ‘How To Optimize WordPress Site Performance In 2018’ to gain your trust? Just kidding. This post falls under the evergreen content category. That is, it will always remain relevant to the audience no matter what time it is.

      Reply
  5. James says

    February 8, 2018 at 10:38 am

    Hey, this information is very useful to us especially.
    But I recommend a new and very powerful addition to reducing the image size, which is very promising,
    Here it is : Way2enjoy Image Optimizer

    Reply
    • Antony Agnel says

      February 10, 2018 at 7:11 pm

      Hey James, thank you for adding more value to this post with your WordPress image compression plugin recommendation.

      UPDATE: This plugin was closed on November 22, 2018 and is no longer available for download.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

What are you looking for?

Launch your dream website

bluehost web hosting

Create an online store

create an online store on shopify

FREE EMAIL NEWSLETTERS

Get my latest posts delivered straight to your inbox and become a better blogger, one post at a time.

Join 2,015 other subscribers

READ MY RECENT POSTS

  • How to create a coupon popup in WordPress (Step by Step)
  • How to track WordPress form conversion source in Google Analytics
  • 3 Signs Your Website Is Being Targeted by PPC Fraud
  • 5 Reasons why WPForms is the Best WordPress Form Builder Plugin
  • Imagely NextGEN Gallery Pro Black Friday 2020 Sale – Get 40% Off

Disclosure

Please note that some links on this site may be affiliate links. By clicking on them you don't pay anything extra and I make a few bucks which help cover the cost of running this website.

Copyright © 2015 - 2021

Follow Me Online

  • Twitter
  • LinkedIn
  • YouTube

Antony Agnel

Proudly powered by WordPress and the Genesis Framework.

  • About
  • Contact
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions