WordPress Speed Enhancements

Turbocharge your Wordpress site with these easy enhancements

2
687
Turbocharge Wordpress Speed

Turbocharge your WordPress Speed!

WordPress is an amazing platform that powers over 28% of the world’s websites and growing. It’s ease of use (relatively) and modular framework gives a voice to bloggers, start ups, and enterprise level businesses like no CMS before it. WordPress speed however, is the all too familiar curse for most businesses. It doesn’t take long for a fresh install to become a bloated mess with plug-ins, giant images, and heaps of external requests.

Before Optimization
Here is our baseline before any real optimization. – Score from GT Metrix

In putting together Pixel Leak I spent hours and hours of research time into finding the best possible solutions, at the best possible price (free!), to make it load like a rocket ship. I leaned heavily on others work and I’ll make sure to link the sources as we go along. I’m proud to report that I was able to take my site load time from closer to 3 seconds down to nearly 0.5 seconds overnight. Here’s how I did it.

Easiest First

The quickest and most free option is to simply change your PHP version. In my article here, I walk you through changing from PHP 5.6 to PHP 7.0. Doing that alone cut my load times anywhere from 900ms to 500ms depending on who I tested with. Milliseconds might not sound like much, but they add up very quickly into real, perceivable speed improvements.

Related: Enabling PHP 7.0 on GoDaddy cPanel Hosting

Still Easy

Our next step is still easy and still very free. On GoDaddy cPanel servers you have the option to compress data before it get’s sent out out to a browser. On your cPanel menu type “optimize” into the search bar. Next, click on “Optimize your website.

Optimize Website
Search for “optimize” and then select “optimize website”

In here, you can select to compress either ALL content or certain types you specify. I chose to compress all content.

Compress Content
Select what content to compress and then save your changes

So with PHP switched over to version 7.0, and Apache compressing content before it serves it to the browser, my speeds dropped down to the 900ms range. So far, not too shabby for spending zero dollars and about 5 minutes of my time.

Apache compressed content
Pingdom is now showing my site loading in less than a second.

Cache Money

Now we get to start playing with the fun stuff. WordPress generates each page dynamically every time a visitor goes to a page. This requires your server to get the request for a page, go look in the database for content, process all of this, then send it to the browser to be viewed. Wouldn’t it make more sense just to serve an HTML page for static content like blog posts and other pages? Yes it would, and that’s where caching plug-ins come into play.

I decided to start with WP Super Cache based on reviews and ease of use. W3 Total Cache is another popular option in the WordPress speed freak community. I activated the plug-in with just defaults following the installation instructions. Once I verified the cache was full, I ran another speed test.

WP Super Cache Results
Now we’re cooking! Just on the edge of being in the 600ms zone

I was Super (heh) happy with the results on this run. My goal is to get down to half a second, or 500ms, and we’re nearly there! When reviewing the suggested improvements I could make, I did notice some stubborn areas that wouldn’t go away. Namely, the Google Analytics call to Google’s servers every time a page is loaded.

Stubborn Areas
Google Analytics is phoning home for every page, let’s fix that.

Nerd Hat Required Beyond This Point

So, I wanted to know how to get rid of that external call from Google, but I wasn’t sure how to keep my tasty analytics without it. So…I Googled the problem and found the perfect solution. I won’t repost this amazing article I found that walks you through it, but I’ll try my best to sum it up.

You’ll be downloading the Google Analytics script and create a file on your server to put it into. Next, you’ll be creating another file, this time a PHP script, that when ran will automatically go out and fetch the current analytics code (apparently this changes often) and update the first file. Finally, you’ll create a cron job (automagic stuff) that runs the PHP script daily and updates your first file all on it’s own!

Internal analytics script
Changing just the analytics script from external to internal shaved off 50ms!

Now that we’re calling the script internally from our own server instead of pinging Google every time, we are ever closer to the half second load time!

Smush those .jpgs

The last step I took in optimizing (for now) was my images. I had already tried my best to save at the appropriate quality and size but I knew there had to be some more wiggle room. I decided to go with WP Smush to see if I could squeeze out a few more kb from their file size. After installing the plug-in I just went with their bulk smush option, this will take all of the existing files on the server and compress them.

WP Smush
I was able to save almost an entire megabyte over original

One megabyte might not seem like much in nowadays, but you want your site to be as lean as possible for load times, especially WordPress speed loading. The great thing about the plugin is it will automagically compress future image uploads too.

Let’s See that WordPress Speed!

So after paying zero dollars, and maybe an hour or so of my time (not counting research or rebuilding cache), I was able to shave nearly 2 entire seconds off my site loading time. That’s HUGE (err..small?)!!! I didn’t hit my goal of 0.5 seconds, but I would say I got damn near close. I’ll make sure to do an update in the future if I’m able to squeeze some more performance out of this shared hosting plan.

Wordpress Speed
Grrr, so close! I’m happy with the improvements…for now.

p.s. I did not end up using a CDN for these tests as I wanted to see how lean I could make the site first. I’ll look into a CDN solution like CloudFlare later and do more testing.

2 COMMENTS

  1. Hey Bryan I see your photo this is good stuff. I just reviewed “Turbocharge WordPress”.
    Im gonna try your suggestions. Thanks for taking your time to documented and post your findings.
    I fixed the slider on the laundry site.
    Thanks for being who you are, I appreciate you!

    -Shawn

    P.S This is a really awesome site. I see you have a sticky “More Stories” tab on the bottom right. What wp plugin is that?

    • Hey Shawn!

      I’m trying to carve out a little space for things I love doing, so I appreciate the kind words! I still have a ton of work to do visually, but my main focus is putting out quality content first. Look out for the next post soon, I’m going to tackle the really complicated WordPress fixes and break it down to bite size chunks.

      Did you fix it on the dev site and port it over? And the “More Stories” is part of the theme I’m using. Shoot me an email at info@pixelleak.com and I’ll send a link.

      -BK

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.