WordPress is used by 59.5% of all the websites whose content management system we know. This is 26.4% of all websites according to W3Techs. With these many websites running on WordPress, there is little that differentiates your WordPress site from others.

However, if there’s one factor that you should be better than other sites powered by WordPress, then it has to be speed.

Since Mobilegeddon and Hummingbird, Google has taken the necessary steps to ensure that speed is a ranking factor. Since slow sites do not provide users with the best experience, they are relegated down search results, if not removed from it entirely, to give way to faster-loading sites.

After all, 25% of visitors leave when a site that load longer than four seconds.

image00

Therefore, speeding up your WordPress site is not done to indulge search engines simply. Rather, it is to keep visitors from leaving your site. If you want to increase conversions and sales, then you want to keep your visitors from leaving your site.

To determine how fast your WordPress site load, go to Google PageSpeed Insights and enter your URL:

image01

The results will reveal to you things about your site that you can tweak or improve to hike up site speed. Some of the data provided by this tool will confuse you if you don’t have any coding or design experience. However, this handy guide of ours will give you all the information you need to edit your WordPress site and make it load faster than the rest!

 

CHOOSE THE BEST FRAMEWORK OR THEME

Selecting a WordPress theme is tricky business. Due to the availability of free and premium WordPress themes, you can easily get lost on which one to choose for your site. However, if there’s a rule of thumb when selecting a theme, you need to focus on simplicity and speed.

Some themes offer lots of built-in features, but it is likely that you won’t be using all of them. Besides, you can pick and choose from plugins that you deem necessary for your site, so you don’t need a feature-rich theme. Choosing the latter will only leave you with unnecessary features that take up space in your hosting and only bogs down site speed.

image04

Among the tried and tested WordPress themes and frameworks for your site, you can’t go wrong with the Genesis Framework and Thesis Theme. Both are minimalist frameworks that are easy to use and customize to achieve the design you want for your site. Best of all, both are known for its blazing-fast loading speed due to its clean code.

For Genesis, you can choose from a wealth of themes that you can use on top of the framework to supercharge your site. For Thesis, you can also select from different skins for the same purpose.

LIMIT USE OF WORDPRESS PLUGINS

One of the best features of WordPress is the ability to download excellent plugins to power your site. Regardless of the goals you’ve set for your site, you can be sure that there’s a plugin for that purpose.

There’s also a case of having too many plugins. Due to the ease of downloading and installing them on your site, it’s very easy to go plugin-happy and keep downloading to your heart’s content. However, by relying too much on plugins, you risk slowing down your site due to the coding and scripts of each of the plugins. As a result, the very plugins that are supposed to help your site is bringing it down.

Therefore, you should always limit the plugins you should use on your blog. If possible, research for alternative methods on how to get something done on your site instead of immediately looking for plugins. Below are some examples:

  • Related posts – Instead of downloading a related posts plugin, which is known to slow down your site’s loading speed, you can refer to this post so you can add a “related posts” section at the bottom of your content.
  • Social sharing – Make it easier for your readers to share your content by referring to this post so you can add beautiful social sharing buttons at the bottom of your post without using a plugin.
  • Add an author bio – If you are working with different authors on your blog, you can showcase their author bio at the end of each post they’ve written by entering the code featured in this post.

There are a lot of more options that you can tweak on your WordPress site without using a plugin. This way, you can make your site run faster as opposed to using multiple plugins for an operation that doesn’t necessarily require you to.

OPTIMIZE YOUR WORDPRESS DATABASE

When editing posts and pages on your site, WordPress will store the previous version so you can revert to these versions with a few clicks of a button.

However, if you keep editing your posts and pages multiple times, those revisions with accumulating on your database. Therefore, your database will contain previous versions of your content that you don’t need using your hosting resources.

To keep your WordPress database lean, you need to clean up your database by keeping the revisions to a minimum.

You can do this by editing your wp-config.php to include this line of code:

define( ‘WP_POST_REVISIONS’, 3 );

The ‘3’ is the number of revisions allowed for each post and page. You can change the number that you are most comfortable with.

image15

If you don’t have access to your wp-config.php file, you can download the plugin like Disable Post Revision so you can automatically delete revisions based on different filters you will set using the plugin.

 

OPTIMIZE IMAGES

Visual content plays a big role in the current landscape of digital marketing. Since it is much easier to process information from infographics and images as opposed to a wall of text, more publishers are relying on the power of these content types to engage with their audience.

However, the caveat of using visual content to power your marketing is their usually large file size. Some infographics can go as high as 3MB due to its length and detail. Having such a large file load on your site will bog down your site speed and will potentially cause your visitors to exit your page since it’s taking too long to load.

Therefore, before publishing your post, you need to optimize the images by minimizing their file size without compromising their quality. This way, you can display the images on your desired page and make it load faster than usual.

There are many ways that you can approach this. Manually, you can download a file editor like IrfanView and save images by lowering their resolution quality.

image02

On the IrfanView screenshot above, you will see this window appear whenever you save an image. On the top part, the default Save quality for all images is set to 80, which is a good enough figure that balances image resolution and file size. However, if you want to lower the file size, you can decrease the Save quality to a number you’re comfortable with. Keep in mind, however, that the quality decreases as the number drops.

Also, you need to be aware of your site’s content column and resize your images based on the maximum size allowed by your column. This needs to be done manually to optimize the loading speed of your pages. For example, if your content column is 600px wide, then make sure that all images on your content should have that figure as its width.

image05

If you wish to optimize bulk images before uploading them on WordPress, you can use a web-based tool like Optimizilla where you can upload and optimize a maximum of 20 images. Optimizilla will automatically compress the image file to its most optimized size yet so browsers can load it faster on your site.

image06

If you want to optimize images already in your WordPress media database, then you can just download and install the WP Smush plugin. Even if you haven’t optimized the images in your database, the plugin will automatically do the job for you. It will also do the same for all the images you will upload once the plugin is installed.

Using WP Smush takes away the manual labor of optimizing images for you so you can focus on creating better content for your site.

USE LAZY LOAD PLUGINS

If your posts and pages contain images from top to bottom, you should be aware that browsers normally load all elements in the page before it shows everything to users. Therefore, it will probably take time before your image-filled page loads on users’ browsers. This will cause visitors to get tired of waiting for the page to finish loading and exit your site.

To avoid this from happening, you should install a lazy load plugin on your site. When installed, the images and media files visible from the user’s end will load. Once the user scrolls down the page, the images will load one by one as it is shown on the screen. This plugin makes loading your site more manageable since it doesn’t load all the content at once.

You can choose from any of the lazy load plugins featured in this post. Arguably the most popular among the list is BJ Lazy Load, which uses placeholders for images and content iframes. These elements will only load when they are shown on screen once users scroll down the page. The plugin also works well with WP Rocket, a caching plugin, to further boost your site’s speed.

image17

If you are using videos instead of images to populate your pages and posts, then Lazy Load for Videos is perfect for you. It applies the concept of lazy loading to videos to help your site load faster.

image18

If you use Disqus as your commenting platform, you will notice that it loads slower compared to the native WordPress comment system. This is because the official Disqus plugin makes more than enough HTTP requests. Nonetheless, if you insist on using Disqus, you should give Disqus Conditional Load plugin a try. The plugin not only decreases the HTTP requests but is also SEO-friendly, which means that search engines can index the comments made on the platform.

STOP HOTLINKING

When somebody grabs images from your site by copying their URLs and posting them on their sites or blogs, your server works to load the image on their end. This process referred to as hotlinking means that another site is using resources from your web hosting, which leads your WordPress site to load slower.

As a site owner, you want your site to benefit from all the resources available at your disposal and no one else’s. Therefore, you need to tweak your .htacess file to include these lines of code (from this page):

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?sparringmind.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com/devilhax [NC]

RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]

If done correctly, all the sites that hotlink to your media content will show a 404 error for that image.

TURN OFF PINGBACKS AND TRACKBACKS

These antiquated WordPress features are no longer a vital part of your site since they contribute to slowing down your site performance. To disable them from your dashboard, go to Settings > Discussion, search for the Default article settings section and uncheck the box about trackbacks and pingbacks.

image03

MINIFY JAVASCRIPT AND CSS

When customizing your WordPress site, you will find yourself adding Javascript code before the </head> tag or edit its CSS file to achieve a particular design look. While these are standard procedures that most site owners need to undergo, both page elements can contribute to slowing down your site. They require an HTTP request to fetch the information from a third party and load on your site.

Therefore, if you have loaded lots of Javascript codes or applied CSS edits to your site, then you are probably looking with a slower loading site on your hands.

Assuming that you just cannot remove the Javascript and CSS, you can download a plugin that allows you to minify both page elements.

By minifying your site, you remove unnecessary characters and spaces in your Javascript and CSS such as whitespace characters, block delimiters, and comments, among other characters that are not required to load the page. By getting rid of these characters, you can make both page elements leaner, thus making your site faster to load.

For starters, you can choose between Better WordPress Minify and Autoptimize, both of which are lightweight plugins that do one thing – minify CSS and Javascript – and does it well. Comparing both plugins, Autoptimize seems to be perfect for newbies since it’s easy to use and requires little to no changes to the default settings. However, if you know your way around minifying your site, then Better WordPress Minify seems to be the better choice.

RENDER-BLOCKING RESOURCES ABOVE THE FOLD

When your resources are “render-blocking,” it means that the resources are obstacles to making your site load faster. Having these resources above the fold is crucial because this is the part of the page that loads first and is immediately seen by your visitors before scrolling down the page.

There are two resources that you need to worry about when it comes to increasing your site speed: Javascript and CSS.

Regarding javascript codes, you need to defer their loading, so browsers will only request for them once all the content on your page completely loads. To do this, you need to use an “onload” event to call an external javascript. Read this post dedicated to helping you perform this task on your site for more information.

For CSS, the problem lies with the size and volume of your CSS files. If you have a large file or have multiple CSS files that load on a single page, then your site will load slower than usual.

The solution to prevent your CSS from render-blocking your above the fold section is to optimize your CSS files by condensing them to a single file. For more information on how to execute the solution on your site, read this post.

The tasks involved in eliminating CSS render-blocking proves to be impossible for non-designers. Therefore, you will need a professional developer to help you clean up your CSS files.

However, to get rid of font styling CSS render-blocking, you can simply add this line of code before the </body> tag:

<link href=”https://opensource.keycdn.com/fontawesome/4.7.0/font-awesome.min.css” rel=”stylesheet”>

The code will speed up delivery of Font Awesome library, which contains free icons modified and customized through CSS, through the Font Awesome CDN.

MAKE YOUR WEB FONTS PERFORM BETTER

Speaking of fonts, there’s a chance that you gravitate towards unique fonts compared to traditional, web-safe fonts like Arial and Verdana for your site. Most websites run with WOFF (Web Open Font Format) and WOFF2 formats which provide a multitude of choices to help you decide on a font that fits your brand and design.

However, using any font from the WOFF catalog also reduces your site speed. Since your chosen WOFF is located on a different server, your site will have to file requests to fetch the font from the server to your site. To reduce these kinds of requests to hasten your site’s loading speed, you can opt for web safe fonts from the list found in CSS Font Stack as your site’s primary font.

Also, you need to understand that since web fonts are located on their servers, there’s also a chance that an outage may occur. It happened before when Typekit, a collection of fonts that are part of the WOFF library, was down for a period. If you prefer a web font for branding purposes, then you can use a web-based font as your fallback

This post covers how you can optimize your site’s font performance in detail. The article gets technical when discussing the ways on how you can tweak your WordPress to implement the changes, so you may need to consider getting help from a developer or designer when applying the suggestions.

LEVERAGE BROWSER CACHING

The process of browsing caching enables sites to store some files into the browser cache of the user’s local computer before an expiry date or maximum age. Whenever he decides to come back to your site, the cached files from their device will load, so it doesn’t have to request for the data from the server. This way, the site will load faster on their computers since the server requests will be lessened.

When running Google PageSpeed Insights, you will most likely come across this problem when entering your URL:

image14

For starters, you can simply edit to add “Expires” on your .htacess file. They allow you to define how long certain file types remain in the browser cache until they are set to expire.

Simply copy the code below to your .htaccess file (as seen from this page):

 

## EXPIRES CACHING ##

<IfModule mod_expires.c>

ExpiresActive On

ExpiresByType image/jpg "access 1 year"

ExpiresByType image/jpeg "access 1 year"

ExpiresByType image/gif "access 1 year"

ExpiresByType image/png "access 1 year"

ExpiresByType text/css "access 1 month"

ExpiresByType text/html "access 1 month"

ExpiresByType application/pdf "access 1 month"

ExpiresByType text/x-javascript "access 1 month"

ExpiresByType application/x-shockwave-flash "access 1 month"

ExpiresByType image/x-icon "access 1 year"

ExpiresDefault "access 1 month"

</IfModule>

## EXPIRES CACHING ##

If you want to have more control of your browser caching, then you can go with Cache-Control, which is documented in depth in this post.This option is something that more experienced webmasters would get their hands on. If you’re not confident with your abilities to tweak certain files in your WordPress site, then the “Expires” method should work for you.

Also, ironically enough, Google PageSpeed Insights considers your Google Analytics tracking code as a problem under browser caching.

image10

To resolve this issue, download the Complete Analytics Optimization Suite (CAOS) WordPress plugin. Aside from its host of features, the main thing that the plugin does is keep the Google  Analytics Javascript file (analytics.js) in your web hosting and regularly update it using wp_cron(). Also, you can reduce the external HTTP requests time from 2 hours to 1 to completely leverage on browser caching.

For other third-party scripts that are considered an issue under browser cache, unfortunately, there are no current workarounds to resolve them. The only thing you could do is remove them from your site.

If you are not confident with your ability to edit your WordPress site, there are great caching plugins tools to choose from.

image09

Among the plugins compared to the post, you can start with using WP Super Cache, which is arguably the easiest and most convenient caching plugin to use. While W3 Total Cache performs better than WP Super Cache, the multitude of pages to tweak for your caching needs will overwhelm newbies. Finally, if you have money to shell, WP Rocket is a premium caching plugin that is above the rest. Based on the studies, the site performed better and loaded faster using the latter.

ENABLE COMPRESSION

To make your site load faster, you need to compress your files to expedite server requests and transfer. A method of file compression is known as Gzip. It is standard practice to enable Gzip compression, which saves around 50-75% of the file size.

To enable this compression method, edit your .htaccess file and add the following (as seen in this post):

<ifModule mod_gzip.c>

mod_gzip_on Yes

mod_gzip_dechunk Yes

mod_gzip_item_include file .(html?|txt|css|js|php|pl)$

mod_gzip_item_include handler ^cgi-script$

mod_gzip_item_include mime ^text/.*

mod_gzip_item_include mime ^application/x-javascript.*

mod_gzip_item_exclude mime ^image/.*

mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*

</ifModule>

In the same post, you can see the lines of code you need to add for enable compression on Apache, NGINX, and Litespeed webservers.

To verify if the code works, click here and enter your URL.

image11

MINIMIZE UNNECESSARY HTTP REQUESTS

As mentioned many times in this guide, you need to lessen HTTP requests made by your site to a different server so your site will load much faster.

In WordPress, there are default settings that you must tweak to lessen the needless HTTP requests. One of them is the Gravatar or the avatar of the commenter that appears beside his or her comment on your post. If a commenter signed up for a Gravatar account, then your site will send unnecessary redirects and requests to fetch the avatar for your site. If you have hundreds of comments in your post, then it will cause your site to load slower.

To prevent this from happening, you can simply turn off your Gravatars.This may not be usual especially if you want to show the avatars of all your commenters. However, if you prioritize speed above all, then you ought to consider getting rid of Gravatars in your comment section.

To do this, log in to your WordPress dashboard and go to Setting > Discussion.

image07

Once you are on the Discussion page, scroll down to the Avatar section and simply uncheck the “Show Avatars” box.

image08

Alternatively, you can use the Disqus Conditional Load plugin mentioned above, which surprisingly loads comments faster than the native WordPress comment system that shows avatars.

If you do decide on using Disqus instead of the default comment system on WordPress, then you ought to consider disable the comment script that runs on all pages in your site. You are also advised to turn it off if you have disabled commenting on all your pages.

To do this, you need to copy the code below and paste it on your functions.php file (from this page):

function clean_header(){ wp_deregister_script( ‘comment-reply’ ); } add_action(‘init’,’clean_header’);

Unfortunately, no plugin alternative specifically disables this script. Nonetheless, you can download the Code Snippets plugin so you can post the code safely without inadvertently breaking the site.

Another HTTP request that you can turn off is the emojis. Emoji support on WordPress started with the WordPress 4.2 update, which unfortunately added a javascript to load on your site and automatically convert text-based emojis to smileys that you see on online messengers.

If you’re not big on emojis to begin with, you can easily turn them off by copying the pasting the lines of code below on your functions.php file:

/**

* Disable the emoji's

*/

function disable_emojis() {

remove_action( 'wp_head', 'print_emoji_detection_script', 7 );

remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );

remove_action( 'wp_print_styles', 'print_emoji_styles' );

remove_action( 'admin_print_styles', 'print_emoji_styles' );

remove_filter( 'the_content_feed', 'wp_staticize_emoji' );

remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );

remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );

add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );

}

add_action( 'init', 'disable_emojis' );

/**

* Filter function used to remove the tinymce emoji plugin.

*

* @param    array  $plugins

* @return   array             Difference betwen the two arrays

*/

function disable_emojis_tinymce( $plugins ) {

if ( is_array( $plugins ) ) {

return array_diff( $plugins, array( 'wpemoji' ) );

} else {

return array();

}

}

The code is the same one used on the Disable Emojis plugin. Again, if you’re not confident in editing code on your site, then you can simply download and install the plugin at your pleasure.

Another potentially unnecessary HTTP request that you should consider disabling on your site is the embed function. Since WordPress 4.4, WordPress users can easily embed Youtube videos and Twitter tweets by simply pasting the link to the text editor. WordPress, using the embed script, will load the link and automatically convert it into a video or a tweet.

While some might find this feature useful since they no longer have to copy the embed code and just simply enter the link, those who want a faster site can disable this on their site. To do this, you can paste the code below into your functions.php file (from this page):

function disable_embeds_code_init() {

// Remove the REST API endpoint.

remove_action( 'rest_api_init', 'wp_oembed_register_route' );

// Turn off oEmbed auto discovery.

add_filter( 'embed_oembed_discover', '__return_false' );

// Don't filter oEmbed results.

remove_filter( 'oembed_dataparse', 'wp_filter_oembed_result', 10 );

// Remove oEmbed discovery links.

remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );

// Remove oEmbed-specific JavaScript from the front-end and back-end.

remove_action( 'wp_head', 'wp_oembed_add_host_js' );

add_filter( 'tiny_mce_plugins', 'disable_embeds_tiny_mce_plugin' );

// Remove all embeds rewrite rules.

add_filter( 'rewrite_rules_array', 'disable_embeds_rewrites' );

// Remove filter of the oEmbed result before any HTTP requests are made.

remove_filter( 'pre_oembed_result', 'wp_filter_pre_oembed_result', 10 );

}

add_action( 'init', 'disable_embeds_code_init', 9999 );

The code is taken from the Disable Embeds plugin, which you can download and install to get rid of the embed script from loading on your site. This method also proves to be an alternative to tinkering with your functions.php.

image16

If you want to get granular on your scripts that load on specific pages in your site, then you can grab a copy of Gonzales, a premium WordPress plugin that disables needless scripts that run on some of your pages. You can select and determine the ones that you want to run on the page so you can focus on trimming down the HTTP requests and speeding up your pages.

FIND OUT WHAT’S SLOWING DOWN ADMIN-AJAX.PHP

The WordPress 3.6 update introduced the Heartbeat API, which allows better communication between the web browser and server. The API uses the admin-ajax.php file to perform AJAX requests from the web browser so it can keep track of what’s going on in the dashboard when someone is logged in. Therefore, when you’re logged into your account, the file is responsible for managing your activity in the dashboard, as well as track revisions and auto-saves the post you are writing.

However, an issue arises when someone leaves the dashboard open. What happens is your site will continuously send excessive POST requests to the file, which leads to high CPU usage. Along with the requests are their respective PHP script execution, which eats up time from your server. Simply by leaving your or someone else’s account logged into your site, you are wasting your resources to accomplish nothing.

To solve this issue, download and install the Heartbeat Control plugin and change its settings.

Overriding the heartbeat frequency and setting it to 60 seconds can solve most of the issues that take place with this API.

image12

You can also control the heartbeat locations so that the file isn’t getting worked up and sending out requests constantly.

image13

However, keep in mind that there are plugins that use admin-ajax.php and may not function properly if you disable them or make changes in this part. I suggest that you proceed with caution regarding controlling locations.

CHOOSE A RELIABLE WEB HOSTING

It is important to consider the foundations on which your WordPress site rests on. One of the many pillars where your site stands on is your web hosting. Choosing a web hosting is easy, but selecting the right one for your site requires you to look closer to the volume of visitors you are driving to it.

The issue with choosing the wrong web hosting is the reduction of server response time. This problem occurs if you have more than enough visitors browsing on your site at the same time. A particular web hosting provider and plan can only accommodate a certain number of visitors during a period. If that number of visitors exceed that amount, then the performance web hosting server will be compromised.

As a result, the server will be overworked to commit to multiple HTTP requests coming from hundreds and thousands of browsers from all over the world.

To prevent this from happen, you can simply apply the tips mentioned above to improve your site performance, which in turn unloads some of the burden from the web hosting server.

However, if you have done all of the tips above and the server still responds slower than normal, then it’s probably time to upgrade your hosting plan, if not change your provider altogether.

For example, if you are subscribed to a shared hosting, then you ought to consider upgrading your plan to a VPN or a dedicated WordPress hosting plan so you can withstand the surge of traffic without compromising on speed. To learn more about the different types of web hosting to choose from, click here.

If you want to change your hosting provider, then you need to consider brushing through reviews of the best performing hosting services in the market. For starters, you can read from over 60+ reviews of web hosting providers in this post.

USE A CONTENT DELIVERY NETWORK

While choosing the best web hosting for your site allows you to manage HTTP requests from visitors, it nonetheless puts the strain on your hosting’s servers. What you want is unburden your hosting from a load of multiple requests coming from different browsers.

A content delivery network (CDN) will do exactly that – take away the strain of your hosting servers by distributing the queries to its network of servers all over the work. The CDN will find the nearest server to the user to deliver the files (scripts, CSS, images) and send the date to the user for faster loading of the site.

There are many CDNs in the market to choose from. However, if there’s a CDN that you should use, make sure that it is compatible with the caching plugin you’re currently using. Below are guides to CDNs and caching plugins that work well together and the tweaks you need to make for both:

Simply follow the directions on each post to set up your caching plugin and CDN so your visitors can enjoy a faster loading site.