WordPress Speed Optimization : 50+ Clever Tips & Tweaks

improve wordpress blog speed

WordPress Speed Optimization is essential for SEO and great user experience. You will learn here about optimizing WordPress Theme (Agent Side), Web Hosting Server (Server Side Optimization) and Plugins installation respectively.

Okay! So let’s start learning on optimizing these three main components of WordPress. Here all tips are related to each other, for better understanding you are requested to read and implement very carefully. Please take backup before continue.
wordpress speed optimization

Please check your website at GTmetrix to find out the root cause of slowness. Look carefully at their recommendation and start applying step by step as I have mentioned below.

How to get started?

1. Take Full Backups (including .htaccess& wp-config.php)
2. Sign up at GTmetrix.com to check website speed from your desire location.
3. Keep Installed and Activate ‘Code Snippet‘ Plugin (For adding PHP code)
4. You must have FTP Details (For adding some .htaccess code)
5. Notepad++ (Application)
6. Google Chrome / Mozilla Firefox. (For real testing of network timeline)
7. ShortPixel Plugin (For bulk images optimization)

Important Points

Optimize WordPress Theme

I have worked on many themes of WordPress and I finally realised that all theme require speed optimisation. No any WordPress themes come with already-optimized. You can optimize WordPress theme by applying these all important tips.

Analyze and Remove Unused CSS

CSS should be small in size as possible as. I guess, you are not using 100% CSS. Therefore, you can analyze some unusual CSS using Google Chrome browser. Open your website in Google Chrome, Then Press F12, and Click on Audits, Click Web Page Performance check-box and Audit Present State radio button and Click Run. You will see all unused CSS rules.Later you can remove all unwanted CSS manually.

Please note: Remove only if you know what you are going to remove for another web page also.

Unused CSS
This is how using Google Chrome, you can check unused CSS by page by page.

Want quick? why not use this online tool. Recently, I found it, and I tested for this blog. It worked great for me. I’m very impressed with this tool. Unexpectedly, first time using this tool I optimised Font Awesome CSS in very less time.
Alternative Manual way:
In WordPress Dashboard, go to Appearance > Editor, now looks at Table of Contents in CSS file. Note down what you are not using, and simply remove it. In my case, I removed Calender’s Widget CSS which I was not using, nor I had planned to use in far future.

Remove WordPress Query String

Check your WordPress website source code, you will see many unnecessary query string like this….


added in CSS and JS files URL. It is the main cause of delay in rendering static resources due to unusual redirects from query string version to non-query string version. Also, with query string browser become unable to store in cache memory.

Query String

You can remove all unwanted query string of your WordPress blog by adding this code in your Functions.php file of your current theme.

// Remove Query String
function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );

Sometime these query string are also being attached with external web fonts. Chances are that’s you have to remove manually by editing functions.php of current theme or editing those plugins files which are using those web-fonts.

Minify CSS, JavaScript and HTML

It is tough to minify all CSS and JavaScript manually. So, you should take advantage of a useful plugin called Autoptimize to do this job more efficiently. I like this plugin so much because it does many works for me. First, it minifies CSS, JS, HTML elements and turning small background images into base64URI. Hence, it dramatically reduces many DNS lookup by combining all CSS and JS file into a single separate URL. Minifying website resources is crucial to render web pages quickly. You should never ignore this because CSS and JS are primary blocking resources by default.

Caution: After minifying HTML, make sure to check your site design properly. In my case, my list items at post meta went too close. I fixed it by adding padding of 2px.

Prefer loading JavaScript with async and defer tag

You should load all external and less priority JavaScript with async and defer tag. It will eliminate the render blocking issue.

function add_async_defer_attribute($tag, $handle) {
    if ( 'my-js-handle' !== $handle )
        return $tag;
    return str_replace( ' src', ' async defer src', $tag );
add_filter('script_loader_tag', 'add_async_defer_attribute', 10, 2);

Caution: Don’t implement this technique for jQuery.

Remove Unusual PHP Execution in WordPress

Many folks suggest that to reduce PHP execution, you should replace some PHP code of header and footer with simple HTML code. You can find such code above <?php wp_head(); ?> hook in your theme header.

<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" media="screen" />

Tips: You can easily get already html formatted code through your website source code. To open website Source code, Please go to this address

view-source:yourdomain.com or Press CTRL+U buttons in Windows.

Keep in mind that you should replace only that PHP code which is not going to be changed forever in your WordPress theme. On same principle you can remove some unnecessary PHP code through your footer of your WordPress theme. You can find such code above <?php wp_footer(); ?> hook.To have little PHP execution, delete all inactive Themes & Plugin. Whenever your site is being in development mode; I recommend only that time keep one latest version of a WordPress default theme. Suppose, In case if your choice theme gets broken, then it will be able to revert automatically to the Default theme.

Choose Great Theme framework

A perfect theme framework can help to render pages quickly. I like that theme which use Latest version of technology such as HTML5, CSS3. Take advantage of Include tag in HTML 5, Hence in this way you can reduce the amount of HTML output.You may like to Read: How to choose Perfect WordPress Theme

Avoid CSS import

If your WordPress theme using imports method to load CSS, then it obvious your style sheet will not load quickly in the old browser such as Internet Explorer (Previous to IE9).

Don’t use default WordPress Emojis

First they load this inline JavaScript, which cause delay in rendering.

<script type="text/javascript">
			window._wpemojiSettings = {"baseUrl":"https://s.w.org/images/core/emoji/72x72/","ext":".png","source":{"concatemoji":"http://matthewhorne.me/wp-includes/js/wp-emoji-release.min.js"}};
			!function(a,b,c){function d(a){var c,d,e,f=b.createElement("canvas"),g=f.getContext&&f.getContext("2d"),h=String.fromCharCode;if(!g||!g.fillText)return!1;switch(g.textBaseline="top",g.font="600 32px Arial",a){case"flag":return g.fillText(h(55356,56806,55356,56826),0,0),f.toDataURL().length>3e3;case"diversity":return g.fillText(h(55356,57221),0,0),c=g.getImageData(16,16,1,1).data,d=c[0]+","+c[1]+","+c[2]+","+c[3],g.fillText(h(55356,57221,55356,57343),0,0),c=g.getImageData(16,16,1,1).data,e=c[0]+","+c[1]+","+c[2]+","+c[3],d!==e;case"simple":return g.fillText(h(55357,56835),0,0),0!==g.getImageData(16,16,1,1).data[0];case"unicode8":return g.fillText(h(55356,57135),0,0),0!==g.getImageData(16,16,1,1).data[0]}return!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g,h,i;for(i=Array("simple","flag","unicode8","diversity"),c.supports={everything:!0,everythingExceptFlag:!0},h=0;h<i.length;h++)c.supports[i[h]]=d(i[h]),c.supports.everything=c.supports.everything&&c.supports[i[h]],"flag"!==i[h]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[i[h]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);

Second, they fetch it and then finally they serve it through browser without any proper cache. So, it is better to use Classic Smiley plugin. It will elimiate the above JavaScript will load on demand with proper cache.

Inline Small CSS and JavaScript

If you load little CSS too many times by calling HTTP, it will just slow down your website due to tonnes of extra DNS lookup. I can remember that a traditional spam comment fighter plugin of WordPress, Akismet load a small CSS file from the footer. Since our aim is to reduce DNS lookup and serve pages quickly to our visitor. Thus It ‘d be good to inline such files. Alternately, the best solution is Autoptimize plugin, which can automatically combine your full CSS of your WordPress theme in a single separate file. From the next time, never you have to worry about serving CSS in your WordPress blog.

Combine small images into CSS sprite

Did you know? Your theme might load tiny images by calling HTTP, and for this very reason, your site may be very slow. Might those images will be in use by your current theme as background images/slider; navigation symbol; social media link images; etc.There are main two advantages of converting small images into CSS Sprite. At first, it will reduce DNS lookup second it can be cached for a time-period. Now a day, Internet Giant Google are using this technology. You can also generate your CSS Sprite via online tool via Spriteme. In case if you are not able to generate CSS sprite for your WordPress theme, alternatively reduce DNS lookup by creating base64 of small images. Keep in mind that base64URI couldn’t be cached by a web browser.

Optimize Theme Background Images

If you are using background images in your WordPress Blog, you should load in this ways.
Use small images in tiles format with CSS Sprite, base64URI or remove it completely to save bandwidth.
If you are using large images then first compress it and serve that file from a static domain or sub-domain. Also, make sure your background images should have extended expiration period.

Add the missing favicon and touch icons

Indian web geek – Amit Agarwal (labnol.org) says– “Your WordPress theme may not even include references to the favicon (favicon.ico) or the Apple touch icons but web browsers and feed readers may still request them from your server. It’s always better to serve a file than returning a 404.”

Put a 16×16 favicon.ico and a 144×144 apple-touch.png file in the home directory of your blog. Then add this line to your .htaccess to redirect all apple touch icon requests to that particular file.

Yahoo Developers recommends – Your 16×16 pixels .ico format favicon size should be less than 1 KB. Thus, it will be cached in web browser.

RedirectMatch 301 /apple-touch-icon(.*)?.png http://example.com/apple-touch.png

Alternative Method
Hint: To quickly generate multiple size favicons in one click, you can use this Favicon Generator Tool. I’m very happy to recommend this awesome tool.

Understand how Responsive theme can slow down your website

I’m not against the Responsive theme because it’s easy managing a single website for all platforms. But I may contradict with a truth that responsive themes are heavy because they load some extra CSS and JS resources as a comparison to a non-responsive theme. Here is the simplest solution to get rid of this problem.
Serve Dynamic Resources according to the USER Agent (device platform). There are many theme changer plugin available from which you can manage one non-responsive or fast loading theme for desktop and another a mobile friendly and responsive theme for small devices.
Prefer loading each Stylesheet CSS According to the Screen Size parameter.

Convert normal JS to Eval 64

Wants to highly compress your JavaScript? Do you know, You can compress JavaScript up to 20% more using Eval 64 converter method as a comparison to standard JavaScript compression? It is a little bit hard you have to compress manually. Be aware that some JS may not work properly. Implement this method at your risk.
Recommended plugin: JS & CSS Script Optimizer
Caution- Add jquery.js in exclusion list, else some feature may not work.

Don’t use Flash object in your Theme

Some people still prefer Flash theme or flash object in logo even while it is not SEO-friendly and mobile-friendly. According to Google Developer Rules, You should never use such type of theme, because it loads slowly, leading causes of hang and crashes. Hence, it is not considered as the mobile-friendly object.

Specify Meta Character Tag

gTmetrix recommends that Your WordPress theme may not Specified Meta Character tag which can be helpful for browser to understand the elements of your website. Add this META tag in your theme header.

 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

Or, you can simply add Meta Charset through server side. Open .htaccess file and just add one line. I recommend this method; you don’t have worried later even if you change your WordPress theme.

#Default Charset
AddDefaultCharset utf-8

Use Special Stylesheet for old Browser – Internet Explorer

To make your theme cross-browser supported, it is highly recommend adding separate style sheet, html class, and html5.js for older IE versions. [Previous to IE9]

Prefer Async load of JavaScript

Use Async method for loading heavy or less important JS to avoid seeing white page for a long duration while loading WordPress website. You can do this with a plugin called Async JS and CSS. I do not recommend this technique for loading CSS in async mode.

Put CSS in the top of the document

To show your colourful website quickly, you should serve high priority thing – header CSS. So, it recommends loading it firstly before anything. It is a little bit technical; only you can do this via Selective Plugin load plugin. Set your CSS delivery plugin to execute first.

Optimize the Order of CSS Stylesheet and JavaScript.

However, you should try to load your CSS first, then after JavaScript. Autoptimize plugin automatically does this Job automatically. Since, it loads all CSS in one URL, then after it load all JS in one URL.

Compress Images

A compressed image can load much faster than a normal image. You can optimize images by using Photoshop. Open with, go to File menu and click Save for Web and Devices. That’s it.

For bulk image compression, you should use a plugin called ShortPixel. It is available in free and paid. Alternatively, Imagify and Optimus plugin are also very for image optimisation.

Serve scaled images

Never scale down large images into small images by defining width and height parameter in HTML tag. At least, kindly serve scaled images on the size which you need to display. Have you thought, if you are serving 1 MB size (1024×768) images just in resizing with HTML by 650×300? It doesn’t make any sense. In this way, you can only waste other time and your precious bandwidth too.
For example, if your need 400×250 size images first scale you using any Photo Editor, compress it, then add with right height and width parameter. So, the browser will able to understand the size, and it will get fewer size images.

Your WordPress theme should have correct DocType

Incorrect declaring DocType may lead to Mobile SEO penalties, as well as it will render your web pages in a different style (In IE). Hence, it affects page speed. For instance, if you want to declare your website as mobile friendly then you must add this line above <head>, you will notice that you will get a portable badge in Google Search very early.

mobile badge
Mobile Badge in Google SERPs. It indicates that my WordPress theme is mobile-friendly.
 <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" prefix="og: http://ogp.me/ns#">

Avoid CSS Expression

For performance reason, it is not a good idea to use CSS expression whenever you start writing an HTML code. In other words, you should not use CSS code in the HTML body tag. Whatever you need style, please mention in your stylesheet.

Remove Duplicate CSS & JavaScript

Consider checking your CSS, JavaScript before publishing it online. I don’t think it is necessary to repeat five versions of jQuery scripts in a single HTML document. It worthless and only it will increase extra DNS lookup from your site.

4 Reasons you should use latest Version jQuery Script from Google CDN

1. Your theme may reference to local outdated jQuery script, so it is better to change it to latest one
2. I think, jQuery with CDN link will load faster globally
3. Many sites use jQuery from Google Library, so your visitor is going to get benefit of Cached version too
4. Save your bandwidth, let’s don’t put all eggs in one basket 😀

// Load CDN jQuery 
add_action( 'wp_enqueue_scripts', 'register_jquery' );
function register_jquery() {
    if (!is_admin() && $GLOBALS['pagenow'] != 'wp-login.php') {
        // comment out the next two lines to load the local copy of jQuery
        wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js', false, '3.1.1');
// end

Add this above code in your Theme function.

Remove jQuery-Migrate script from header

WordPress by default include jQuery-migrate in header, concerning incompbaility issue with some plugin. The fact is – If you will latest version jQuery and all plugins then there is no use of jQuery Migrate script.
If you want to remove, add below code in your functions.php

// Remove migrate script

add_filter( 'wp_default_scripts', 'remove_jquery_migrate' );

function remove_jquery_migrate( &$scripts)




$scripts->remove( 'jquery');

$scripts->add( 'jquery', false, array( 'jquery-core' ), '1.10.2' );



Use Mobile-friendly theme on WordPress

You should not block your website static resources such as CSS, JS or any images which are included on your web page. Make a little gap between two links. Your content should not fall outside the viewport. Add this Meta Viewport in your Meta Tag; you can find in the header.php file of your current theme.

<meta name="viewport" content="width=device-width" />

Hint – Also, add correct DocType in the beginning of HTML Document or header of your WordPress theme

Put less required JavaScript in the footer

Just think yourself, my dear, how do you will feel when you will see a blank page for a long duration during each loading. So, move all minor JS to the footer which is currently placed in your header of your WordPress theme. I hope this trick will reduce bounce rate as well it will give a positive message to your visitor’s mind. For example, Use a single JavaScript tracking code. Please don’t use such annoying widget, plugins which are not directly beneficial to your visitors in any way.

Minify HTML output of your WordPress theme

For somebody, it may be about keeping HTML tag anonymous. But for me, it important because maintaining the ratio between HTML and Content size is a good practice for SEO. Thus it also reduces the size of HTML output hence, helps to speed up WordPress website. To do this, you need to simply add this PHP code in your functions.php file of your current theme.


function sanitize_output($buffer) {

    $search = array(
        '/>[^S ]+/s',  // strip whitespaces after tags, except space
        '/[^S ]+</s',  // strip whitespaces before tags, except space
        '/(s)+/s'       // shorten multiple whitespace sequences

    $replace = array(

    $buffer = preg_replace($search, $replace, $buffer);

    return $buffer;



Denial: This minification code may not support on all theme.

So, above you were reading about optimising WordPress theme with various techniques.

Optimizing Server

In this 2nd part, now I would like to discuss Optimizing Server. No doubt, your web hosting server is the powerhouse of WordPress website. No matter how much you have done optimization, but your server will slow, you can’t change aspect to load your site under 1-2 sec.

Do you know? The leading Social Networking Website – Facebook has not implemented many on-page optimisation techniques to speed up. But then also it loads under 1.5 sec. You might be wondering how? To make your site blazing fast, you must learn following great tweak about Web Server.

Before telling you anything, I would like to declare that first of all disable Cache plugin to avoid conflict. Else, you may get server side Error 500.

The very first thing
You have to understand that Hosting matters a lot for all over performance. Since your web server has to be very fast, so you have to think less about tweaking it, optimising it in many ways. If you are looking for choosing best Web Hosting Company for WordPress Hosting, I recommend using country based NGINX web server hosting. It will reduce the latency between multiples connections. Prefer those web hosting which provides PHP7, HTTP2.0, SSD Disk, Varnish, NGINX, etc. In my experience, Cloudways is far better than any so-called unlimited & cheap shared hosting. As I am using same on this blog so definitely, I would recommend you too. Please do note: They offer free 14 days Free trial. For free $50 credit, use Coupon code – WPMUDEV.

Use cookies-Free domain to serve Static resources

80-90% of the end-user response time is spent downloading all the components in the web page: images, CSS, scripts, objects, etc. As such, serving the static content from the cookies less domain is a good practice for all websites, where even a little extra time to load something can mean long lag times. WordPress happens to have a provision to enable this feature.

Serve Static Content from a Cookieless Sub-Domain (WordPress Tutorial)

Take advantage of CDN

CDN is a great way to serve static content speedily; I’d suggest leaving your web host to process only regular PHP Execution and move all static contents (except HTML) to a CDN. It allows not only parallel downloading but also serve website content from the nearest server. Do you know? Why Google, Facebook is loading fast from everywhere? Think about it. Choosing a CDN can be a great impact on your Website speed. If you small business then I recommend Max CDN. If you have a large business, then you should use Akamai CDN. It comes at the reasonable prices.

Use Dedicated IP Address

My personal research says those all website who were using Dedicated IP address, there connection time and server response time was Less than 200ms. Google Page Insight Tool also recommend for the same period. That website that was not using Dedicated IP address, I found there website was taking a long time for serving the first byte. Dedicated IP improve speed as well as it is also beneficial for SEO to maintain the authenticity of a website. Also, you should Redirect Dedicated IP address to your primary domain to avoid duplicate content issue.

Enable gZIP Compression for Static Contents

Let me tell you first, what is gZIP? If you enable gZIP compression, your 1 MB size of a website will be served in compressed format approx. 600 KB. So, this is how you saved so much precious bandwidth. Hence, in this way you can easily improve your website loading time will be enhanced quickly. It is supported in limited Server. After adding this below code, you will see incredible improvement in loading time. Cache plugin automatically does this, so If you already using then first disable it before implementing.

<IfModule mod_deflate.c>
  # Compress HTML, CSS, JavaScript, Text, XML and fonts
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/xml

  # Remove browser bugs (only needed for really old browsers)
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4.0[678] no-gzip
  BrowserMatch bMSIE !no-gzip !gzip-only-text/html
  Header append Vary User-Agent

Avoid Empty SRC, 404 URL

Don’t take it lightly. Every time browser land at empty SRC or broken URL, then some browser handle it efficiently, but old browser takes a long individual time to generate a new window of 404. Hence, it affects your loading time. To avoid this problem, keep in mind these five common things to prevent this issue.

Don’t forget to add http:// or https:// while creating hyperlink to the external pages.

While hyperlinking, never leave target URL at www or non-www.

Don’t serve any content from untrusted domain or other resources.

Don’t forget to add device-specific site icons.

After completing a creation of new web page, check with GTmetrix.

You may check your all 404 links via Broken Link Checker plugin or using this online tool or also you should check once at Web Server Log file.

Disable Hotlinking

You can’t monitor easily who is stealing your server bandwidth, and slowing down your website. So, you can simply disable hotlinking through your Hosting Panel. If you are using Cloudflare, under Scrape Shield menu there is also option to do. Or, you can simply add this code in the .htaccess

# Hot link Protection
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?gulshankumar.net [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?bing.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?ask.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?twitter.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?facebook.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?pinterest.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?plus.google.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]

Ps. Please replace my domain (gulshankumar.net) with your own to keep whitelisted. Have custom requirement? Create own syle at http://www.htaccesstools.com/hotlink-protection/

Setup leverage browsing cache

Sometimes, it is also known as defining Expiry header. This setting will enable cache to your static resources. Thus, it will be served website non-changeable content to returning visitors quickly.
Essential Tips: To protect from conflict, if you are already using any cache plugin, then you have first to disable it before implementing.

# Leverage Browser Caching by setting HTTP header expires
<IfModule mod_expires.c>
    ExpiresActive on
    ExpiresDefault "access plus 600 seconds"

  # CSS
    ExpiresByType text/css "access plus 1 month"

  # Data Interchange
    ExpiresByType application/json "access plus 0 seconds"
    ExpiresByType application/ld+json "access plus 0 seconds"
    ExpiresByType application/vnd.geo+json "access plus 0 seconds"
    ExpiresByType application/xml "access plus 0 seconds"
    ExpiresByType text/xml "access plus 0 seconds"

  # Favicon (cannot be renamed!) and cursor images
    ExpiresByType image/x-icon "access plus 1 year"

  # HTML components (HTCs)
    ExpiresByType text/x-component "access plus 1 week"

  # HTML
    ExpiresByType text/html "access plus 0 seconds"

  # JavaScript
    ExpiresByType application/javascript "access plus 1 month"

  # Manifest files
    ExpiresByType application/manifest+json "access plus 1 year"
    ExpiresByType application/x-web-app-manifest+json   "access plus 0 seconds"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"

    ExpiresByType text/cache-manifest "access plus 0 seconds"

  # Media
    ExpiresByType audio/ogg "access plus 1 month"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/png  "access plus 1 month"
    ExpiresByType video/mp4 "access plus 1 month"
    ExpiresByType video/ogg "access plus 1 month"
    ExpiresByType video/webm "access plus 1 month"

  # Web feeds
    ExpiresByType application/atom+xml "access plus 1 hour"
    ExpiresByType application/rss+xml "access plus 1 hour"

  # Web fonts
    ExpiresByType application/font-woff "access plus 1 year"
    ExpiresByType application/font-woff2 "access plus 1 year"
    ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
    ExpiresByType application/x-font-ttf "access plus 1 year"
    ExpiresByType font/opentype "access plus 1 year"
    ExpiresByType image/svg+xml "access plus 1 year"

Setup Cache Control Header

You can setup cache control header for web browser to handle cache. Add this code in your WordPress .htaccess

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
    <filesMatch ".(ico|jpe?g|png|gif|swf)$">
        Header set Cache-Control "public"
    <filesMatch ".(css)$">
        Header set Cache-Control "public"
    <filesMatch ".(js)$">
        Header set Cache-Control "private"
    <filesMatch ".(x?html?|php)$">
        Header set Cache-Control "private, must-revalidate"
# END Cache-Control Headers

Reduce DNS lookup, Monitor Request Size

The more resource you will be the call from HTTP or HTTPS, the more your website will be to slow down. So, try to keep request amount minimum. Every time a web browser visit new web address to look up, it takes few long time to get the response from web server. The browser has limits to process the number of DNS lookup at one time. Check your website at gTetrix, Go to Timeline tab, I’d suggest removing those resources which take longer time to response and serve.

Is SSL really slow down a website?

The answer is NO. It is the truth that HTTPS connections need some extra time to handshake check browser integrity. So, nothing as you imagined. If your answer is yes, I want to ask you very politely – How many time you saw Google, Facebook; Twitter is slow? They all are using SSL. In fact, I have also started using.

Disable Pingback and Trackbacks

If you have busy WordPress site, then it’s good idea to reduce some amount server load by disabling pingbacks and trackbacks.

wordpress pingbacks trackbacks

Uncheck pingback and trackback checkbox in Discussion settings.

Serve images only on Page Scroll down

Especially if you want to load your blog speedily, load your images after content. In this way, you can save your website bandwidth by installing jQuery Image Lazy Load WP.

Optimize WordPress Database

Heavy Database can slow down your website. Well, by optimizing WordPress Database, you can delete all old post revisions, plugins transitions, etc.
Recommends plugins for Optimizing Database is: WordPress Advanced Database Cleaner.

Your MySQL Database should be small as possible as. You can do some important things to reduce database size.
Turn off post revision
Open Wp-config.php > add this line

define( 'WP_POST_REVISIONS', false);

Alternatively, you can also set limit for Post Revision

define( 'WP_POST_REVISIONS', 3);

Source: Editing_wp-config.php

Change Auto Save Post Interval

WordPress has habit to save automatically new post while editing. You can manage time duration by adding this code in your wp-config.php

define( 'AUTOSAVE_INTERVAL', 120 );

Reduce Server Load using FeedBurner for RSS

Since, our aim is to reduce server load, use Google Feed burner instead of Default RSS Feeds. Add this code in your .htaccess file. Make sure; you replace with your RSS Feed URL.

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{HTTP_USER_AGENT} !^.*(FeedBurner|FeedValidator) [NC]
 RewriteRule ^feed/?.*$ http://www.example.com/feed [L,NC,R=301]

Block SPAM Bot Traffics and Unwanted Crawlers

Beware of SPAM bot. To prevent your website from spam bot Traffic, you can apply few settings in your WordPress .htaccess and the robots.txt file. For instance, you can monitor your traffic-referral using Google Analytics.

# Block Spam Site
SetEnvIfNoCase Via evil-spam-proxy spammer=yes
SetEnvIfNoCase Referer evil-spam-domain.com spammer=yes
SetEnvIfNoCase Referer evil-spam-keyword spammer=yes
SetEnvIfNoCase Via pinappleproxy spammer=yes
SetEnvIfNoCase Referer semalt.com spammer=yes
SetEnvIfNoCase Referer kambasoft.com spammer=yes
SetEnvIfNoCase Referer savetubevideo.com spammer=yes
SetEnvIfNoCase Referer buttons-for-website.com spammer=yes
SetEnvIfNoCase Referer poker spammer=yes
Order allow,deny
Allow from all
Deny from env=spammer
# end code

Recommended Plugin: Bot Block

There are some unusual crawler bot who enough to sucks website bandwidth and dilute SEO too. Therefore, add this code per line in your WordPress Website robots.txt

User-agent: OmniExplorer_Bot
Disallow: /
User-agent: FreeFind
Disallow: /
User-agent: BecomeBot
Disallow: /

You can get a complete list at my robots.txt file.

Reduce Crawl rate to Maintain Server Load

It is only for Popular or busy website. You can set crawl rate to maintain the load on the server. Please note: It can cause few seconds delay in indexing new contents. If you want to do, add following lines in your robots.txt

Crawl-Delay: 10

(Note: Generally, it is not recommended unless if you are using a poor host.)

Improve Website Speed by Installing PageSpeed on Server

PageSpeed Module can automatically minify your entire WordPress site from server side. Then it will be automatically turn on. If you are using already any Cache plugin or doing all things manually, then you don’t need. You can simply turn it off, thus add this code in your .htaccess file.

ModPagespeed off

If you are getting Error 500 after adding this, it means you web host has not installed this Extensions. Then you can remove ModPageSpeed from .htaccess. If you are on Shared hosting, you can contact hosting provider to install this extension. It minifies CSS and JS through server side.

Remove eTag

It is used for caching purpose, but if you have set a expire headers for the static contents, then you should disable the eTags functionality. This is how you can disable the ETag using the .htaccess file.
Just you need to place one line in your .htaccess file to disable the eTag.

FileETag none

(Only for static nature website. I strictly don’t recommend this technique for dynamic website like blog)
Also read: How to Serve Images Faster in WorPress using WebP Format?

Specify Very-Accept Encoding

In this way, you can enable very accept encoding for JavaScript, CSS, etc. Add this following lines in your WordPress .htaccess file.

# Specify a Vary: Accept-Encoding header

<IfModule mod_headers.c>

<FilesMatch ".(js|css|xml|gz)$">

Header append Vary: Accept-Encoding



Avoid Unusual Redirects

Redirection takes an extra time to lookup one domain to another domain, so you should keep redirect level minimum. If you are using Facebook like Box, it commons problem they redirect to their landing page. This is a Facebook problem; you can’t do anything for such landing redirects which is not in your hand. But here thing I’m talking about something different that you should stick with one version of URL. Sometime careless changes through .htaccess may lead to non-www to www redirect or vice versa. In that case, you have to define home URL, and site URL in the WordPress Wp-config.php file.


Incase if your WordPress blog is hosted on Subdirectory WordPress, than add this line your wp-config.php

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/wordpress');
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/wordpress');

Enable keep Alive

Keep alive is only of favourite optimisation of WordPress. Since it allows the web browser to make the connection without any stoppage. Some cheap hosting company may not allow you to do this. BTW, You can add this line in your WordPress .htaccess to Enable ‘Keep Alive’ facility.

<ifModule mod_headers.c>
Header set Connection keep-alive

Limit Iframe

If you don’t want to allow other to republish your website under iframe, you can simply restict it for all external domains. In this way, you can save your precious bandwidth of your Server. Place below line in the .htaccess file.

<ifModule mod_headers.c>
Header always append X-Frame-Options SAMEORIGIN

Don’t use default WordPress Comment System

In the previous step 7, I have mentioned a solution for serving gravatar image from Consistent URL. If are using WordPress default comment system no doubt, your Database size will be large. For performance perspective, you can prefer Discus Comment system. It stores all comments at their Server. It offers various login methods, so there are fewer chances of spam comments.

Protect your site From Brute-Force Attack

I think to reduce server load. You should not take this step lightly. Because it impacts negatively on first byte response time.

  1. Limit Access your wp-admin page with password or IP address.
  2. Use WordFence Security Plugin.
  3. Use JetPack Single Sign on feature and replace normal WordPress login page to secure WordPress login page.
  4. Use WordFence Security Plugin to have great firewall protection.

And, The Server side optimisation end here.

Optimizing WordPress Plugins

Now, the very interesting part you will learn from here about Optimizing WordPress plugins installation. You have to first manage all those plugins according to your requirements.

WordPress has blessing features of Plugins. Their some plugins are useful, and some plugins are wrong too. Some plugins are useful, in another hand, few plugins are just eating server resources. See this list of recommend plugins.
BTW, for optimising WordPress plugin you have to implement some techniques, which come handy.

Is JetPack plugin really make slow? Let’s optimize it

The truth is yes and no. Both. It depends on how you use it. Many people say that Jetpack plugin make the site very slow. So, I thought to share this tips in my first point. I’m also using JetPack on this blog, but my site is still fast. The secret is I use below simple code to filter its front-end CSS.
To remove unnecessary CSS code of JetPack

Go to Appearance > Theme Editor > functions.php

add_filter( 'jetpack_implode_frontend_css', '__return_false' );

This filter allows you don’t load CSS from any deactivated modules.


// First, make sure Jetpack doesn't concatenate all its CSS
add_filter( 'jetpack_implode_frontend_css', '__return_false' );
// Then, remove each CSS file, one at a time
// You probably won't need them all, unless you use all the modules, and all the themes! :)
// Some of these are also only loaded on specific admin pages, so it wouldn't affect your readers
function jeherve_remove_all_jp_css() {
        wp_deregister_style( 'AtD_style' );                    // After the Deadline
        wp_deregister_style( 'jetpack_likes' );                // Likes
        wp_deregister_style( 'jetpack_related-posts' );        // Related Posts
        wp_deregister_style( 'jetpack-carousel' );             // Carousel
        wp_deregister_style( 'grunion.css' );                  // Contact form
        wp_deregister_style( 'the-neverending-homepage' );     // Infinite Scroll
        wp_deregister_style( 'infinity-twentyten' );           // Infinite Scroll - Twenty Ten
        wp_deregister_style( 'infinity-twentyeleven' );        // Infinite Scroll - Twenty Eleven
        wp_deregister_style( 'infinity-twentytwelve' );        // Infinite Scroll - Twenty Twelve
        wp_deregister_style( 'infinity-twentythirteen' );      // Infinite Scroll - Twenty Thirteen
        wp_deregister_style( 'infinity-twentyfourteen' );      // Infinite Scroll - Twenty Fourteen
        wp_deregister_style( 'infinity-twentyfifteen' );       // Infinite Scroll - Twenty Fifteen
        wp_deregister_style( 'noticons' );                     // Notes
        wp_deregister_style( 'post-by-email' );                // Post by Email
        wp_deregister_style( 'publicize' );                    // Publicize
        wp_deregister_style( 'sharedaddy' );                   // Sharing
        wp_deregister_style( 'sharing' );                      // Sharing
        wp_deregister_style( 'stats_reports_css' );            // Stats
        wp_deregister_style( 'jetpack-widgets' );              // Widgets
        wp_deregister_style( 'jetpack-slideshow' );            // Slideshows
        wp_deregister_style( 'presentations' );                // Presentation shortcode
        wp_deregister_style( 'jetpack-subscriptions' );        // Subscriptions
        wp_deregister_style( 'tiled-gallery' );                // Tiled Galleries
        wp_deregister_style( 'widget-conditions' );            // Widget Visibility
        wp_deregister_style( 'jetpack_display_posts_widget' ); // Display Posts Widget
        wp_deregister_style( 'gravatar-profile-widget' );      // Gravatar Widget
        wp_deregister_style( 'widget-grid-and-list' );         // Top Posts widget
        wp_deregister_style( 'jetpack-widgets' );              // Widgets
add_action( 'wp_enqueue_scripts', 'jeherve_remove_all_jp_css' );

Source: https://gist.github.com/jeherve/df4e349a209d532a7978

Note: Remove only those module stylesheet which you are not using.

Analyze Plugin Load

Before implementing my Plugin Optimization tips, first of all check Plugin Load using P3 Plugin Performance Profiler plugin. After Checking, you should remove all unusual and heavy plugin which doesn’t matter a lot for you and your visitors.

Now You can Load Selective Plugin using Plugin Organizer. It will help you to load selective plugin according to the requirement. For example, it doesn’t make sense to load Contact Form 7 plugin CSS, Akismet Plugin JS at every page. In WordPress, you can easily manage plugins to load according to post or page requirements. You can also manage order to load each and every plugins.

Show Widgets without affecting Visitor Experience

100 placed Widgets on a single web page annoy my brain too. LOL! Learn to manage it now efficiently. If you are addicted to show many widgets, you can use Display Widgets plugin or Show Widgets module of JetPack, which can control on which page/post/tag/categories you want to show or hide each and every widget. It simply adds a checkbox just below every widget. Isn’t simple!

If possible, don’t use Official Sharing or Follow Button

Yes, you right read. Reasons explained below.- They are not being Mobile Friendly according to Google Developer guidelines.- Facebook like box plugin cause unusual redirect to landing page.- On another hand, Twitter follows buttons also cause the same problem.– Twitter Follow button JavaScript load on web page in sync mode which affect all over the speed of web page.

Solution: It is best idea keep those substantial resources below the fold or use other sharing plugins which can load in ASYNC mode.
For example, if you want to load Tweet button in async way, simply use this code

Takeaway: Platform.js you should load in async way.

Best way to add YouTube Video Iframe

If you are using Google+, you might have sometimes noticed that G+ load YouTube Video Thumbnail only instead of full iframe. When a user clicks on it, then they load actual iframe. On the same principle, you can do for your WordPress blog. Simply install the Plugin WP YouTube Lyte.

It is important to have Best and optimised WordPress theme.
Server impact a lot on all over performance
Make use of less Plugins as possible as.

Bonus tips: Using WP Super Cache plugin would be great for your WordPress Blog. Rest all, if anything left you may apply manually to increase your blog speed. If you enjoyed this post please do SHARE.

Learn more

  1. WordPress Optimization « WordPress Codex
  2. Make the Web Faster | Google Developers
  3. 19 Tips to Speed Up WordPress Performance – WPBeginner
  4. WordPress Optimization Guide | GTmetrix
  5. 5 Quick Ways to Speed Up Your WordPress Site – WPMU DEV
  6. 18 Tips on How to Speed Up WordPress – KeyCDN”
  7. Pagespeed – The tool and optimization guide – Varvy
  8. Optimize Your WordPress Website Using These Simple Tips | Elegant
  9. WordPress Optimization Bible | Prelovac.com
  10. Optimize Your WordPress For More Speed – SiteGround
  11. WordPress Performance Optimization – New Relic blog

If you know any more way to increase WordPress Speed or have you any suggestion, please let me know through comments. Thanks!

Subscribe our blog via Email
Get instant updates of our new blog post directly at your Mailbox.


  1. Angus June 4, 2015
    • Gulshan Kumar Gulshan Kumar June 4, 2015
  2. Kushal Azza June 4, 2015
    • Gulshan Kumar Gulshan Kumar June 5, 2015
  3. Akshat February 10, 2016
    • Gulshan Kumar Gulshan Kumar February 12, 2016
  4. BARNALI May 14, 2016
    • Gulshan Kumar Gulshan Kumar May 14, 2016
  5. PC Cracker June 3, 2016
  6. surender June 8, 2016
    • Gulshan Kumar Gulshan Kumar June 8, 2016
  7. Abhishek Kumar June 9, 2016
  8. Bharat June 20, 2016
    • Gulshan Kumar Gulshan Kumar June 22, 2016
  9. Sarthak Sharma June 24, 2016
  10. Sharad jawla July 9, 2016
    • Gulshan Kumar Gulshan Kumar July 9, 2016
  11. Kathir July 14, 2016
    • Gulshan Kumar Gulshan Kumar July 15, 2016
  12. Techie July 19, 2016
  13. Ajay July 21, 2016
    • Gulshan Kumar Gulshan Kumar July 21, 2016
  14. Gaurav Verma July 22, 2016
  15. Shaikh Masood Alam July 29, 2016
  16. Kelvin August 13, 2016
    • Gulshan Kumar Gulshan Kumar August 13, 2016
  17. Clay Smith August 17, 2016
    • Gulshan Kumar Gulshan Kumar August 17, 2016
  18. Satinder singh September 1, 2016
    • Gulshan Kumar Gulshan Kumar September 1, 2016
  19. Tyrohn White September 16, 2016
    • Gulshan Kumar Gulshan Kumar September 16, 2016
  20. Benoit October 4, 2016
    • Gulshan Kumar Gulshan Kumar October 4, 2016
  21. Rahul November 8, 2016
  22. Shekhar November 9, 2016
  23. yash November 25, 2016