How To Get A Speed Grade On WordPress Website?

Website load time. The pain in the ass for every website owner. WordPress is not an exception. Lot of work is needed in order to get A speed grade on WordPress website. Good hosting is most important. If you have slow hosting you can’t get good speed for your site even if you are a master of caching websites. How to check your hosting?

The easiest option is to go to your admin panel of WordPress. If it loads very slow, you should consider changing your hosting. Especially if you use shared hosting plan. In that case don’t expect miracles

If you use many ads on page + social buttons + external scripts, forget about A grade. You can’t cache external scripts. Using good CDN is recommended option to decrease page load time.

But even if you don’t get A speed grade on WordPress website, don’t be upset. The most important thing is site speed. You can utilize several tips to improve WordPress website speed. It must be under 5 seconds. If your site loads in 3 seconds – good, 1 second – awesome. Even if you get C grade, but your site loads under 1 second, congratulate yourself and give high-five.

 

Get A Speed Grade on WordPress Website

 

You may think now something like “He is giving page speed advises? Even his site speed is bad.” Well, you are not far from truth. Yes, this site speed is not admirable depending from which country you visit. But I have my reasons for it.

Above advice to optimize site is based on few of other sites I am managing. If you like try it. If don’t, give better advice.

Some of best site for website speed test are:

  1. GTmetrix
  2. Pingdom
  3. Google PageSpeed Insights

Above sites are great to test website speed and page load speed. If you check website speed on all of three, you will probably get different results. But there shouldnt be much difference. Be advised, location used to test wordpress website load time is also important factor.

 

Get A Speed Grade on WordPress Website

Here are mthods which you can utlize to increase your WordPress website speed:

1. Hyper Cache + Autoptimize + htaccess tricks

This speed optimization suggestion is more for beginners because Hyper cache is one of the cache plugins that don’t conflicts with many other plugins. And it’s very easy. Only few settings.

NOTE: If you use WooCommerce, add your cart url to uncached pages. For this, copy link to cart page for woocommerce. Go to Bypasses tab in Hyper cache settings. And add that link to Exact URIs in order to be bypassed. Download Hyper Cache, install and activate. It is free.

 

How-to-get-A-grade-on-Yslow-and-PageSpeed

 

 

Hyper cache creates database and page cache. Next thing that you can do is to create html, js,css cache. You can do that by using Autoptimize. It is free so just download, install and activate. After enabling, you need to enable different options. If you have troubles with other plugins, try to enable advanced options.

 

Get-A-grade-For-WordPress-Website-On-Yslow-And-PageSpeed

 

Then try to check Force JavaScript in <head> and Look for styles only in <head>. Next thing that you can add for getting more points is set file expiry. For this, you need to add some code to your file .htaccess. If you use SEO by Yoast plugin just go to SEO -> Edit files.

 

Add below code to your .htaccess

# Expires headers (for better cache control)
# ———————————————————————-
# These are pretty far-future expires headers.
# They assume you control versioning with filename-based cache busting

# If you don’t use filenames to version, lower the CSS and JS to something like
# “access plus 1 week”.
<IfModule mod_expires.c>
ExpiresActive on

# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault “access plus 1 month”

# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest “access plus 0 seconds”

# Your document html
<FilesMatch \.(html|xhtml|xml|shtml|phtml|php|txt)$>
ExpiresDefault “access plus 0 seconds”
FilesMatch>
ExpiresByType text/html “access plus 0 seconds”

# Data
ExpiresByType text/xml “access plus 0 seconds”
ExpiresByType application/xml “access plus 0 seconds”
ExpiresByType application/json “access plus 0 seconds”

# Feed
ExpiresByType application/rss+xml “access plus 1 hour”
ExpiresByType application/atom+xml “access plus 1 hour”

# Favicon (cannot be renamed)
<FilesMatch \.(ico)$>
ExpiresDefault “access plus 1 week”
FilesMatch>
ExpiresByType image/x-icon “access plus 1 week”

# Media: images, video, audio
<FilesMatch \.(gif|png|jpg|jpeg|ogg|mp4|mkv|flv|swf|wmv|asf|asx|wma|wax|wmx|wm)$>
ExpiresDefault “access plus 1 year”
FilesMatch>
ExpiresByType image/gif “access plus 1 month”
ExpiresByType image/png “access plus 1 month”
ExpiresByType image/jpeg “access plus 1 month”
ExpiresByType video/ogg “access plus 1 month”
ExpiresByType audio/ogg “access plus 1 month”
ExpiresByType video/mp4 “access plus 1 month”
ExpiresByType video/webm “access plus 1 month”

# HTC files (css3pie)
ExpiresByType text/x-component “access plus 1 month”

# Webfonts
ttf|otf|svg|woff)$>
ExpiresDefault “access plus 1 year”
</FilesMatch>
ExpiresByType application/x-font-ttf “access plus 1 month”
ExpiresByType font/opentype “access plus 1 month”
ExpiresByType application/x-font-woff “access plus 1 month”
ExpiresByType image/svg+xml “access plus 1 month”
ExpiresByType application/vnd.ms-fontobject “access plus 1 month”

# CSS and JavaScript
css|js)$>
ExpiresDefault “access plus 1 year”
</FilesMatch>
ExpiresByType text/css “access plus 1 year”
ExpiresByType application/javascript “access plus 1 year”

# Static assets
pdf|doc|rtf|xls|ppt)$>
ExpiresDefault “access plus 1 year”
</FilesMatch>
ExpiresByType application/x-shockwave-flash “access plus 1 year”
ExpiresByType application/pdf “access plus 1 year”
ExpiresByType application/msword “access plus 1 year”
ExpiresByType application/rtf “access plus 1 year”
ExpiresByType application/vnd.ms-excel “access plus 1 year”
ExpiresByType application/vnd.ms-powerpoint “access plus 1 year”
IfModule>
<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>

2. W3 Total Cache

You should consider using W3 Total cache if you are familiar with using cache plugins. This plugin is a tool like all-in-one. You can set page, object, browser, files, CDN, etc.

This is very powerful plugin with various number of settings. The main problem of plugin is that it often conflicts with different plugins. I can recommend this plugin if you don’t use too many plugins.

If you have problems with theme and this plugin, in 99% cases this is because W3 Total Cache is experiencing conflict with one of plugins on site. In 90% cases this is because of js and css minify. So, if you have such problems on frontend (for example, all tabs, sliders, grids are broken) – just disable css and js minify.

 

 test website speed and page load speed

A Warning About Caching

Caching is a very effective way to speed up WordPress, but it also comes with a few drawbacks. Depending on how aggressive the caching is, it can mean that changes you make won’t go live for a long time unless you flush the cache. Compatibility issues with certain plugins are also to be expected.

For testing page speed I recommend GTmetrix and Google PageSpeed. Hoped this little tutorial helped and you managed to get A speed grade on your WordPress website. If not, just make page load time is around 5 seconds.

For caching plugin I highly recommend using WP Speed of Light, WP Rocket or LiteSpeed Cache.


DISCLOSURE: Posts may contain affiliate links. If you buy something through one of those links, I might get a small commission, without any extra cost to you. Read more about it here.

2 thoughts on “How To Get A Speed Grade On WordPress Website?”

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top