{"id":12288,"date":"2023-08-24T23:34:00","date_gmt":"2023-08-24T18:04:00","guid":{"rendered":"https:\/\/www.wpoven.com\/blog\/?p=12288"},"modified":"2023-11-08T13:12:52","modified_gmt":"2023-11-08T07:42:52","slug":"add-expires-headers-wordpress","status":"publish","type":"post","link":"https:\/\/www.wpoven.com\/blog\/add-expires-headers-wordpress\/","title":{"rendered":"How to Add Expires Headers in WordPress? (2 Methods)"},"content":{"rendered":"\n<p class=\"justify\">Are you looking for How to add Expires headers in WordPress? Then you must have run your WordPress site through a speed testing tool that suggests you add Expires headers.<\/p>\n\n\n\n<p class=\"justify\">This means your website struggled with poor loading time and you haven&#8217;t optimized its browser cache yet. Which has the main purpose of helping your website is to tell the visitor&#8217;s browser to store certain files on their computer and load those files whenever the visitor visits the website again, rather than downloading the same file from the server again on each visit. And helps to boost the website speed. <\/p>\n\n\n\n<p class=\"justify\">So, in this post, we will try to cover all the aspects of Expires headers such as What they mean and how they can boost your SEO. After that, we will explain how you can easily add them to your website in a very comprehensive manner.<\/p>\n\n\n\n<p class=\"justify\">But first, let us understand what Expires headers mean.<\/p>\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_98b8a6b2-f986-42e0-b758-fd57e10f66ea\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_8ec0183a-f590-45ce-b700-c2cd71012773\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n<div class=\"wp-block-group fre-pros-box is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<h2 class=\"wp-block-heading myh2\">How to Add Expires Headers in WordPress?<\/h2>\n\n\n\n<p class=\"justify\">Now let us see How can you Add Expires Headers in WordPress using these two different methods. The plugin method is quite easy and highly recommend it if you are a beginner. The manual method is recommended for those who have some technical expertise.<\/p>\n\n\n\n<p class=\"justify\">But if you were a <strong>WPOven<\/strong> client, you do not have to worry about your website loading speed and follow all these extra steps to boost website speed.<\/p>\n\n\n\n<p class=\"justify\"> At <a href=\"https:\/\/www.wpoven.com\" target=\"_blank\" rel=\"noreferrer noopener\">WPOven<\/a> we offer a fully managed Web hosting solution with the fastest dedicated servers that have Worldwide CDN-ready Data centers and cutting-edge security. That means we do not leave any stone unturned to bring you the Fastest and most secure experience ever.<\/p>\n\n\n\n<ul>\n<li><a href=\"#A_Add_Expires_Headers_in_WordPress_using_WordPress_Plugins\" data-type=\"internal\" data-id=\"#A_Add_Expires_Headers_in_WordPress_using_WordPress_Plugins\">Add Expires Headers in WordPress using WordPress Plugins<\/a><\/li>\n\n\n\n<li><a href=\"#B_Add_Expires_Headers_in_WordPress_Manually\" data-type=\"internal\" data-id=\"#B_Add_Expires_Headers_in_WordPress_Manually\">Add Expires Headers in WordPress Manually<\/a><\/li>\n<\/ul>\n<\/div><\/div>\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_3a377d56-17a5-4918-99fa-a4ee69adc405\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n<h2 class=\"wp-block-heading\">A. Add Expires Headers in WordPress using WordPress Plugins<\/h2>\n\n\n\n<p class=\"justify\">Although, there are plenty of WordPress plugins available through which you can easily add Expires Headers in WordPress. But we are going to pick the most suitable one which is Free and has a better user interface.<\/p>\n\n\n\n<p class=\"justify\">Hummingbird and WP Super Cache are some popular plugins that have a huge number of downloads in the WordPress repository.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Hummingbird<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large imgsha round\"><img decoding=\"async\" width=\"1024\" height=\"477\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_6-1-1024x477.png\" alt=\"Humming Bird\" class=\"wp-image-12301\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_6-1-1024x477.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_6-1-300x140.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_6-1-768x357.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_6-1.png 1504w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><figcaption class=\"wp-element-caption\"><em><sup>Humming Bird<\/sup><\/em><\/figcaption><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-2 wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-font-size\" style=\"font-size:16px\"><a class=\"wp-block-button__link has-white-color has-vivid-cyan-blue-background-color has-text-color has-background wp-element-button\" href=\"https:\/\/wordpress.org\/plugins\/hummingbird-performance\/\" style=\"border-radius:6px\" target=\"_blank\" rel=\"nofollow noreferrer noopener\">Download Now<\/a><\/div>\n<\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"justify\">Humming Bird is a website speed optimizer plugin that is available free to use from the WordPress repository and provide a lot of other good caching option.<\/p>\n\n\n\n<p class=\"justify\">It includes some out-of-the-box features like:<\/p>\n\n\n\n<ul class=\"justify\">\n<li>Scan your website completely and point out the errors that are responsible for slowing down website performance.<\/li>\n\n\n\n<li>A complete Caching solution to load pages faster without compromise, Gravatar, and browser cache tool.<\/li>\n\n\n\n<li>Provide Performance reports and tips to optimize your website speed.<\/li>\n\n\n\n<li>Boosts your website speed hence increasing your Conversion rate<\/li>\n\n\n\n<li>Boost SEO and Improve Rankings<\/li>\n\n\n\n<li>Turbo speed HTML, JavaScript, and stylesheet CSS transfer.<\/li>\n\n\n\n<li>Helps with optimization such as CSS, Googe Font Files, combining JavaScript, etc., and many more.<\/li>\n<\/ul>\n\n\n\n<p class=\"justify\">Let us see how you can optimize your website performance by adding Expires Headers in WordPress using Hummingbird Plugin.<\/p>\n\n\n\n<p class=\"justify\">First, you need to install the Hummingbird plugin on your website, and to do so, visit your WordPress website <strong>dashboard &gt; Plugins &gt; Add new<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large imgsha round\"><img decoding=\"async\" width=\"1024\" height=\"459\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_7-2-1024x459.png\" alt=\"Add Expires header in WordPress using hummingbird plugin\" class=\"wp-image-12302\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_7-2-1024x459.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_7-2-300x135.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_7-2-768x345.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_7-2-1536x689.png 1536w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_7-2.png 1890w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><figcaption class=\"wp-element-caption\"><em><sup>Add Expires header in WordPress using the Humming Bird plugin<\/sup><\/em><\/figcaption><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"justify\">Type &#8220;<strong>Hummingbird<\/strong>&#8221; in the search bar. Once done, the plugin will appear as shown above. Click on the Install Now button and proceed by clicking on the Activate button. After successfully activating the plugin, you will find it listed in the WordPress dashboard menu. Click on it and select Caching as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large imgsha round\"><img decoding=\"async\" width=\"1024\" height=\"462\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_8-2-1024x462.png\" alt=\"Add Expires header in WordPress using hummingbird plugin\" class=\"wp-image-12303\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_8-2-1024x462.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_8-2-300x135.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_8-2-768x347.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_8-2-1536x693.png 1536w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_8-2.png 1846w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><figcaption class=\"wp-element-caption\"><em><sup>Add Expires header in WordPress using the Hummingbird plugin<\/sup><\/em><\/figcaption><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"justify\">Once you reach the caching page of the plugin, you will see 6 options. You need to click on Browser Caching and proceed further. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large imgsha round\"><img decoding=\"async\" width=\"1024\" height=\"470\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_10-1-1024x470.png\" alt=\"Add Expires header in WordPress using hummingbird plugin\" class=\"wp-image-12306\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_10-1-1024x470.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_10-1-300x138.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_10-1-768x352.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_10-1-1536x705.png 1536w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_10-1.png 1857w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><figcaption class=\"wp-element-caption\"><em><sup>Add Expires header in WordPress using the Hummingbird plugin<\/sup><\/em><\/figcaption><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"justify\">At the top of it, you can check the status. And when you scroll a little down, you will find a configure option, click on it, and start configuring your Browser caching.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large imgsha round\"><img decoding=\"async\" width=\"1024\" height=\"468\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_11-1-1024x468.png\" alt=\"Add Expires header in WordPress using hummingbird plugin\" class=\"wp-image-12307\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_11-1-1024x468.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_11-1-300x137.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_11-1-768x351.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_11-1-1536x702.png 1536w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_11-1.png 1884w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><figcaption class=\"wp-element-caption\"><em><sup>Add Expires header in WordPress using the Hummingbird plugin<\/sup><\/em><\/figcaption><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"justify\">Now on the Browser Caching configuration page, you will be asked to choose Server Type. Select a Server type, Apache, NGNIX, IIS or OpenLiteSpeed proceeded by clicking on the <strong>Next<\/strong> button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large imgsha round\"><img decoding=\"async\" width=\"1024\" height=\"461\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_12-1-1024x461.png\" alt=\"Add Expires header in WordPress using hummingbird plugin\" class=\"wp-image-12308\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_12-1-1024x461.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_12-1-300x135.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_12-1-768x346.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_12-1-1536x692.png 1536w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_12-1.png 1883w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><figcaption class=\"wp-element-caption\"><em><sup>Add Expires header in WordPress using the Hummingbird plugin<\/sup><\/em><\/figcaption><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"justify\">In the next step, you will be required to set an Expiry time for either All file types or Individual file types. After that click on the next button to go further to the next step. In which a generated code will display and you will be required to copy and <\/p>\n\n\n\n<figure class=\"wp-block-image size-large imgsha round\"><img decoding=\"async\" width=\"1024\" height=\"532\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_13-2-1024x532.png\" alt=\"Add Expires header in WordPress using hummingbird plugin\" class=\"wp-image-12309\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_13-2-1024x532.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_13-2-300x156.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_13-2-768x399.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_13-2-1536x798.png 1536w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_13-2.png 1655w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><figcaption class=\"wp-element-caption\"><em><sup>Add Expires header in WordPress using the Hummingbird plugin<\/sup><\/em><\/figcaption><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"justify\">Add the code to the HTTP or inside the server section in the file. When you are done, reload and restart NGINX.<\/p>\n\n\n\n<p class=\"justify\">Another Plugin that you can try is WP Rocket let us check How it can help you to Add Expires Headers in WordPress.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. WP rocket<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large imgsha rround\"><img decoding=\"async\" width=\"1024\" height=\"482\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_14-1-1024x482.png\" alt=\"Add Expires header in WordPress using WProcket plugin\" class=\"wp-image-12310\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_14-1-1024x482.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_14-1-300x141.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_14-1-768x362.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_14-1-1536x724.png 1536w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_14-1.png 1868w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><figcaption class=\"wp-element-caption\"><em><sup>Add Expires header in WordPress using the WP Rocket plugin<\/sup><\/em><\/figcaption><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-3 wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-font-size\" style=\"font-size:16px\"><a class=\"wp-block-button__link has-white-color has-vivid-cyan-blue-background-color has-text-color has-background wp-element-button\" href=\"https:\/\/wp-rocket.me\/\" style=\"border-radius:6px\" target=\"_blank\" rel=\"nofollow noreferrer noopener\">View Website<\/a><\/div>\n<\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"justify\">If you won&#8217;t find Hummingbird easy, you can try another popular caching plugin WP-rocket. As soon as you install and activate this plugin, it automatically starts browser caching without following any further steps and configuring settings.<\/p>\n\n\n\n<p class=\"justify\">But to use this plugin, you need to buy their yearly plans starting from $49 to $249 per year. However, if your budget doesn&#8217;t allow you to use this plugin, you can always go for the alternate option (hummingbird) that we have already mentioned, and it&#8217;s Free. <\/p>\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_7c8afc5f-1417-42f4-afa6-e8f9af2d22a3\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n<h2 class=\"wp-block-heading\">B. Add Expires Headers in WordPress Manually<\/h2>\n\n\n\n<p class=\"justify\">If you have the technical expertise and know-how to manage and handle WordPress files, you can always go for the manual method. This method to add Expires Headers in WordPress mainly involves adding certain codes to your .htaccess file. <\/p>\n\n\n\n<p class=\"justify\">Since we have already mentioned that this method is best suitable for only those users who have expertise in WordPress files, beginners must refrain from using this method because in case any mistake happens in codes, the whole site can get completely damaged or broken.<\/p>\n\n\n\n<p class=\"justify\">Hence, it is highly recommended that you make a complete WordPress backup before proceeding to further steps. You can also check out our detailed article on &#8220;<a href=\"https:\/\/www.wpoven.com\/blog\/backup-wordpress-site\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Backup WordPress site in 5 min?<\/a>&#8221; for your guidance.<\/p>\n\n\n\n<p class=\"justify\">But before proceeding on the main steps, the first thing you need to do is to determine your website server, whether it is Apache or NGINX.<\/p>\n\n\n\n<p class=\"justify\">To do so, one of the simplest and easiest methods you can try is to <strong>open your website on any browser &gt; Right-click on the page &gt; Select Inspect element option<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large imgsha round\"><img decoding=\"async\" width=\"545\" height=\"528\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_4-4.png\" alt=\"Website Inspect on Incognito Mode\" class=\"wp-image-12315\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_4-4.png 545w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_4-4-300x291.png 300w\" sizes=\"(max-width: 545px) 100vw, 545px\" title=\"\"><figcaption class=\"wp-element-caption\"><em><sup>Website Inspect on Incognito Mode<\/sup><\/em><\/figcaption><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"justify\">After that, you need to click on the Network Tab as shown in the picture below. In some cases, you will be required to reload the page to load the results.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large imgsha round\"><img decoding=\"async\" width=\"1024\" height=\"404\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_1-3-1024x404.png\" alt=\"Website Inspect on Incognito Mode\" class=\"wp-image-12314\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_1-3-1024x404.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_1-3-300x118.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_1-3-768x303.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_1-3.png 1246w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><figcaption class=\"wp-element-caption\"><em><sup>Website Inspect on Incognito Mode<\/sup><\/em><\/figcaption><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"justify\">When the results get loaded, the next step you need to do is to click on your domain name or any link that is related to your domain under the name column as shown in Step 2 (See picture above). After that, you can scroll down in the Headers column as shown in Step 3, and check out your server.<\/p>\n\n\n\n<p class=\"justify\">However, tools like GTmetrix can also let you know what type of server your website is running on, under the Header section as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large imgsha round\"><img decoding=\"async\" width=\"1024\" height=\"727\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_5-4-1024x727.png\" alt=\"Website Inspect on Incognito Mode\" class=\"wp-image-12316\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_5-4-1024x727.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_5-4-300x213.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_5-4-768x545.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_5-4.png 1352w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><figcaption class=\"wp-element-caption\"><em><sup>Website Inspect on Incognito Mode<\/sup><\/em><\/figcaption><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"justify\">Now you have successfully been able to determine which web server your website is using. Let us see how you can add Expires headers in WordPress on both types of web servers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Add Expires Headers in WordPress (Apache)<\/h3>\n\n\n\n<p class=\"justify\">If your WordPress site is on an Apache server, then you need to add expired headers in the WordPress <strong>.htaccess <\/strong>file. Which you will find in the root folder of your web server. Let us check out the steps you need to follow:<\/p>\n\n\n\n<p class=\"justify\"><strong>Step 1:<\/strong> To get access and edit this file, you need to either use the<strong> cPanel<\/strong> provided by your web hosting provider or connect your hosting account with an FTP client (FileZilla).<\/p>\n\n\n\n<p class=\"justify\"><strong>Step 2:<\/strong> When you can access your root folder, locate the<strong> .htaccess<\/strong> file.<\/p>\n\n\n\n<p class=\"justify\"><strong>Step 3:<\/strong> Download a backup copy of the .htaccess file so that, if anything goes south, you can upload the backup file again and resolve the issue ASAP.<\/p>\n\n\n\n<p class=\"justify\"><strong>Step 4: <\/strong>Now, you need to add Expires Headers to your browser caching.<\/p>\n\n\n\n<p class=\"round has-background\" style=\"background-color:#f0f0f0\"><code><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">EXPIRES HEADER CACHING ##<\/mark><br>&lt;IfModule mod_expires.c&gt;<br>ExpiresActive On<br>ExpiresByType image\/jpg \"access 1 year\"<br>ExpiresByType image\/jpeg \"access 1 year\"<br>ExpiresByType image\/gif \"access 1 year\"<br>ExpiresByType image\/png \"access 1 year\"<br>ExpiresByType image\/svg \"access 1 year\"<br>ExpiresByType text\/css \"access 1 month\"<br>ExpiresByType application\/pdf \"access 1 month\"<br>ExpiresByType application\/javascript \"access 1 month\"<br>ExpiresByType application\/x-javascript \"access 1 month\"<br>ExpiresByType application\/x-shockwave-flash \"access 1 month\"<br>ExpiresByType image\/x-icon \"access 1 year\" <br>ExpiresDefault \"access 4 days\"<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">## EXPIRES HEADER CACHING<\/mark><\/strong><\/code><\/p>\n\n\n\n<p class=\"justify\">The values mentioned in the code snippet will work for most of the websites, but you are free to make changes or make certain adjustments in time values for different file types. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Add Expires Headers in WordPress (NGINX)<\/h3>\n\n\n\n<p class=\"justify\">If your website users an NGINX server, then you need to add access to your server configuration file and add expired headers to it. However how to access and edit these files can vary from host to host, so you should contact your hosting provider for assistance.<\/p>\n\n\n\n<p class=\"justify\">After that, you will need to add the following Expires Headers code in your web server configuration file:<\/p>\n\n\n\n<p class=\"round has-background\" style=\"background-color:#f0f0f0\"><code>location ~* .(jpg|jpeg|gif|png|svg)$ {<br>expires 365d;<br>}<br>location ~* .(pdf|css|html|js|swf)$ {<br>expires 4d;<br>}<\/code><\/p>\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_6cbb41d8-4453-4e20-84d6-a0c0101ed0ca\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n<p class=\"justify round has-background\" style=\"background-color:#fff6dd\"><strong>Note:<\/strong> You can change the expired values as per your requirement or file type. You must have noticed images has longer expiration time because they stay the same for a longer period than typical HTML, CSS, JS, and other file types. <\/p>\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_7b3a96d8-3c53-4538-a19c-63981f2f7fdc\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n<h3 class=\"wp-block-heading\">3. Add Expires Headers in WordPress (CDN systems)<\/h3>\n\n\n\n<p class=\"justify\">If you are using CDN systems such as Cloudflare to deliver content, then you will be required to use different expiration dates for your resources. However, the best alternative to avoid this is by unsettling your ETags from the CDN server. <\/p>\n\n\n\n<p class=\"justify\">To do this, you need to add the following code snippet in your .htaccess file.<\/p>\n\n\n\n<p class=\"round has-background\" style=\"background-color:#f0f0f0\"><code>#Disable ETags<br>&lt;IfModule mod_headers.c&gt;<br>Header unset ETag<br>&lt;\/IfModule&gt;<br>FileETag None<\/code><\/p>\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_1b5af3ec-c85d-4b93-9dc4-5b950d6cc772\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-group tip is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<h2 class=\"wp-block-heading myh2\">What are Expires headers?<\/h2>\n\n\n\n<p class=\"justify\">Expired headers are HTTP headers whose main purpose is to tell your visitor&#8217;s website browser whether it should load resources from the browser cache or it should load new resources from the web server.<\/p>\n\n\n\n<p class=\"justify\">Due to this, it helps to increase your website speed by loading the elements from the local browser cache rather than downloading them from the server.<\/p>\n\n\n\n<p class=\"justify\">To make this happen, you need to Add Expires Headers in your WordPress site, and after that, the web browser will start browser caching for a certain period that you have already set up in Expires headers.<\/p>\n\n\n\n<p class=\"justify\">Let us understand it with an example, suppose you have implemented Expires headers on JPEG files for one month. This means your visitor&#8217;s browser will load the resources from already stored browser caching for one month. After the one-month duration, the visitor&#8217;s browsers will start loading newer versions of resources from the server. <\/p>\n\n\n\n<p class=\"justify\">Similarly, you add different expire headers for different types of files and reduce a significant amount of HTTP requests, which overall helps to ramp up your website speed. <\/p>\n<\/div><\/div>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_76f65ce4-f52b-4f48-b31d-d65b6ee3a453\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n<h2 class=\"wp-block-heading\">How You can Check Expires Headers on your Website?<\/h2>\n\n\n\n<p class=\"justify\">There are many online tools available such as through which you can check out your website performance and analyze their core web vitals. Some of the best tools to run speed tests are <a href=\"https:\/\/www.bitcatcha.com\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Website speed checker by Bitcatcha<\/a> and another popular tool is GTmetrix. These tools provide you results in the form of Grades, scores, and Warnings about some issues your website might face.<\/p>\n\n\n\n<p class=\"justify\">Similarly, through this tool, you can also check Expires Headers on your website and if found missing, you can add them later.<\/p>\n\n\n\n<p class=\"justify\">To do so, first, go to the <a href=\"https:\/\/gtmetrix.com\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">GTmetrix<\/a> website, and enter your website URL as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large imgsha round\"><img decoding=\"async\" width=\"1024\" height=\"492\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_1-2-1024x492.png\" alt=\"Check Expires header in Gtmetrix\" class=\"wp-image-12295\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_1-2-1024x492.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_1-2-300x144.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_1-2-768x369.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_1-2-1536x738.png 1536w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_1-2.png 1900w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><figcaption class=\"wp-element-caption\"><em><sup>Check Expires header in Gtmetrix<\/sup><\/em><\/figcaption><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-5 wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-font-size\" style=\"font-size:16px\"><a class=\"wp-block-button__link has-white-color has-vivid-cyan-blue-background-color has-text-color has-background wp-element-button\" href=\"https:\/\/gtmetrix.com\/\" style=\"border-radius:6px\" target=\"_blank\" rel=\"nofollow noreferrer noopener\">Check Your Website<\/a><\/div>\n<\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"justify\">When you click on Test your site button, it will take some time to analyze your website vitals and show you a complete result as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large imgsha round\"><img decoding=\"async\" width=\"1024\" height=\"691\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_4-3-1024x691.png\" alt=\"GTmetrix Performance report of a website\" class=\"wp-image-12296\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_4-3-1024x691.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_4-3-300x202.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_4-3-768x518.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_4-3.png 1223w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><figcaption class=\"wp-element-caption\"><em><sup>GTmetrix Performance report of a website<\/sup><\/em><\/figcaption><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"justify\">Now to check, Expires Headers on the WordPress site, click on the Waterfall tab &gt; Headers tab and check out the results as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large imgsha round\"><img decoding=\"async\" width=\"1024\" height=\"687\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_5-3-1024x687-1.png\" alt=\"GTmetrix Performance report of a website\" class=\"wp-image-12313\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_5-3-1024x687-1.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_5-3-1024x687-1-300x201.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/03\/Screenshot_5-3-1024x687-1-768x515.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><figcaption class=\"wp-element-caption\"><em><sup>GTmetrix Performance report of a website<\/sup><\/em><\/figcaption><\/figure>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_fe1edd08-7f04-4488-8f8c-9205cbe84f85\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p class=\"justify\">To Summarize the whole post, Adding Expires Headers in WordPress provides you control over Browser caching behavior to some extent. And helps to enhance overall your website loading speed. Even though this method will not make a remarkable change in your website speed, this technique has shown great improvement in user experience. <\/p>\n\n\n\n<p class=\"justify\">In addition to it, any user needs to know how to add Expires headers in the WordPress site correctly. Because if you do it incorrectly the consequences can be harmful to your website and instead of boosting up the speed of the website it will slow your website down.<\/p>\n\n\n\n<p class=\"justify\">Moreover, if you have any more suggestions or valuable points to add to this post that we have missed mention, please do let us know in the comment section below:<\/p>\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_06abd35f-22de-4bea-8b36-81721495d8d4\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions<\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block justify\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1647077695841\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>How do you fix and add expired headers?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>You can fix expired headers by using three different methods:<br \/>1. Using a Caching WordPress plugin i.e. Hummingbird or WProcket.<br \/>2. By accessing yours.Htaccess file and add the code snippet to it.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1647077778427\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>What are expired headers in WordPress?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Expired headers are HTTP headers whose main purpose is to tell your visitor&#8217;s website browser whether it should load resources from the browser cache or it should load new resources from the web server. Due to this, it helps to increase your website speed by loading the elements from the local browser cache rather than downloading them from the server.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1647077849267\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>How do I add expired headers in cPanel?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>To add expired headers in cPanel follow these simple steps:<br \/>1. log in to your website&#8217;s cPanel.<br \/>2. Navigate through the File section and Select the File Manager icon.<br \/>3. Go to the public_html folder and open it.<br \/>4. Navigate through the .htaccess file and download a backup copy first.<br \/>5. Now right-click on the .htaccess file for options.<br \/>6. Click on the Edit option, add the code snippet, and save it.  <\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_3991672f-4aee-4431-9db5-1b75b248ce52\"><hr class=\"ub_divider\" ><\/hr><\/div>","protected":false},"excerpt":{"rendered":"<p>Are you looking for How to add Expires headers in WordPress? Then you must have run your WordPress site through a speed testing tool that suggests you add Expires headers.<\/p>\n<p>This means your website struggled with poor loading time and you haven&#8217;t optimized its browser cache yet. Which has the main purpose of helping your website is to tell the visitor&#8217;s browser to store certain files on their computer and load those files whenever the visitor visits the website again, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.wpoven.com\/blog\/add-expires-headers-wordpress\/\" class=\"more-link\">Read More <i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/i><span class=\"screen-reader-text\"> &#8220;How to Add Expires Headers in WordPress? (2 Methods)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":28,"featured_media":22166,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ub_ctt_via":"","footnotes":""},"categories":[1],"acf":[],"featured_image_src":"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/05\/Add-Expires-Headers.png","author_info":{"display_name":"Rahul","author_link":"https:\/\/www.wpoven.com\/blog\/author\/rahul\/"},"_links":{"self":[{"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/posts\/12288"}],"collection":[{"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/comments?post=12288"}],"version-history":[{"count":2,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/posts\/12288\/revisions"}],"predecessor-version":[{"id":23935,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/posts\/12288\/revisions\/23935"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/media\/22166"}],"wp:attachment":[{"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/media?parent=12288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/categories?post=12288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}