how to add expires headers wordpress

The Ways on How to Add Expires Headers WordPress

Posted on

There will be some ways on how to add expires headers WordPress to do. The optimization of the WordPress website becomes a continuing post to optimize the performance of CSS and activate Gzip Compression on WordPress. You can do some ways to increase the loading speed of WordPress. Adding expires headers becomes one of the ways of reaching that goal.

The Functions of Expires Headers

Having a website with a fast loading is a must because it becomes an essential point of search engine optimization. The use of expired headers is to control caching on the browser. There will be some benefits of adding expires headers to manage the cache. It is determining the expired date for image files, CSS and Java Scripts so that the browser can use this cache to visit the next website page. The browser uses this cache to reduce the number of HTTP requests so that it makes the website page fast loading. With expired headers, it is to manage an active period of cache on the browser. If you have passed the expired date, the browser will collect back a new cache from the website assets.

For example, when you first open a website, the browser will take overall good data like CSS and the other functions on the website and save it in the cache formation. When the visitors visit the next website, a browser will ensure that the assets must load based on the expires header. If it doesn’t have an expiration date, it is showing back directly from the cache so that it accelerates the website response.

Read Also:  How to Make Phone Number Clickable Wordpress

how to add expires headers wordpress

How to Add Expires Headers

To improve the speed and performance of the website site, it is letting you add expires headers for some kinds of files. Make sure that you have access to the website root because you will modify the htaccess file.

  1. Firstly, you log in to the cPanel website, file manager, and htaccess
  2. Then, copy the following code and add it to the file of htaccess

<IfModule mod expires. c>

ExpiresActive on

ExpiresByType application/pdf A31557600

ExpiresByType image/x-icon A31557600

ExpiresByType image/ A31557600

ExpiresByType image/svf+xml A31557600

  1. Then, click save changes

It needs to know that you can’t feel it. The way to test can be conducted on the tutorial before by using dev tools on the browser or use online tools of

Have you ever recommended the ways on how to add expires headers WordPress when you use GTMetrix? A recommendation of tools to speed check the website is related to the loading problems. If it lets up, the comfort of the website’s visitors will disturb and search rank can decrease. Expires headers is a code line letting the browser know the period of cache file on any site.

Using Apache Web Server

To add expires headers, you need to access file htaccess. The ways are using cPanel. You can log in to the account of cPanel with the appropriate username and password.

Login File Manager

You should log in to the file manager and select a folder of public_html. Then, you will find a file of htaccess and click right and choose edit.

Read Also:  4 Plugins to Help How to Duplicate WordPress Page and Post

Those are some ways on how to add expires headers WordPress.


Gravatar Image
Welcome to Krisetya Tech! Krisetya Tech is an interactive blog about technology. We provide reviews and other content related to tech gadgets like smartphones, PC's, laptops, tablets and more.

Leave a Reply

Your email address will not be published.