{"id":41927,"date":"2014-11-26T14:44:51","date_gmt":"2014-11-26T09:14:51","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=41927"},"modified":"2026-10-06T15:22:35","modified_gmt":"2026-10-06T09:52:35","slug":"http-410-error-pages-htaccess","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2014\/11\/http-410-error-pages-htaccess\/","title":{"rendered":"How to Set Up 410 Gone with .htaccess (Plus Nginx &#038; WordPress): 410 vs 404 Explained"},"content":{"rendered":"<p>Deleted some pages for good and want Google to drop them from search quickly? Send a <strong>410 Gone<\/strong> status code instead of a plain 404. A 410 tells browsers and search engines the page has been removed on purpose and isn&#8217;t coming back. Here&#8217;s how to set up 410 Gone with .htaccess on Apache, plus Nginx and WordPress, and when 410 is better than 404.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-59107\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-error-1024x576.png\" alt=\"410 Gone error code\" width=\"760\" height=\"428\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-error-1024x576.png 1024w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-error-300x169.png 300w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-error-150x84.png 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-error-768x432.png 768w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-error.png 1280w\" sizes=\"(max-width: 760px) 100vw, 760px\" \/><\/p>\n<p><strong>Quick answer:<\/strong> On Apache, add <code>Redirect gone \/old-page\/<\/code> to your <code>.htaccess<\/code> file. On Nginx, use <code>return 410;<\/code> inside a matching <code>location<\/code> block. On WordPress, Rank Math and the Redirection plugin can return a 410 without touching any server files.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_90 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6afea05788e82\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #1a202c;color:#1a202c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #1a202c;color:#1a202c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6afea05788e82\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2014\/11\/http-410-error-pages-htaccess\/#What_is_a_410_Gone_error\" >What is a 410 Gone error?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2014\/11\/http-410-error-pages-htaccess\/#410_Gone_vs_404_Not_Found_which_should_you_use\" >410 Gone vs 404 Not Found: which should you use?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2014\/11\/http-410-error-pages-htaccess\/#How_to_set_up_410_Gone_with_htaccess_Apache\" >How to set up 410 Gone with .htaccess (Apache)<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2014\/11\/http-410-error-pages-htaccess\/#Single_page_or_folder\" >Single page or folder<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2014\/11\/http-410-error-pages-htaccess\/#Pattern_of_URLs_mod_rewrite\" >Pattern of URLs (mod_rewrite)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2014\/11\/http-410-error-pages-htaccess\/#How_to_return_410_on_Nginx\" >How to return 410 on Nginx<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2014\/11\/http-410-error-pages-htaccess\/#How_to_set_up_410_in_WordPress_no_code\" >How to set up 410 in WordPress (no code)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2014\/11\/http-410-error-pages-htaccess\/#How_we_used_410_errors_to_clean_up_after_a_penalty\" >How we used 410 errors to clean up after a penalty<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2014\/11\/http-410-error-pages-htaccess\/#How_to_check_a_page_returns_410\" >How to check a page returns 410<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2014\/11\/http-410-error-pages-htaccess\/#Frequently_asked_questions\" >Frequently asked questions<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2014\/11\/http-410-error-pages-htaccess\/#Is_a_410_error_bad_for_SEO\" >Is a 410 error bad for SEO?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2014\/11\/http-410-error-pages-htaccess\/#How_long_does_Google_take_to_remove_a_410_page\" >How long does Google take to remove a 410 page?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2014\/11\/http-410-error-pages-htaccess\/#Should_I_use_410_or_301_for_deleted_posts\" >Should I use 410 or 301 for deleted posts?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"What_is_a_410_Gone_error\"><\/span>What is a 410 Gone error?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><strong>HTTP 410 Gone<\/strong> is a server response that says the page existed but has been <strong>permanently removed<\/strong>, with no forwarding address. It&#8217;s different from the far more common <strong>404 Not Found<\/strong>, which just means the server can&#8217;t find the page right now. That could be a typo, a broken link or a temporary problem.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"410_Gone_vs_404_Not_Found_which_should_you_use\"><\/span>410 Gone vs 404 Not Found: which should you use?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<table>\n<thead>\n<tr>\n<th><\/th>\n<th>404 Not Found<\/th>\n<th>410 Gone<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Meaning<\/td>\n<td>Page not found (reason unknown)<\/td>\n<td>Page deliberately and permanently removed<\/td>\n<\/tr>\n<tr>\n<td>Google&#8217;s handling<\/td>\n<td>Dropped from the index after a short grace period<\/td>\n<td>Dropped slightly faster<\/td>\n<\/tr>\n<tr>\n<td>Recrawling<\/td>\n<td>Google rechecks occasionally<\/td>\n<td>Google also rechecks occasionally, but less often over time<\/td>\n<\/tr>\n<tr>\n<td>Best for<\/td>\n<td>Pages that might come back, or accidental errors<\/td>\n<td>Content you&#8217;ve deleted for good<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-42018\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-404-error.png\" alt=\"410 vs 404 error\" width=\"248\" height=\"197\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-404-error.png 248w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-404-error-150x119.png 150w\" sizes=\"(max-width: 248px) 100vw, 248px\" \/><\/p>\n<p>Google has long said it treats 404 and 410 almost the same. Former Google spam lead <a href=\"https:\/\/searchengineland.com\/googles-matt-cutts-explains-differences-404-410-status-codes-189060\" target=\"_blank\" rel=\"noopener\">Matt Cutts explained<\/a> the one real difference: a 404 page gets about a day&#8217;s &#8220;protection&#8221; in case it was a mistake, while a 410 is treated as removed immediately. Either way, Google keeps checking the URL now and then, sometimes for years, in case the page returns.<\/p>\n<p><strong>Rule of thumb:<\/strong> if you deleted thin or outdated content on purpose and there&#8217;s no better page to send visitors to, use 410. If there&#8217;s a relevant replacement page, use a <strong>301 redirect<\/strong> instead, so visitors and any backlinks go somewhere useful.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_set_up_410_Gone_with_htaccess_Apache\"><\/span>How to set up 410 Gone with .htaccess (Apache)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Always back up your <code>.htaccess<\/code> file before editing. A single typo can take your site offline.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Single_page_or_folder\"><\/span>Single page or folder<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code>Redirect gone \/old-page\/\r\nRedirect gone \/old-folder\/\r\nErrorDocument 410 default<\/code><\/pre>\n<p>Use the path only (starting with <code>\/<\/code>), not the full <code>https:\/\/<\/code> URL. <code>ErrorDocument 410 default<\/code> makes Apache show its standard 410 page.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Pattern_of_URLs_mod_rewrite\"><\/span>Pattern of URLs (mod_rewrite)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To return 410 for many URLs that match a pattern, use the <code>[G]<\/code> (gone) flag:<\/p>\n<pre><code>RewriteEngine On\r\nRewriteRule ^old-section\/ - [G,L]\r\nRewriteRule ^tag\/old-tag\/?$ - [G,L]<\/code><\/pre>\n<p>Place these rules <strong>above<\/strong> the WordPress rewrite block (the lines between <code># BEGIN WordPress<\/code> and <code># END WordPress<\/code>) so they run first.<\/p>\n<p>After saving, visit the URL. You should see the server&#8217;s 410 page:<\/p>\n<p><img decoding=\"async\" class=\"border aligncenter wp-image-42010 size-full\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-gone-error.png\" alt=\"410 Gone error page\" width=\"434\" height=\"139\" border=\"1\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-gone-error.png 434w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-gone-error-150x48.png 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-gone-error-300x96.png 300w\" sizes=\"(max-width: 434px) 100vw, 434px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_return_410_on_Nginx\"><\/span>How to return 410 on Nginx<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Nginx doesn&#8217;t use .htaccess. Add a rule to your server block and reload Nginx:<\/p>\n<pre><code>location = \/old-page\/ {\r\n    return 410;\r\n}\r\nlocation ^~ \/old-section\/ {\r\n    return 410;\r\n}<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"How_to_set_up_410_in_WordPress_no_code\"><\/span>How to set up 410 in WordPress (no code)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Rank Math:<\/strong> go to <strong>Rank Math \u2192 Redirections \u2192 Add New<\/strong>, enter the old URL, and choose <strong>410 Content Deleted<\/strong> as the redirection type (see <a href=\"https:\/\/rankmath.com\/kb\/redirect-types\/\" target=\"_blank\" rel=\"noopener\">Rank Math&#8217;s guide<\/a>).<\/li>\n<li><strong>Redirection plugin:<\/strong> add a new redirect, set the action to &#8220;Error (404)&#8221; and choose the <strong>410 \u2013 Gone<\/strong> HTTP code.<\/li>\n<\/ul>\n<p>This is handy when you prune old, low-quality posts. Delete or unpublish the post, then add a 410 for its URL so search engines drop it quickly.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_we_used_410_errors_to_clean_up_after_a_penalty\"><\/span>How we used 410 errors to clean up after a penalty<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Years ago, footer links in WordPress themes we&#8217;d made led to a Penguin penalty on this site. We <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/09\/removed-million-backlinks\/\">removed 1.7 million backlinks<\/a>, first by forcing 404 errors and then by 301-redirecting the old theme pages to another domain.<\/p>\n<p>But the old pages stubbornly stayed in Google&#8217;s index, even after removal requests in Webmaster Tools:<\/p>\n<p><img decoding=\"async\" class=\"border aligncenter wp-image-42009 size-full\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/persisting-theme-links.png\" alt=\"Persisting theme links in Google results\" width=\"448\" height=\"186\" border=\"1\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/persisting-theme-links.png 448w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/persisting-theme-links-150x62.png 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/persisting-theme-links-300x124.png 300w\" sizes=\"(max-width: 448px) 100vw, 448px\" \/><\/p>\n<p>Once we switched those URLs to <strong>410 Gone<\/strong>, they finally disappeared from the search results. Because we never intended to bring them back, and <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/06\/delete-urls-with-bad-backlinks-to-remove-google-penalty\/\">backlinks to deleted URLs don&#8217;t count<\/a> towards a penalty, 410 was exactly the right signal.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_check_a_page_returns_410\"><\/span>How to check a page returns 410<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Use Google Search Console&#8217;s <strong>URL Inspection<\/strong> tool, which shows the status code Google sees.<\/li>\n<li>Use a free HTTP status checker, or run <code>curl -I https:\/\/yoursite.com\/old-page\/<\/code> and look for <code>HTTP\/1.1 410 Gone<\/code>.<\/li>\n<li>If you use a CDN or caching plugin (like LiteSpeed or Cloudflare), purge the cache after adding the rule.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Frequently_asked_questions\"><\/span>Frequently asked questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Is_a_410_error_bad_for_SEO\"><\/span>Is a 410 error bad for SEO?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>No. Returning 410 for content you&#8217;ve deliberately removed is correct and doesn&#8217;t hurt the rest of your site. Just make sure you aren&#8217;t returning 410 for pages that should still exist.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_long_does_Google_take_to_remove_a_410_page\"><\/span>How long does Google take to remove a 410 page?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Usually within days of Googlebot&#8217;s next visit. You can speed it up with the Removals tool in Search Console for urgent cases.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Should_I_use_410_or_301_for_deleted_posts\"><\/span>Should I use 410 or 301 for deleted posts?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Use 301 if there&#8217;s a closely related page that replaces it, so visitors and link value carry over. Use 410 if there&#8217;s nothing equivalent to send people to.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Deleted some pages for good and want Google to drop them from search quickly? Send a 410 Gone status code&#8230;<\/p>\n","protected":false},"author":4,"featured_media":59107,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"default","_kad_post_title":"default","_kad_post_layout":"default","_kad_post_sidebar_id":"","_kad_post_content_style":"default","_kad_post_vertical_padding":"default","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6,41],"tags":[49],"class_list":["post-41927","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","category-search-engine-optimization","tag-tutorials"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/41927","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=41927"}],"version-history":[{"count":1,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/41927\/revisions"}],"predecessor-version":[{"id":63242,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/41927\/revisions\/63242"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/59107"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=41927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=41927"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=41927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}