How to Set Up 410 Gone with .htaccess (Plus Nginx & WordPress): 410 vs 404 Explained
Deleted some pages for good and want Google to drop them from search quickly? Send a 410 Gone status code instead of a plain 404. A 410 tells browsers and search engines the page has been removed on purpose and isn’t coming back. Here’s how to set up 410 Gone with .htaccess on Apache, plus Nginx and WordPress, and when 410 is better than 404.

Quick answer: On Apache, add Redirect gone /old-page/ to your .htaccess file. On Nginx, use return 410; inside a matching location block. On WordPress, Rank Math and the Redirection plugin can return a 410 without touching any server files.
Table of Contents
What is a 410 Gone error?
HTTP 410 Gone is a server response that says the page existed but has been permanently removed, with no forwarding address. It’s different from the far more common 404 Not Found, which just means the server can’t find the page right now. That could be a typo, a broken link or a temporary problem.
410 Gone vs 404 Not Found: which should you use?
| 404 Not Found | 410 Gone | |
|---|---|---|
| Meaning | Page not found (reason unknown) | Page deliberately and permanently removed |
| Google’s handling | Dropped from the index after a short grace period | Dropped slightly faster |
| Recrawling | Google rechecks occasionally | Google also rechecks occasionally, but less often over time |
| Best for | Pages that might come back, or accidental errors | Content you’ve deleted for good |

Google has long said it treats 404 and 410 almost the same. Former Google spam lead Matt Cutts explained (external site) the one real difference: a 404 page gets about a day’s “protection” 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.
Rule of thumb: if you deleted thin or outdated content on purpose and there’s no better page to send visitors to, use 410. If there’s a relevant replacement page, use a 301 redirect instead, so visitors and any backlinks go somewhere useful.
How to set up 410 Gone with .htaccess (Apache)
Always back up your .htaccess file before editing. A single typo can take your site offline.
Single page or folder
Redirect gone /old-page/
Redirect gone /old-folder/
ErrorDocument 410 defaultUse the path only (starting with /), not the full https:// URL. ErrorDocument 410 default makes Apache show its standard 410 page.
Pattern of URLs (mod_rewrite)
To return 410 for many URLs that match a pattern, use the [G] (gone) flag:
RewriteEngine On
RewriteRule ^old-section/ - [G,L]
RewriteRule ^tag/old-tag/?$ - [G,L]Place these rules above the WordPress rewrite block (the lines between # BEGIN WordPress and # END WordPress) so they run first.
After saving, visit the URL. You should see the server’s 410 page:

How to return 410 on Nginx
Nginx doesn’t use .htaccess. Add a rule to your server block and reload Nginx:
location = /old-page/ {
return 410;
}
location ^~ /old-section/ {
return 410;
}How to set up 410 in WordPress (no code)
- Rank Math: go to Rank Math → Redirections → Add New, enter the old URL, and choose 410 Content Deleted as the redirection type (see Rank Math’s guide (external site)).
- Redirection plugin: add a new redirect, set the action to “Error (404)” and choose the 410 – Gone HTTP code.
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.
How we used 410 errors to clean up after a penalty
Years ago, footer links in WordPress themes we’d made led to a Penguin penalty on this site. We removed 1.7 million backlinks, first by forcing 404 errors and then by 301-redirecting the old theme pages to another domain.
But the old pages stubbornly stayed in Google’s index, even after removal requests in Webmaster Tools:

Once we switched those URLs to 410 Gone, they finally disappeared from the search results. Because we never intended to bring them back, and backlinks to deleted URLs don’t count towards a penalty, 410 was exactly the right signal.
How to check a page returns 410
- Use Google Search Console’s URL Inspection tool, which shows the status code Google sees.
- Use a free HTTP status checker, or run
curl -I https://yoursite.com/old-page/and look forHTTP/1.1 410 Gone. - If you use a CDN or caching plugin (like LiteSpeed or Cloudflare), purge the cache after adding the rule.
Frequently asked questions
Is a 410 error bad for SEO?
No. Returning 410 for content you’ve deliberately removed is correct and doesn’t hurt the rest of your site. Just make sure you aren’t returning 410 for pages that should still exist.
How long does Google take to remove a 410 page?
Usually within days of Googlebot’s next visit. You can speed it up with the Removals tool in Search Console for urgent cases.
Should I use 410 or 301 for deleted posts?
Use 301 if there’s a closely related page that replaces it, so visitors and link value carry over. Use 410 if there’s nothing equivalent to send people to.

$4.99Free when you subscribe
Get 100 tech terms explained in plain English
8-page PDF on AI, coding, slang and SEO + one tech email a week.
Sent by email. Unsubscribe anytime. See our privacy policy.







I would like to do this on my WordPress blog but I’m having difficulty finding the path of my specific page to enter into the “Redirect Gone” values. You mentioned that you can’t use a URL but since WordPress creates pages dynamically there is no single HTML page to use from within cPanel.
I’m using Elementor Page Builder and Ocean Twenty theme if that makes a difference.
How do I navigate to the correct page from within server cPanel?
Also, do I need to create a 410 landing page in PHP?
Is it possible to setup for error 410 on blogger?
Not possible to setup 410 on Blogger
Glad that you shared this article with us. I was completely unaware of this. I will setup HTTP 410 Gone Error Status Code with .htaccess Redirects on my blog.
Previously I was not aware of this. Thanks for sharing the great info.
I will have a try
What is the different 404 and 301 error. Thanks
Got familiar with 410 error Pages includes 404 after reading this post .. thank you
Previously I was not aware of this. Thanks for sharing the great info.
I will have a try !
Is it possible to setup for error 410 on blogger?
Was unaware of 410 error pages until now. Thanks for sharing this, learned something new today.
Got familiar with 410 error Pages includes 404 after reading this post .. thank you
What is the different 404 and 410 error. Thanks