Optimize your WordPress Site for SEO and Reduce your Bounce Rates.
While there are many different things you can do to make your site faster, in this post I’m going to show you how to add expires headers to WordPress with a little snippet to add in your .htaccess file that will set your Expire Headers time.
The faster your site loads the better it is for your SEO and for your Bounce Rates.
Expire Headers tell your visitor’s browser to cache your website content and request it again only after the time specified in that rule expires.
If you want to set Expire Headers for all of your image, JS and CSS files, open your .htaccess file (in your site’s root folder) and add the following rule above the # BEGIN WordPress line:
Is your WordPress site still slow? We review what’s slowing your site down and tune it to load faster, for a flat $299. See speed optimization →
ExpiresActive On
ExpiresDefault A2592000
FilesMatch sets the file extensions that are affected by the ExpiresActive rule while the ExpiresDefault sets the cache time. When that time expires, your visitor’s browser will request the files again.
ExpiresDefault is access time (A) plus 30 days (2592000 seconds), so using the same rule you can set your own ExpiresDefault time (just be careful to calculate in seconds).
If you want to set a separate Expire Headers rule for each of your file types, you can use the following snippet in your .htaccess instead.
ExpiresActive On
ExpiresByType image/png A2592000
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/webp A2592000
ExpiresByType image/svg+xml A2592000
ExpiresByType text/javascript A2592000
ExpiresByType application/javascript A2592000
ExpiresByType text/css A2592000
Prefer a plugin? To add expires headers to WordPress with a plugin, most caching plugins can write these rules for you. W3 Total Cache has expires header settings in its Browser Cache options, and WP Rocket adds browser caching rules to .htaccess automatically. Expires headers also work well alongside minifying your CSS and JS files.
Note that .htaccess rules only work on Apache and LiteSpeed servers. If your host runs Nginx, these rules do nothing, so use your host’s caching settings or ask them to add expires headers in the server configuration.
My site load times were slow and I needed FixMyWP to help me fix this. When they worked on the site, they learned that my server was the major problem with the slowness … Things are so much better.
Is your WordPress site still slow?
We review what’s slowing your site down, compress images and tune your site so pages load faster. Flat rate of $299, usually done the same day or within 24 business hours.

