How to Remove a 301 Redirect and Clear It From Every Cache
Removing a 301 redirect looks like a one-line job, but a permanent redirect is designed to be remembered. Browsers store it, page caches and CDNs can keep serving it, and search engines treat the destination as the main URL until they see otherwise. So you delete the rule, reload the page and it still redirects. This guide shows you how to find every layer that holds the redirect, from .htaccess and nginx to WordPress plugins and Cloudflare, delete it at the source, purge each cache you control, reduce the effect on visitors' browsers that you cannot reach, and get the old URL back into search results.
Why a 301 is hard to take back
A 301 status says a page has moved permanently. Every system that sees it is entitled to believe that, and many of them remember it. Removing the rule on your server only changes what the server says from now on. It does not reach the copies already stored elsewhere:
- Browsers. A 301 is cacheable by default under the HTTP standard. Chrome, Edge, Firefox and Safari all store it, and if the response had no caching headers they may keep reusing it without asking your server again, often until the cache is cleared.
- Page caches. WordPress caching plugins, LiteSpeed Cache, Varnish and hosting caches can hold the redirect response and keep serving it.
- CDNs. Cloudflare and other CDNs can cache a redirect your origin sent, and their own redirect rules run before your server sees the request.
- Search engines. Google treats a 301 as a strong signal that the destination is the canonical URL, and it keeps that view until it recrawls the old address and sees it has changed.
So removing a 301 is three jobs: delete the rule at every place it lives, clear every cache you control, and manage the caches you do not control. This guide covers all three.
Find where the redirect lives
Start with a fresh request from the command line, which bypasses your browser's memory:
curl -sI https://www.example.com/old-page | grep -iE '^(HTTP/|location:|server:|x-redirect-by:|cf-|x-cache|age:)'
The headers usually point to the layer that sent it:
| Header seen | Layer that answered | Where to look |
|---|---|---|
cf-ray, server: cloudflare | Cloudflare | Redirect Rules, Bulk Redirects, Page Rules, then the cache |
x-redirect-by: WordPress or a plugin name | WordPress or a plugin | Redirect plugin, SEO plugin redirect manager, old slug redirects |
x-cache: HIT, age: above 0, x-litespeed-cache: hit | A cache | Purge that cache, then retest |
Plain server: nginx or Apache | The web server | .htaccess, nginx configuration, hosting panel settings |
On your own server, search the configuration directly. On a Plesk server, for example:
sudo grep -rn "old-page" /var/www/vhosts/example.com/httpdocs/.htaccess
sudo nginx -T 2>/dev/null | grep -n "old-page"
sudo grep -rn "old-page" /var/www/vhosts/system/example.com/conf/
In WordPress, check redirect plugins and also the old slug records WordPress keeps when you rename a post:
wp db query "SELECT post_id, meta_value FROM $(wp db prefix)postmeta WHERE meta_key = '_wp_old_slug';"
Delete the rule at its source
Remove the rule from each place you found it, one layer at a time, and retest with curl after each change.
Apache and .htaccess
Delete or comment out the matching Redirect, RedirectMatch or RewriteRule line, together with any RewriteCond lines that belong only to it. Changes take effect on the next request.
nginx and Plesk
Remove the return 301 or rewrite ... permanent line, then test and reload:
sudo nginx -t && sudo systemctl reload nginx
On Plesk, also check the Additional nginx directives and Additional Apache directives boxes, and the preferred domain setting in Hosting settings, which creates its own www or non-www redirect. See redirects on Plesk.
WordPress
Delete the rule in your redirect plugin or SEO plugin. If WordPress itself is redirecting a renamed post, remove its old slug record:
wp post meta delete 123 _wp_old_slug old-page
Replace 123 with the post ID. See redirects in WordPress.
Cloudflare, cPanel and site builders
Delete the matching Single Redirect, Bulk Redirect list entry or Page Rule in Cloudflare; see redirects on Cloudflare. In cPanel, remove it in the Redirects tool and check the lines have gone from .htaccess. On Wix, Squarespace and Webflow, delete it in the redirect settings and publish the site if the platform needs it.
Clear the caches you control, and manage the rest
Once the rule is gone, purge every cache between your server and the visitor, for both the old URL and its destination:
- The CMS page cache or caching plugin.
- Any server cache, such as LiteSpeed, Varnish or the host's own cache.
- The CDN cache. In Cloudflare, use Purge Custom URL under Caching and enter the full old URL.
- Your own browser. Clear cached files, or test in a private window.
Retest with curl until the old URL returns 200 and the cache headers show a fresh response.
Visitors' browsers
You cannot clear other people's browsers. Visitors who received the 301 may keep being sent to the destination until their cache drops it. There are two ways to soften that.
First, if the old URL and its destination are on the same site, the destination page can send a Clear-Site-Data header, which asks the browser to empty its cache for your site. Chrome and Edge support it, and support in other browsers varies, so treat it as a help rather than a guarantee. Use it for a short period only, because it clears every cached file for the site, not just the redirect:
Clear-Site-Data: "cache"
Second, if the destination page is not needed in its own right, it can send visitors back with a temporary redirect to a slightly different address, so they do not hit their stored 301 again:
# nginx, on the destination page, for a limited time
location = /new-page/ {
return 302 /old-page/?restored=1;
}
The query string makes it a new address that is not in the browser's cache. Give the old page a canonical tag pointing at /old-page/ so search engines ignore the parameter.
Let search engines catch up
Google keeps the destination as the indexed URL until it recrawls the old address and sees a normal page. To speed that up:
- Make sure the old URL returns 200, has a self-referencing canonical tag and has no
noindex. - Add it back to your XML sitemap and remove the destination if that page is no longer wanted.
- Change internal links so they point at the old URL again.
- Inspect the old URL in Search Console, run a live test and request indexing.
If the destination page should no longer exist, return a 404 or 410 for it, or point its canonical tag at the restored page. The canonicals guide explains how these signals combine.
A worked example
A page at /pricing/ was redirected to /plans/ by mistake during a redesign. curl shows a 301 with cf-ray and x-redirect-by: redirection headers. Two layers are involved: the Redirection plugin in WordPress and a Cloudflare redirect rule added while testing.
The plugin rule is deleted first. curl still shows the 301, now without the WordPress header, which confirms Cloudflare is answering. The Cloudflare rule is deleted, then https://www.example.com/pricing/ and /plans/ are purged from the Cloudflare cache and the WordPress page cache is cleared. curl now returns 200 for /pricing/.
The owner's browser still goes to /plans/, which is expected: it cached the 301. A private window shows the correct page, and clearing the browser cache fixes his own view. /pricing/ goes back in the sitemap, the menu link is restored, and indexing is requested in Search Console. Within a week Google shows /pricing/ again.
The fix, step by step
Step 1
Find where the redirect lives
Run curl -sI on the redirected URL and read the headers. A cf-ray header points to Cloudflare, x-redirect-by names WordPress or a plugin, cache headers such as x-cache: HIT point to a cache, and a plain nginx or Apache server header points to the server configuration. Search that layer for the old path. You have found the source when you can point to the exact rule, setting or cached copy that sends the 301.
Step 2
Delete the rule at its source
Remove the rule from the layer you found: the line in .htaccess or the nginx configuration, the entry in the redirect plugin, the Cloudflare rule, the cPanel redirect or the site builder setting. For a renamed WordPress post, delete its _wp_old_slug record. Reload nginx after editing with nginx -t first. Confirm the change by checking that the rule no longer appears in the configuration or settings screen.
Step 3
Retest and check the next layer
Run curl again on the old URL. If it still returns a 301, look at the headers once more, because a second layer may have held a copy of the same redirect. Repeat the search and removal for that layer. Keep going until curl returns a 200 for the old URL or a different response you expect, and the headers show no sign of a redirect coming from any layer.
Step 4
Purge server and CDN caches
Clear the CMS page cache, any server cache such as LiteSpeed or Varnish, and the CDN cache for both the old URL and its former destination. In Cloudflare, use Purge Custom URL and enter the full addresses. Cached redirects can be served for hours after the rule is gone. Confirm by running curl again and checking that the cache headers show a miss or a fresh response rather than a hit.
Step 5
Clear your own browser cache
Your browser stored the 301 and may reuse it without asking the server. Clear cached images and files, or test in a private window, which starts with an empty cache. In Chrome DevTools you can also tick Disable cache on the Network panel and reload. Confirm by loading the old URL and seeing the page itself rather than the former destination, with no 301 in the Network panel.
Step 6
Reduce the effect on visitors' browsers
Visitors who received the 301 may keep being redirected until their cache drops it. If both pages are on the same site, send Clear-Site-Data: "cache" from the former destination for a short period, or add a temporary 302 from the destination to the old URL with a query string such as ?restored=1. Never redirect to the exact original URL, which causes a loop for cached browsers.
Step 7
Bring the old URL back into search
Make sure the old URL returns 200, has a self-referencing canonical tag and no noindex. Add it to your XML sitemap, restore internal links to it, and remove or redirect the former destination if it should no longer exist. Then inspect the old URL in Search Console, run a live test and request indexing. Confirm over the following days that the old URL is reported as indexed.
Step 8
Use temporary redirects next time
For any redirect that might be undone, such as a campaign, a seasonal page or a test, use a 302 or 307 instead of a 301. If a permanent redirect might change, send a Cache-Control: max-age=3600 header with it so browsers check again after an hour. Record every redirect and the layer it lives in, so removing one later is a single change in a single place.
Edge cases worth knowing
- A 308 behaves like a 301. It is also permanent and cached the same way, so the same steps apply.
- HSTS is not a redirect rule. If the redirect you want gone is http to https, and the site sends HSTS, browsers upgrade to https internally regardless of the server. That is intended; do not try to remove it unless you are leaving https, which you should not.
- Whole-domain redirects. If a whole domain was redirected, visitors' browsers may have cached a 301 for every page they visited. Expect the effect to fade over weeks rather than hours.
- Apps and in-app browsers. Some apps keep their own caches. Testing in one browser does not show what every visitor sees.
Avoiding the problem next time
Use a 301 only for moves you are sure are permanent. For anything that might be undone, such as a campaign page, seasonal offer or test, use a 302 or 307, which browsers and search engines treat as temporary. The 302 versus 301 guide explains which to choose.
If you must use a 301 that might change, send a short cache lifetime with it so browsers check again:
# Apache: 301 that browsers recheck after an hour
<If "%{REQUEST_URI} == '/old-page/'">
Header always set Cache-Control "max-age=3600"
</If>
Redirect 301 /old-page/ /new-page/
# nginx
location = /old-page/ {
add_header Cache-Control "max-age=3600" always;
return 301 /new-page/;
}
Keep a written list of every redirect and the layer it lives in, so removing one later means one change in one place. If a redirect you add later refuses to work, see 301 redirect not working.
1. How do I remove a 301 redirect?
Delete the rule from every place it lives, clear every cache that stored it, and then wait for visitors' browsers and search engines to catch up. Find the source with a curl request and its headers, which show whether Cloudflare, WordPress, a plugin or the server sent it. Remove the rule there, retest, and repeat if another layer still answers. Purge page and CDN caches, clear your own browser cache, and request indexing for the restored page.
2. Why does my browser still redirect after I removed the 301?
Your browser cached the 301 and is reusing it without asking the server. A 301 is cacheable by default, and if the response had no caching headers, browsers may keep it until their cache is cleared. Test with curl or a private window to see what the server sends now. Clear cached images and files in your browser to fix your own view. Other visitors may see the same until their caches drop the stored redirect.
3. How long do browsers cache a 301 redirect?
Browsers can cache a 301 for a very long time, often until the cache is cleared or the entry is pushed out by newer files. If the redirect response includes a Cache-Control header with a max-age value, browsers follow that limit instead, so a max-age of 3600 means they check again after an hour. Without such a header there is no fixed expiry you can rely on, which is why 301 should be kept for truly permanent moves.
4. Can I force visitors' browsers to forget a 301 redirect?
Not completely, because you cannot reach into other people's browsers. You can reduce the effect. If both pages are on the same site, the destination page can send a Clear-Site-Data header asking the browser to empty its cache for the site, which Chrome and Edge support. You can also add a temporary 302 from the destination back to the old URL with a query string added, so cached browsers arrive at a fresh address instead of looping.
5. Will removing a 301 redirect hurt my SEO?
Removing a 301 usually causes only a short period of change while Google recrawls both URLs. If the old URL now returns a good page, has a self-referencing canonical tag, appears in your sitemap and receives internal links, Google will normally index it again. Problems arise if both URLs end up showing the same content without clear canonical signals, or if the destination had earned links you then break. Decide which URL should rank and make every signal agree.
6. Should I use a 302 instead of a 301?
Use a 302 or 307 whenever a redirect might be undone, and a 301 or 308 only when the move is permanent. Temporary redirects are not held on to by browsers in the same way, and search engines keep the original URL indexed. That makes them right for campaigns, seasonal pages, maintenance and tests. For a real, final move, such as a new domain or a renamed page that will never return, a 301 is the correct choice.
7. Why does Google still show the redirected URL after I removed the redirect?
Google keeps the destination as the indexed URL until it recrawls the old address and sees that it now returns a normal page. That can take days or weeks for pages that are not crawled often. Speed it up by adding the old URL back to your sitemap, restoring internal links to it, giving it a self-referencing canonical tag, and requesting indexing in Search Console after a successful live test of the URL.
The redirect checker requests the URL fresh, with no browser cache, and shows each hop with its status code and headers, so you can see which layer still sends the 301 and confirm when it returns a 200.
Open Redirect Fixes โ