9 min read

301 Redirects in WordPress: When, Why, and How

Shashank Dubey
Content & Marketing, Wbcom Designs · Published Mar 13, 2026 · Updated Nov 6, 2026
301 redirects in WordPress SEO guide showing URL redirection flow

A redirect decides what happens when someone, or a search crawler, requests a URL that has moved. Get it right and rankings and bookmarks carry over to the new address. Get it wrong and visitors land on 404 pages or loop between URLs.

This guide explains what a 301 redirect is, how it differs from 302, 307 and 308, and three ways to set one up in WordPress: a plugin, server rules, and code.

Last updated: 6 November 2026

Quick answer

A 301 redirect is a permanent HTTP redirect that sends visitors and search engines from an old URL to a new one. In WordPress, create it with a plugin such as Redirection, Rank Math or Yoast SEO Premium, or at server level with Apache’s Redirect permanent or Nginx’s return 301. Use 302 or 307 only when the move is temporary.

What Is a 301 Redirect?

A 301 redirect is a permanent server response that tells browsers and search engines a page has moved to a new URL. Users are sent to the new location automatically, and search engines treat the new page as the preferred destination.

Google’s documentation says that for a permanent redirect, “the indexing pipeline uses the redirect as a signal that the redirect target should be canonical.” It supports HTTP 301 and 308 as permanent redirects and recommends server-side redirects wherever possible.

Reference: Google Search Central: Redirects and Google Search | MDN: 301 Moved Permanently

301 vs 302: What Is the Difference?

A 301 says the move is permanent. A 302 says it is temporary and the original URL will come back. Google follows both, but it only treats a permanent redirect as a signal that the target should be the canonical URL. With a temporary redirect, the original URL can stay indexed.

That is why using 302 for a permanent move is a common mistake. It does not break anything for visitors, but it sends the wrong signal to search engines.

301 vs 308 vs 302 vs 307: Which One Should You Use?

Status CodeUse CaseSearch Engine SignalMethod Handling
301Permanent move (most common in WordPress)Target treated as canonicalBrowsers may switch POST to GET
308Permanent move where method and body must stay intactTarget treated as canonicalPreserves HTTP method and body
302Temporary redirectNot a canonical signalBrowsers may switch POST to GET
307Temporary redirect with method preservationNot a canonical signalPreserves HTTP method and body

MDN notes that when a browser receives a 301 in response to a POST request, it uses GET for the follow-up request, and recommends 308 when the method must not change. For ordinary page moves, where visitors request pages with GET, 301 is the right choice.

Reference: MDN: 308 Permanent Redirect | MDN: Location header

When Should You Use 301 Redirects in WordPress?

1. You changed a post or page slug permanently

If /old-url/ now lives permanently at /new-url/, add a 301. WordPress itself redirects some old post slugs to the current permalink with a 301 (the core function wp_old_slug_redirect), but that covers only posts whose slug was edited in WordPress. It does not cover deleted pages, changed categories, or moved domains.

2. You merged two similar articles into one stronger page

When consolidating content, redirect the weaker duplicates to the final URL. Google’s site move guidance allows redirecting several old URLs to one new page when the content was consolidated there.

3. You migrated from HTTP to HTTPS

Every old HTTP URL should 301 to its exact HTTPS equivalent. Partial migrations leave duplicate versions of the same page in the index.

4. You changed domain or subdomain structure

During a domain migration, map old URLs to the closest new URLs with one-hop redirects. Google’s guidance is to keep redirects “for as long as possible, generally at least 1 year.”

5. You removed obsolete pages but have a relevant replacement

If a product or service page is retired but an equivalent page exists, 301 to the closest match. If no relevant substitute exists, return 410 or a proper 404 instead of redirecting to the homepage. Google specifically advises against redirecting many old URLs to one irrelevant destination such as the home page.

When You Should Not Use 301

  • A/B testing or short campaigns: Use 302 (temporary), not 301. See Google guidance for testing.
  • Temporary stock outages or maintenance pages: Use 302 or 307.
  • Unrelated destination pages: Avoid redirecting irrelevant URLs to the homepage or a broad category page.
  • Anything you may reverse: Google recommends permanent redirects only when you are sure the redirect will not be reverted.

How to Set Up 301 Redirects in WordPress

Option 1: Use a redirect plugin

Plugins suit non-developers and content teams. A good one gives you logs, regular-expression support and 404 monitoring, and keeps working when you switch hosts. Three common choices behave differently.

  • Redirection: Free, with no premium tier. The WordPress.org listing shows more than 2 million active installations and version 5.10.1. It manages 301 redirects from the dashboard, supports regular expressions, logs 404 errors so you can redirect them in bulk, and can create redirects automatically when permalinks change.
  • Rank Math Redirections: A module inside Rank Math SEO that you switch on from the Rank Math dashboard. Rank Math lists 301, 302, 307, 410 and 451 as options. It does not list 308.
  • Yoast SEO Premium redirect manager: Included in Yoast SEO Premium, not the free plugin. It supports 301, 302, 307, 410 and 451, accepts regular expressions, and asks what to do with the old URL when you delete a post or change its URL.

Use only one redirect manager at a time. Two plugins handling the same URL is a common cause of loops.

Option 2: Server-level redirects (.htaccess and Nginx)

Server rules suit large sets of redirects and anyone comfortable editing configuration files. They run before WordPress loads, so they add less overhead than PHP. Back up the file before you edit it.

Apache example (in the .htaccess file in your site root, above the # BEGIN WordPress block):

Redirect permanent /old-page/ https://example.com/new-page/

The Apache documentation notes that Redirect with no status is a temporary 302, and that the permanent keyword or the number 301 makes it permanent. It also matches by prefix: a request for /old-page/foo/ is redirected to /new-page/foo/. For pattern-based rules, RedirectMatch accepts a regular expression:

RedirectMatch 301 ^/blog/(.*)$ https://example.com/articles/$1

To force HTTPS for the whole site with a 301:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

Nginx example (in the server block):

location = /old-page/ {
    return 301 /new-page/;
}

The Nginx documentation shows return 301 with a URL as the direct way to issue a permanent redirect. Use rewrite ^/blog/(.*)$ /articles/$1 permanent; when you need regular-expression captures. Reload Nginx after changing its configuration.

Reference: Apache mod_alias | Nginx rewrite module

Option 3: Programmatic redirects in WordPress

Code works for dynamic cases, such as redirecting based on a user role or a custom post type. Use wp_safe_redirect() for local destinations and pass 301 explicitly, because wp_redirect() defaults to 302 and does not stop execution on its own:

add_action( 'template_redirect', function () {
    if ( is_page( 'old-page' ) ) {
        wp_safe_redirect( home_url( '/new-page/' ), 301 );
        exit;
    }
} );

Avoid long lists of PHP redirect rules on large sites. Every request then runs through WordPress before the redirect fires.

Reference: WordPress developer reference: wp_redirect()

Which Method Should You Choose?

For a handful of URLs on a site managed by editors, use a plugin. For hundreds of rules, or for site-wide rules such as HTTPS and www, use the server. For logic that depends on who the visitor is, use code. If you need a 308 and your SEO plugin does not offer it, set it at the server level.

2026 WordPress Redirect Migration Checklist

  1. Crawl current URLs and export all indexable pages.
  2. Create a one-to-one redirect map (old URL to closest new URL).
  3. Implement 301 or 308 rules with no chains.
  4. Update internal links, navigation, canonicals and XML sitemaps.
  5. Test status codes and final destination pages.
  6. Resubmit the sitemap in Search Console.
  7. Monitor coverage, crawl stats and 404 spikes for several weeks, and keep the redirects in place for at least a year.

Common 301 Redirect Mistakes That Hurt SEO

  • Redirect chains: A to B to C. Redirect A straight to C. Google advises avoiding chains and, where they cannot be avoided, keeping them short, ideally no more than 3 and fewer than 5.
  • Redirect loops: A to B to A, often caused by two plugins or a plugin plus a server rule.
  • Mass redirecting to the homepage: It sends users to a page they did not ask for and is not a substitute for a 404 or 410.
  • Leaving old internal links unchanged: Every internal link should point to the final URL.
  • Using 302 for permanent moves: It does not signal that the new URL should be canonical.
  • Deleting redirect rules too early: Old backlinks and bookmarks still need them.

How to Test Redirects Properly

For each migrated URL, verify:

  • Expected status code (301 or 308 for permanent, 302 or 307 for temporary)
  • Correct Location destination
  • No chain and no loop
  • Final page returns 200 and matches intent

From a terminal, curl -I https://example.com/old-page/ prints the status line and the Location header without following the redirect. Browsers can cache permanent redirects, so test in a private window or after clearing the cache. You can also use Search Console and analytics to catch redirects that are valid but point at weak destinations.

Do 301 Redirects Pass SEO Value?

In practice, yes. Google’s documentation says a permanent redirect is a signal that the redirect target should be canonical, so the new URL is the one expected to appear in search. How quickly this happens depends on how often the pages are crawled, how closely the new page matches the old one, and whether you avoided chains.

WordPress-Specific Best Practices

  • Keep your permalink structure stable after launch when possible.
  • Before changing slugs, export your URL inventory and backlink data.
  • Use 404 logs to discover URLs real visitors request.
  • Review old campaign URLs and keep high-value redirects alive.
  • Pair redirect changes with an internal linking refresh.

Related: SEO Checklist for Website Owners | Fix Broken Site Search

Frequently asked questions

How long should I keep 301 redirects?

For important URLs, keep them long-term. Google’s site move guidance says to keep redirects as long as possible, generally at least one year, so signals can transfer and links from other sites can be recrawled.

Can I redirect many old URLs to one new URL?

Only when search intent is closely related. If intent differs, map each old URL to its closest equivalent.

Should I use 308 instead of 301 in WordPress?

Use 301 for standard permanent page moves. Use 308 when method and body preservation matters for your application logic, and set it at the server level if your plugin does not offer it.

What is the difference between a 301 and a 302 redirect?

A 301 is permanent and tells search engines the new URL should be the canonical one. A 302 is temporary, so the original URL can stay in the index. Use 301 for permanent moves and 302 only for short-term changes.

How do I create a 301 redirect in WordPress without a plugin?

Add a Redirect permanent line to your .htaccess file on Apache, add a return 301 rule on Nginx, or call wp_safe_redirect() with a 301 status from a template_redirect hook. Back up the file before editing.

Which WordPress plugin is best for 301 redirects?

Redirection is a free plugin dedicated to redirects and 404 logs. If you already run Rank Math, its Redirections module covers most needs. Yoast SEO Premium includes a redirect manager. Pick one and avoid running two at once.

Final Thoughts

301 redirects are simple in concept but high-impact in execution. In WordPress they matter for URL changes, domain migrations and content consolidation. Build a clean redirect map, avoid chains, test every rule, and keep the redirects alive long after launch.


Everything You Need To know About Web Page Redirect

Shashank Dubey
Content & Marketing, Wbcom Designs

Shashank Dubey, a contributor of Wbcom Designs is a blogger and a digital marketer. He writes articles associated with different niches such as WordPress, SEO, Marketing, CMS, Web Design, and Development, and many more.

Related reading