Do you want your WordPress site to be faster? Adding expires headers can help. This guide will show you how.

Credit: kinsta.com
What are Expires Headers?
Expires headers tell browsers how long to keep files. This helps in loading your site faster. It reduces server load and improves speed. So, it’s important.
Why Add Expires Headers?
- Improves website speed
- Reduces server load
- Enhances user experience
- Boosts SEO rankings
How to Add Expires Headers in WordPress
Step 1: Backup Your Website
Before making changes, always backup your site. This is very important. If anything goes wrong, you can restore it.
Step 2: Access Your .htaccess File
The .htaccess file is in your WordPress root directory. Use an FTP client or your hosting file manager to access it.
Step 3: Add Code To .htaccess
Open the .htaccess file and add the following code:
# BEGIN EXPIRES HEADERS
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
# END EXPIRES HEADERS
This code sets the expires headers for various file types. It tells the browser how long to store these files.
Step 4: Save And Upload The .htaccess File
After adding the code, save the file. Then, upload it back to your server.
Step 5: Test Your Website
Visit your website to make sure everything works fine. Use online tools like GTmetrix or Pingdom to check if expires headers are active.
Using a Plugin to Add Expires Headers
If you are not comfortable with coding, use a plugin. There are several plugins that can help.
Step 1: Install And Activate A Plugin
Go to your WordPress dashboard. Navigate to Plugins > Add New. Search for “expires headers” and install a plugin. Then, activate it.
Step 2: Configure The Plugin Settings
Each plugin has different settings. Follow the plugin instructions to set expires headers.

Credit: blog.hubspot.com
Popular Plugins for Expires Headers
- W3 Total Cache
- WP Fastest Cache
- Hummingbird
Frequently Asked Questions
What Are Expires Headers In WordPress?
Expires headers tell browsers when to download content again.
Why Should I Add Expires Headers?
They improve website speed by reducing load times.
How Do Expires Headers Work?
They store content in the browser for a set time.
Can I Add Expires Headers Without Plugins?
Yes, by editing the. htaccess file.
Conclusion
Adding expires headers in WordPress is easy. It improves website speed and user experience. You can do it manually or use a plugin. Follow the steps and enjoy a faster website.