Fix GTMetrix Add expires Headers Error. GTmetrix is a popular website to measure website performance. You can fix GTMetrix Add Expires Headers error. GTMetrix / Gt Metrix is a free service to use. It measures even the minute details of website performance and interestingly it is free to use.
Must Read –
Most of the Bloggers, especially the bloggers who use WordPress trust GTMetrix for measuring their blog’s stats.
I am sub dividing the article into two parts –
Scroll Down if the click does not work for you.
- Login to your WordPress Dashboard and go to Plugins section on Left side.
- Click Add New plugin and search for Yoast SEO.
- Hit install and follow the on screen instructions.
- Go to SEO section, click Tools and then File Editor (SEO » Tools » File Editor ).
- Select the .htaccess file and enter the below given code.
- Save and close the file and you are done to fix GTmetrix Add Expires Header Error.
- Login to your Blogger Website or blog.
- Now from your dashboard, go to Template and edit HTML.
- After you open the file in edit mode, paste the below given code.
- Save and close the file.
Code for Blogger
<include path=”/assets/**.css” expiration=”7d” />
<include path=”/assets/**.js” expiration=”7d” />
<include path=”/assets/**.gif” expiration=”3d” />
<include path=”/assets/**.jpeg” expiration=”3d” />
<include path=”/assets/**.jpg” expiration=”3d” />
<include path=”/assets/**.png” expiration=”3d” />
The COde you need to enter for wordpress is below –
Sometimes, even after you place this code in your .htaccess file, then also you might get the same error in GTMetrix.
This might be due to any external java script. It could also be due to the Google Adsense code. But you should note that the errors appearing are less now. You can continue to use your WordPress blog now. I also recommend you to get a backup before you install the plugin and make the changes. Taking a precaution is always better