Dude, Your WordPress is Slow.

I've been building WordPress sites for 12 years. I've built or helped to build WP sites for some of the worlds largest companies. One thing I've learned over the years is if you opt for the free, for the ease-of-use, for the 'learnability' of WordPress - then you're going to lose some speed in the trade off.

But how much speed do we really need to lose? Here's my initial GTMetrix Score:

Now... Let's Talk About Hosts...

To me, there are 3 types of hosts:

  1. Cheap/Managed: 1+1, BlueHost, HostGator, GoDaddy, blah, blah, blah...
  2. Premium/Managed: Kinsta, WPEngine, Pagely
  3. Custom (Advanced) Solutions: Basically, this is a combination of a custom hosting solution and a Content Delivery Network, plus 3rd Party Services for image serving, database optimization, etc.

I currently have sites on GoDaddy (Premium Managed WordPress Hosting), WPEngine (Professional and Enterprise accounts), and a custom solution. I recently read an article, Case Study: WP Engine Managed Hosting vs Linode $5 VPS + Cloudflare.

I decided, since I was redesigning I client's site, I'd move their staging area from WPEngine to Linode + Cloudflare.

The results:

Bottom line: Hosting and Content Delivery matters.

CDNs:

  • Max CDN (Stackpath) // $20
  • Cloudflare // Free $20
  • Free-CDN // Duh
  • Jetpack // Free
  • Press CDN // Pagely
  • Rackspace // Pay as you go

 

 

Let's Talk About JS...

Chances are, your $49 theme from your favorite theme store is loaded with tons of unnecessary JS. I recently reviewed a potential client's theme. It was loading 19 Google fonts and 16 (non-minified) JS files. The theme had 11 different types of home pages and was loading the necessary JS for all of them, instead of what was needed for the specific font and template choices made. The results? About 4MB of unnecessary load.

Theme Platforms and Custom Themes

Then there are theme platforms, like Genesis or Thesis. Thesis is pretty fast; but I prefer to build a custom theme. Lately, I've been building my custom themes from a theme starter called BlankSlate.

Let's Talk About Hotlinks...

Don't let people use your bandwidth to serve their site. Place this code in your root .htaccess file:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?uxisthenewblack.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com/uxisthenewblack [NC]
RewriteRule \.(pdf|jpg|jpeg|png|gif)$ – [NC,F,L]

Let's Talk About Minification...

I'm going to let you do your own research here; but I will say that there are plenty of ways to shrink the load:

  • CSS/JS Minification
  • DataBase Optimization (WP-Optimize)
  • Limiting Post Revisions (WP-Optimize)
  • Adding 'Expires' Headers

Let's Talk About Images...

Image load times and non-specified image sizes are the two biggest reasons for slow load times in WordPress sites. I like to use a plugin called Imsanity. It manages the size of all your images and "pre-resizes" images as they upload. Other plugins like WP-SmushIt do the same type of thing.

Image Serving

CDNs (like Cloudflare) will handle your image serving.

Lazy Loading

Lazy loading is the act of not serving content until your within a certain amount of pixels away from the content. I like to use a plugin called Rocket Lazy Load.

The results:

I've built over 300 WP sites. Hardly ever have I received an A, and rarely a B. C's and D's are normal because of WordPress's inherent flaws; but you can certainly load a C/D rated site pretty fast using some of these techniques.

BEFORE:

AFTER:

Good luck. Let me know if I missed anything.

2 thoughts on “Dude, Your WordPress is Slow.”


    Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 2109963 bytes) in /home/bureaudefeix/public_html/wp-includes/class-walker-comment.php on line 192