15 Essential and Basic ways to Optimize your WordPress site Speed

in #wordpress8 years ago (edited)

WordPress is a great platform. One weakness that it suffers from, however, is it can be quite slow.Without taking the right precautions, you could end up with a sluggish site. 


 Why WordPress Site Speed Matters

When a person lands on your site for the first time, you only have a few seconds to capture their attention to convince them to hang around.Get ready to lose sleep at night: according to a report by the Microsoft Bing search team, a 2-second longer delay in page responsiveness reduced user satisfaction by 3.8%, increased lost revenue per user by 4.3%, and a reduced clicks by 4.3%.If your site takes too long to load, most people are gone, lost before you even had a chance.

Not only that, but Google now includes site speed in it’s ranking algorithm. That means that your site’s speed effects SEO, so if your site is slow, you’re now losing visitors from impatience and reduced rankings in search engines. Yikes.

Let’s fix that. 


1. Choose a good host

 When starting out, a shared host might seem like a bargain (“Unlimited page views!”). It comes at another cost: incredibly slow site speed and frequent down time during high traffic periods.

If you plan on publishing popular stuff, you’re killing yourself by running your WordPress site on shared hosting.

The stress of your site going down after getting a big feature is enough to create a few early gray hairs: don’t be a victim, invest in proper hosting. 

Here is the Top host for a wordpress website

Digitalocean.com -   (get Flat 10% off, use that link)

  • Easiest to configure
  • Location based servers (quickest response time)
  • Cheap (Starts $10/month- decent for <500/day traffic wp sites)
  • Quick and meaningful support
  • Highly reliable and recommended
  • Adds Woocommerce support and codes for you
  • Supports Apache, Nginx, MySql 5.6 and PhP 7


2. Start with a solid framework/theme

 You might be surprised to here this, but the Twenty Fifteen “framework” (aka the default WP theme) is lightweight and quite speedy.

When you are exploring themes @ themeforest (http://bit.ly/2dzeXYN here) look for authors with High ratings, good support, documentation and milestones. Authors like Themefusion,  Kriesi & Qode  have an incredibly solid framework that won’t slow you down with excess plugins or custom edits. Make the changes right from the theme and avoid bloat, hoorah!


 3. Use an effective and compatible caching plugin

 WordPress plugins are obviously quite useful, but some of the best fall under the caching category, as they drastically improve page loads time, and best of all, all of them on WP.org are free and easy to use.

By far my favorite, bar none, is W3 Total Cache, I wouldn’t recommend or use any other caching plugin, it has all of the features you need and is extremely easy to install and use.

But many hosting providers do not recommend w3 Total Cache, instead they recommend Super Cache, and Fastest Cache.

Simply install and activate, and what your page load faster as elements are cached. 


4. Use a content delivery network (CDN)

 Essentially, a CDN, or content delivery network, takes all your static files you’ve got on your site (CSS, Javascript and images etc) and lets visitors download them as fast as possible by serving the files on servers as close to them as possible. 

Maxcdn.com is the best CDN service out there,  they have the most reasonable prices and their dashboard is very simple to use (and comes with video tutorials for setting it up, takes only a few minutes). 

There is a Plugin Jetpack, the Photon Module acts as a Free CDN service.


 5. Optimize images (automatically)

An attractive website nowadays are designed with a set of high definition large images. It is important to compress these images to compress their sizes.  Fortunately, there is an amazing, free plugin called WP-SmushIt which will do this process to all of your images automatically, as you are uploading them and manually you can bulk optimize existing images. No reason not to install this one.


 6. Optimize your WordPress database

 I’m certainly getting a lot of use out of the word “optimize” in this post!This can be done the very tedious, extremly boring manual fashion, or…

You can simply use the WP-Optimize plugin, which I run on all of my sites.This plugin lets you do just one simple task: optimize the your database (spam, post revisions, drafts, tables, etc.) to reduce their overhead.

I would also recommend the WP-DB Manager plugin, which can schedule dates for database optimization. 


 7. Disable hotlinking and leeching of your content

 Hotlinking is a form of bandwidth “theft.” It occurs when other sites direct link to the images on your site from their articles making your server load increasingly high.

This can add up as more and more people “scrape” your posts or your site (and especially images) become more popular, as must do if you create custom images for your site on a regular basis. 

 Place this code in your root .htaccess file:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L] 

9. Add an expires header to static resources

 An Expires header is a way to specify a time far enough in the future so that the clients (browsers) don’t have to re-fetch any static content (such as css file, javascript, images etc).

This way can cut your load time significantly for your regular users.You need to copy and paste the following code in your root .htaccess file: 

<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>


10.  Add Lazy Load to your images

 Lazy Load is the process of having only only the images above the fold load (i.e. only the images visible in the visitor’s browser window), then, when reader scrolls down, the other images begin to load, just before they come into view.

This will not only speed you page loads, it can also save bandwidth by loading less data for users who don’t scroll all the way down on your pages.

To do this automatically, install the jQuery Image Lazy Load plugin. 


11.  Turn off pingbacks and trackbacks

 By default, WordPress interacts with other blogs that are equipped with pingbacks and trackbacks.Every time another blog mentions you, it notifies your site, which in turn updates data on the post. 

Turning this off will not destroy the backlinks to your site, just the setting that generates a lot of work for your site.

For more detail, read this explanation of WordPress Pingbacks, Trackbacks and Linkbacks


12.  Use CloudFlare

 This is similar to the section above on using CDN’s.

Coming straight to the point, CloudFlare, along with the W3 Total Cache plugin discussed above, are a really potent combination (they integrate with each other) that will greatly improve not only the speed, but the security of your site.

Both are free! 


13.  Limit WordPress Heartbeat To Lower Execution Numbers

 WordPress 3.6 introduced the WordPress Heartbeat API - it allows your browser to communicate with the server when you're logged into the WordPress admin panel. This functionality allows WordPress to handle things like showing other authors that a post is being edited by another user, plugins can hook up to those "ticks" and show you notifications in real time, etc.

However, even though this is great functionality it may cause issues in certain cases. On different pages, Heartbeat makes checks on different period - on post edit, it makes it every 15 seconds, on your Dashboard - every minute, etc. Each "tick" generates a POST request which adds to the number of your executions and CPU time used. 

This increases pressure on the server. 

 If you don't want to stop Heartbeat completely, you can simply limit the execution frequency. You can do this by using a plugin called Heartbeat Control.

Simply install it by following the instructions in our tutorial on How to Install WordPress Plugins and activate it. 

Then go to Settings -> Heartbeat Control and from the Override Heartbeat frequencydropdown choose 60 seconds. Finally, save the settings and that's it. 


14.  Why You Should Always Use the Latest Version of WordPress core, themes and plugins

 WordPress developers are always trying to make things faster. Each new release comes with several performance improvements that makes WordPress run faster and more efficient.

For example, WordPress 4.2 improved JS performance for navigation menus, and WordPress 4.1 improved complex queries which helped with performance of sites using those queries. 


15. Most ignored way. Highly recommended.

Even many hardcodre web developers miss this step/way. Every browser has a console error tab for reporting any errors on website, these errors create major impact on the load time. These errors can crop up for any reason, be it incompatible theme, plugin, server issues or for old javascript library. It is very important to rectify these errors, since these have the highest impact on speed.

Errors can also be reported through a log file after enabling debug option in wordpress, this shows complete errors your wordpress website is having. Fixing these errors must be prioritized.


Send in your queries as comments as well. I'll try to reply to them asap. 

Please Upvote, comment & Follow if this post was meaningful to you.  

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 57951.76
ETH 2347.51
USDT 1.00
SBD 2.36