Do you need to speed up your WordPress site speed

So how can you speed up your WordPress site speed, if you install WordPress without an speed improvements your site can become very sluggish, each page load take long to complete. You more traffic you get the slower your site can be. In this article I’m going to explain what i did to my site to speed it up.

My article here is more focus for you do it yourself that maintain your own server, there is valuable information for all as I touch on some areas e.g. hosting that provide all the functionality that I will touch on, so lets get started. The next section I give you some tips that is universal in speeding up your WordPress site.

Choose a good host

In my case I went with Digital Ocean,as I will do it all myself – with Digital Ocean you can fire up a site very quickly and you have full control of the server so you can add tools to the server to speed up site loads. Another good option is Cloudways WordPress hosting , that offer Digital Ocean as one of the server options.

WordPress plugins to speed up your site

In this section I’m looking at different plugins that can help you speed up your site.

1. Start with a solid theme

The default WP themes are quite speedy frameworks to use. When you choose a framework or if you hire a web agency to build one, you can benchmark your new theme against the default WP themes. The principal is you lighter a theme is the faster it loads.

2. Optimize images (automatically)

Loading images can slow down your website, so you need to think about optimizing your pictures to reduce the file size of an image, while not reducing quality. There is a free plugin called WP-SmushIt which will do this process to all of your images automatically, get WP-SmushIt installed today.

3. Optimize your landing page to load quickly

You need to optimize your landing page, depending on type of website, this is the page people will be landing there most often.

Things that you can do include:

  • Show excerpts instead of full posts
  • Reduce the number of posts on the page
  • Remove unnecessary sharing widgets from the home page
  • Keep in minimal!

4. Optimize your WordPress database

Over time your database fill up with spams, un-approved comments, trash post etc. Part of running a WordPress site you need to clean up your WordPress database and optimize it without doing manual queries,  this can simply be done with WP-Optimize plugin.

5. 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.

 6. Add LazyLoad to your images

The jQuery Image Lazy Load plugin, ill not only speed your page loads, it can also save bandwidth by loading less data for users who don’t scroll all the way down on your pages.

7. Control the amount of post revisions stored

This is my favorite tip, I have a tendency to click on the Save Drafts button, each time I do a revision is created, these drafts are stored indefinitely. If you not doing anything about it. Install the plugin, Revision Control to keep post revisions to a minimum, set it to 2 or 3 so you have something to fall back on in case you make a mistake.

8. Use an effective caching plugin

W3 Total Cache, is a great caching plugin, it has all of the features you need and is extremely easy to install and use. Simply install and activate, and what your page load faster as elements are cached.

.htaccess file speed up

By editing your .htaccess file you can gain some page load speed. You can try out the following:

1. Disable hotlinking

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 your site become more popular.

Place this code in your root .htaccess file:

#disable hotlinking of images with forbidden or custom image option
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]

2. 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:

ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000

The above numbers are set for a month (in seconds), you can change them as you wish.

Leveraging content delivery network (CDN)

A content delivery network (CDN), 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.

I use CloudFlare to improve not only the speed, but the security of my site. You should try it, they have a free option that you can start with. I opted for a business plan as it gives me additional security.

CloudFlare, along with the W3 Total Cache plugin, gives you the combination that will greatly improve not only the speed, but the security of your site.

Speeding up your server with Varnish + Memcache

If you still find your WordPress site slow after all the suggestions above, you need to try out the Varnish + Memcache combination. This requires you to have a dedicated server to install these two software packages and configure it. You can read the article How to install Varnish + Memcache.

Memcache cache things internally in your application to the server memory. Varnish on the other hand stores rendered pages. It talks HTTP so it will typically talk directly to a HTTP client and deliver pages from it’s cache whenever there is a cache hit. When there is a cache miss it will go and fetch the content from the web server, store it and deliver a copy to the user.

You need Varnish +Memcache as they speed up delivery of web pages. Varnish speeds up delivery of it’s cache hits, and when you have a cache miss the application server might have access to some data in Memcache that will be available to the application faster than what the database is capable of.

If you found this useful please comment below.