Everyone like fast loading website. Is your WordPress site slow? If yes, you need to work on that and make your site fast loading. You will learn here about optimizing WordPress Theme, Web Hosting Server (Server Side Optimization), Plugins installation and some other factors. Here I tell you about make speed up your WordPress site.
WordPress is a great platform. I have used WordPress last some month and learn some better. Now I able to teach you WordPress site optimizing and make fast loading your blog. I promise these tips work 100% and you can make easily speed up your site.
- How To Use Ad Injection Plugin on WordPress Blog For Adsense Ads
- How To Set Up Yoast SEO Plugin For Higher Search Ranking
I have worked on many themes of WordPress and I finally realized that all theme require speed optimization.
No any WordPress themes come with already-optimized. You can optimize WordPress theme by applying these all important tips. So let’s start learning. We talk here perfect optimization tips to make your WordPress blog fast loading.
Why Site Speed is Important:
When a user opens your site first time and your site open fastly then he like it. He wants to visit your site next time because your site opening fast. Search Engine also like fast loading website and you can get more traffic from SEPRs.
If your site takes too long time 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. Here all tips are WordPress speed up each other, for better understanding you are requested to read very carefully.
30 Tips to Optimize WordPress for More Speed
I am here to tell you anything. I have learned everything while on the other sites and WordPress. This is my self-experience and you can check my blog speed also, So I guarantee that using even a few tips will help you to speed up your site. - Complete Guide To Make Fast Loading Your WordPress Blog.
1. Choose a Better Hosting Server:
When you start a WordPress blog you need a shared hosting. Some hosting server incredibly slow site speed and frequent downtime during high traffic periods.
There are many hosting provider companies like HostGator, Bluehost, GoDaddy, eHost, WPengine and other. But only some hosting providers give you better service.
I ask other WordPress blogger and also check many WordPress blog loading speed. Finally, I decide Bluehost and Hostgator better-hosting provider than other.
I highly recommended you to using Hostgator and Bluehost hosting. Because I'm also using their hosting and get really amazing service.
If you ask me to choose one in Hostgator and Bluehost I suggest you to hostgator.com. because Hostgator gives you 99.9% uptime guarantee and 24/7 support.
2. Select a Solid Theme / Framework:
Always choose fast loading WordPress theme. There are many premium WordPress theme that makes your blog fast loading.
If you know WordPress coding then you can optimize your WordPress blog's theme and make it speed up. You might be surprised to hear this, but the Twenty Fifteen “framework” is lightweight and quite speedy.
From my experience, the fastest loading premium framework is definitely the Thesis Theme Framework and Genesis theme framework. It surpasses the basic WordPress themes by being far easier to customize.
StudioPress Genesis theme number one theme in the world. I'm also like it. If you want to check this theme then click here - Genesis Framework.
If You can do this, You can make different designs to your WordPress blog's theme and maintain their own identity.
3. Don't Use Many Plugin:
If you use WordPress plugin album and a lot of your site then this may be the result of slow speed. You just need to use the plugin itself, remove the useless plugin. If you want to know what the plugin can do open up your website slowly.If yes then install
If yes then install P3 (Plugin Performance Profiler) and check that which plugin make your site speed slowly.
I suggest you don't use third party plugin that doesn't update last big time. Because that plugin kills your blog security. Your site may be effect malware virus.
4. Use The Best Caching Plugin:
WordPress plugins are obviously quite useful. There are many WordPress caching plugins like W3 Total Cache, WP Super Cache, WP Rocket and other. I suggest you to using W3 Total Cache plugin. This plugin helps you to increase 20% loading speed of your WordPress blog.
My favorite plugin 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. You can simply install and activate this plugin. Then you see what your page load faster as elements are cached.
If you don't want use W3 Total Cache plugin then you can try WP Super Cache plugin. This plugin also gives you better responsive.
5. Use a Content Delivery Network (CDN):
CDNs or Content Delivery Networks help deliver static files of your website faster to your visitors from a server location much closer to them than your site’s servers. Every big blog is making use of this, If you are using WordPress then you also using any CDN network. CDN means 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.
I personally use the CloudFlare CDN Content Delivery Network on my WordPress sites. Their dashboard is very simple to use. CloudFlare gives you free and premium plan. You can try first free plan then if you like it you can buy a premium plan. You can also use other CDN's network like Max CDN.
6. Optimize Your WordPress Site’s Database:
Your database health does play the major role in your site’s performance. WordPress database optimization plugin and get your site’s database in order. You can simply use the WP-Optimize and WP-DBManager plugin, I have already used this on my sites. This plugin lets you do just one simple task: optimize your database (spam, post revisions, drafts, tables, etc.) to reduce their overhead.
If you decide to spring clean your WordPress, you should delete unused terms, images, themes, plugins, fix broken links and keep your site’s database.
You can also optimize your database by stop Post Revision and Pingback. I have also optimized my blog database and get 101% better result.
7. Optimize Your Blog Homepage:
This is the big thing to speed up your site. You can do some changes that your homepage loads quickly. The homepage is the most important part of your site because people will be landing there the most often. Follow that steps:-
- Don't show the full post on blog's homepage.
- Show a minimum number of pages like 5-7 page. (I highly recommended)
- Don't add many javascript files on a homepage.
- Remove all redirection links widget. That mostly affect site speed.
- Remove all inactive plugins and widgets that you don’t need.
- Add the minimum widget in your blog sidebar.
- Don't use facebook page like the box and as another slow loading widget.
- Don't add many google Adsense ads on the homepage.
- Keep less than the 1MB size of your blog homepage.
- Make simple design and don't use many images.
Many bloggers like simple design blog that helps not only your blog look good but also help to load fast. I always say my readers to choosing simple design theme. Because 90% user like simply designed websites. Everyone don't like full designed and colorful sites.
8. Optimize Images:
Everyone blog needs images without image post look not too good. But you can use image optimized and make your content better. Mostly images size is big but you can optimize it and make less 40% size of your images.
Images have many formats like jpeg, png, gif, jpg and other. I always using jpg file format. Because of this format size very less. The example you have 50kb png image then you convert it jpg you will see file size less 30kb.
You can also use WP-SmushIt free plugin which will do this process to all of your images automatically.
9. Disable Hotlinking:
Hotlinking is a means by which people use the content that is the host on your site’s servers for their own websites. So basically they use your servers with your content on their site. And as a result, your server gets loaded with no benefit to you whatsoever. 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.
You can use this tool from htaccesstools.com to generate the necessary code which you can add to your server. Normally, your host will also be willing to help you with this.
Once you prevent hotlinking then place generate code in .htaccess file on your host. Go to your hosting panel > file manager > click on public_html and select your domain > .htaccess file.
10. Disable Pingbacks and Trackbacks:
Trackbacks and pingbacks are used to let you know that someone else has put a link to your post on another blog or site. Trackbacks are manual and pingbacks are automatic, they both end up in your comment moderation. 99% of all trackbacks and pingbacks are spam. And if you start getting too much of it, your site speed can potentially be affected.
Go to Settings > Discussions, under Default Article settings disable the pingbacks and trackbacks.
11. Control a number of post revisions:
Heavy Database can slow down your website. Well, by optimizing WordPress Database, you can delete all old post revisions. When you write the new post on your WordPress blog. Your every post saved automatically many times. I mean WordPress device generate backup your one post.
Now, when your post is done and you published it, why would you need all of those drafts stored? So you can control post revision store. There are two options to control post revision.
First, you can use WordPress post revision control plugin like Optimize Database after Deleting Revisions plugin. This plugin is my favorite plugin. Because this plugin gives us simple features to optimize WordPress database.
Second, you can off vision by adding this code on Wp-config.php.
- Off post revision
define( 'WP_POST_REVISIONS', false);
- Set limit post revision
define( 'WP_POST_REVISIONS', 3);
- Change Auto Save Post Interval
define( 'AUTOSAVE_INTERVAL', 120 );
Set it to 2 or 3 so you have something to fall back on in case you make a mistake, but not too high.
12. Use CloudFlare:
We also talk about CDN's. CloudFlare gives you better service. I have also used it on my all WordPress website. Wao, my site is really affected and open fastly. That will greatly improve not only the speed but the security of your site.
13. Remove Replace PHP with static HTML:
This is a little-advanced reason to make downloading time of your site. you should replace some PHP code of header and footer with simple HTML code. Can you easily 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="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
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". Keep in mind that you should replace only that PHP code which is not going to be changed forever in your WordPress theme. Also, change footer code.
14. Adjust Gravatar Images:
When your reader does comments on your blog post and post get many comments then your page loading time is slow. Because every comment shows gravatar profile photo. You can set up it on your blog.
Go to WordPress dashboard > settings > discussion and choose blank space and default.
It not important. So you can use gravatar images choosing MonsterID (Generated).
15. Add an Expires Header:
An Expires header is a way to specify a time far enough in the future. So you can simply paste this code into your root .htaccess file. The above numbers are set for a month (in seconds), you can change them as you wish.
# Leverage Browser Caching by setting HTTP header expires <IfModule mod_expires.c> ExpiresActive on ExpiresDefault "access plus 1 week" # 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" </IfModule>
16. Analyze and Remove Unused CSS:
You are not using 100% CSS. Therefore, you can analyze some unusual CSS using Google Chrome browser. Follow This steps.
- Open your website in Google Chrome.
- Then Press F12, and Click on Audits.
- Click Web Page Performance checkbox and Audit Present State radio button.
- Click Run. You will see all unused CSS rules.
Remove only if you know what you are going to remove. You can do a mistake and remove important CSS files. So first backup your blog style.css file and other then do it.
17. Remove WordPress Query String:
Check your WordPress website source code, you will see many unnecessary query string
?ver=4.2
Now, 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 );
18. Add the missing favicon and touch icons
Every blog has an own favicon. It is very important to site identity and look for readers. Many success bloggers suggest to use it. You can easily paste this code after <head> in your WordPress blog header.php.
<link rel="icon" type="image/x-icon" href="http://example.com/favicon.ico" />
19. Use Mobile-Friendly Theme:
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" />
20. Use cookies-Free domain to Serve Static Resources:
Most visitors like fast loading pages, CSS, images, javascript, query 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.
Follow steps to make Cookies-Free subdomain:
- First, create a subdomain like static.example.com with assigned path to /public_html/example.com/static.
- Now copy your wp-content folder and paste at /public_html/example.com/static.
- Now, Go to Public-HTML folder and set below two constants in your wp-config.php file.
define("COOKIE_DOMAIN", "www.yourdomain.com"); define("WP_CONTENT_URL", "http://static.yourdomain.com");
After this, Please make sure that you have used “blog info(‘template_directory’)” function to load your static content in theme files.
21. Enable gZIP Compression for Static Contents:
The main reason it is important is because it reduces the time it takes for a website to transfer the page files and style sheets which ultimately reduces the load time of your website. If you will enable gZIP compression your 1 MB size of the website will be served in compressed form at approx. 500-600 KB. Means this can reduce the size of pages and style sheets by up to 70%.
So, this is how you saved so much precious bandwidth. Hence, in this way you can easily improve your website loading time will be improved easily. It is supported in limited Server. You just need to place below single line code in your .htaccess file. After adding this code, you will see the amazing improvement in loading time. Cache plugin automatically does this, so If you already using then first disable it before implementing.
You will need to add the following lines to your .htaccess file:
<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 </IfModule>
22. Setup Cache-Control Header:
Every time a browser loads a web page it has to download all the web files to properly display the page. This includes all the HTML, CSS, javascript, and images. Browser caching can help by storing some of these files locally in the user's browser. Their first visit to your site will take the same time to load, however when that user revisits your website, refreshes the page, or even moves to a different page of your site, they already have some of the files they need locally.
To enable browser caching you need to edit your HTTP headers to set expiry dates on certain types of files. You can setup cache control header for the web browser to handle cache. Add this code in your WordPress .htaccess.
# BEGIN Cache-Control Headers <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/gif "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType text/css "access plus 1 month" ExpiresByType application/pdf "access plus 1 month" ExpiresByType text/x-javascript "access plus 1 month" ExpiresByType application/x-shockwave-flash "access plus 1 month" ExpiresByType image/x-icon "access plus 1 year" ExpiresDefault "access plus 2 days" </IfModule> # END Cache-Control Headers
23. Reduce Server Load using FeedBurner for RSS:
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://supportmeindia.com/feed [L,NC,R=301] </IfModule>
24. Block SPAM Bot Traffics and Unwanted Crawlers:
To prevent your website from spam bot Traffic, you can apply few settings in your WordPress access and the robots.txt file.
# 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
25. Specify Very-Accept Encoding:
We recommend a minimum cache time of one week and preferably up to one year for static assets or assets that change infrequently. 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 </FilesMatch> </IfModule>
26. Minify HTML Output of Your WordPress Theme:
Minify is a programming term that basically means to remove any unnecessary characters that are not required for the code to execute. Minifying your code speeds up your page loading, making visitors and search engines happy.
Minifying your code removes:
- White space characters
- New line characters
- Comments
- Block delimiters
You can test the speed of your page loads using online tools like Google PageSpeed Tools. Every site is different, but as an example, a before score might be around the mid-80s and an after score might be around the mid-90s. It will give you results for desktop and mobile separately and it will highlight the areas that are the slowest (such as server response) and give you tips on how to fix it.
There are several types of tools that you can use to minify your code manually. You can minify by hand or use one of the many free online tools and copy and paste your code from and to your site.
27. Enable keep Alive:
Enabling HTTP Keep-Alive or HTTP persistent connections allow the same TCP connection to send and receive multiple HTTP requests, thus reducing the latency for subsequent requests. You can simply add this line in your WordPress .htaccess to Enable ‘Keep Alive’ facility.
<ifModule mod_headers.c>
Header set Connection keep-alive
</ifModule>
28. Remove ETag:
Entity tags (ETags) are a mechanism web servers and browsers use to determine whether a component in the browser's cache matches one on the origin server.
Since ETags are typically constructed using attributes that make them unique to a specific server hosting a site, the tags will not match when a browser gets the original component from one server and later tries to validate that component on a different server. The problem with ETags is that they typically are constructed using attributes that make them unique to a specific server hosting a site.
Just you need to place one line in your .htaccess file to disable the ETag:
Header unset ETag FileETag none
ETags won't match when a browser gets the original component from one server and later tries to validate that component on a different server, a situation that is all too common on Web sites that use a cluster of servers to handle requests. By default, both Apache and IIS embed data in the ETag that dramatically reduces the odds of the validity test succeeding on web sites with multiple servers.
29. Turn Off Mode Pagespeed:
The goal of mod_pagespeed is to speed up your website. It does this by applying filters to a variety of files in order to reduce the number of trips the browser has to make to grab what it needs, to reduce the size of those files and to optimize the length those files are cached. You can simply turn it off, thus add this code in your .htaccess file.
<IfModule pagespeed_module> ModPagespeed off </IfModule>
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.
30. Block Unwanted Spambot Website Traffic:
The best way to block referrers from accessing your site at all is to block them in your .htaccess file in the root directory of your domain. You can copy and paste the following code into your .htaccess file, assuming you’re on an Apache server. I like this method better than just blocking the domain in analytics because it prevents spam bots from hitting your server altogether. If you want to get creative, you can redirect the traffic back to their site.
# Block Russian Referrer Spam RewriteEngine on RewriteCond %{HTTP_REFERER} ^http://.*ilovevitaly\.com/ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://.*ilovevitaly.\.ru/ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://.*ilovevitaly\.org/ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://.*ilovevitaly\.info/ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://.*iloveitaly\.ru/ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://.*econom\.co/ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://.*savetubevideo\.com/ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://.*kambasoft\.com/ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://.*buttons\-for\-website\.com/ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://.*semalt\.com/ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://.*darodar\.com/ [NC] RewriteRule ^(.*)$ – [F,L]
Note: - .htaccess is a very powerful file that dictates how your server behaves. If you upload a .htaccess file with one character out of place, you will likely take down the whole site. Before you make any changes to the file, I would suggest making a backup.
- How To Setting Up Blogger Blog To Help People Find Your Blog
- How To Get More Page Views Using Roost Web Push WordPress Plugin
Finally, I hope you like this article and increase your site loading speed following this guide. If you really like this post, You may read my other WordPress speed optimization post that gives you some better optimization tips to increase your WordPress site performance and make your site fast loading.
If you like this article and get helpful information then share this on social media with your friends.
I have same issue with my blog that blog is taking too much time to open. I think I need to make some in that blog I hope this steps works
Wow nice information jumedin sir