/ โ† Redirect Fixes / Remove a 301 Redirect
In this guide
  1. Why a 301 is hard to take back
  2. Find where the redirect lives
  3. Delete the rule at its source
  4. Clear the caches you control, and manage the rest
  5. Let search engines catch up
  6. A worked example
  7. The fix, step by step
  8. Edge cases worth knowing
  9. Avoiding the problem next time
  10. Questions and answers

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:

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 seenLayer that answeredWhere to look
cf-ray, server: cloudflareCloudflareRedirect Rules, Bulk Redirects, Page Rules, then the cache
x-redirect-by: WordPress or a plugin nameWordPress or a pluginRedirect plugin, SEO plugin redirect manager, old slug redirects
x-cache: HIT, age: above 0, x-litespeed-cache: hitA cachePurge that cache, then retest
Plain server: nginx or ApacheThe 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';"
๐Ÿ’ก A redirect can live in several layers at once, for example a plugin rule and a Cloudflare rule added during testing. Keep checking after you remove the first one, because the next layer then takes over.

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:

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.

โš ๏ธ Never send the destination straight back to the exact original URL with a redirect. Browsers that cached the original 301 will bounce between the two pages in a loop. See redirect loops.

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

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.

Questions and answers

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.

Confirm the redirect has really gone

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 โ†’
๐Ÿ’ฌ Got a problem?
Related Guides: All Redirect Fixes  ·  301 Redirect Not Working  ·  302 Versus 301 Redirects  ·  Fixing Redirect Loops  ·  Redirects in WordPress  ·  Learning Hub

About aiwebpageseo

aiwebpageseo.com is a data-driven SEO and AEO (Answer Engine Optimisation) platform providing a free suite of technical SEO tools. Rather than relying on AI-theorised assumptions, the platform analyses live URL performance, delivering objective diagnostics, page speed metrics, CLS debugging, and site crawl data alongside actionable technical tutorials.