Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared Managed Cloud India
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Best lists Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

SEO & AI search · Guide

How to Set Up 301 Redirects in WordPress

Short answer

To set up a 301 redirect in WordPress, install the free Redirection plugin, open Tools > Redirection, enter the old path as the Source URL and the new address as the Target URL, pick 301 - Moved Permanently, and click Add Redirect. Rank Math and Yoast SEO Premium offer the same job through their redirect managers, and Apache sites can add a rule to .htaccess instead.

Key takeaways

  • A 301 redirect tells visitors and search engines that a page has moved for good, and Google shows the new target in search results.
  • The free Redirection plugin handles 301 redirects from inside WordPress, with no premium version and support for PHP 7.4 to 8.5.
  • Rank Math includes a free Redirections module with five match types, but it needs Advanced mode switched on first.
  • Yoast SEO Premium prompts you to add a redirect whenever you change a slug or delete a page.
  • On Apache, a single line in .htaccess creates a server-side 301 redirect with no plugin at all.
  • Always check the old URL after adding a rule, and point each old URL straight at its final destination.

What is a 301 redirect in WordPress?

A 301 redirect sends visitors and search engines from an old URL to a new one, and it tells them the move is permanent.

Google's Search Central docs say a permanent redirect shows the new target in search results, and the indexing pipeline treats the redirect as a signal that the target should be the canonical URL (Google Search Central).

Use a 301 when a page has moved for good, such as after a slug change, a site move, or merging two posts into one. Do not use it for a short-term change, since a temporary redirect fits that job better.

When should you use a 301 redirect?

Set up a 301 redirect whenever an old URL should keep working after the content moves.

  • You changed a post or page slug.
  • You merged two posts into one stronger post.
  • You moved your site to a new domain or changed its structure, as covered in our site move without losing SEO guide.
  • You deleted a page that has a close replacement.
  • You switched from HTTP to HTTPS, or from www to non-www.

Each of these cases leaves old links pointing at a URL that no longer serves the content. A 301 sends that traffic to the right place instead of a 404 page, which is why it matters for both visitors and search engines.

What do you need before you start?

You need the full list of old URLs, the matching new URLs, and a backup of your site.

Write down every old path and its new destination before you open any tool. A redirect only works when the source matches the old URL exactly, so copy paths from your browser address bar rather than typing them from memory.

Back up your site first, especially if you plan to edit .htaccess. The plugin methods below run inside WordPress and need no server access, so they suit most site owners.

Also note the exact spelling of each old URL, including trailing slashes. A redirect for /old-page/ does not match /old-page, so a missing slash can leave the old address broken.

How do you set up a 301 redirect with the Redirection plugin?

The Redirection plugin is the simplest free way to add 301 redirects, and it needs no server access.

  1. Go to Plugins > Add New, search for “Redirection”, then click Install Now and Activate.
  2. Open Tools > Redirection and finish the short setup wizard.
  3. In the Add new redirection form, enter the old path in Source URL and the new address in Target URL.
  4. Click the gear icon, pick 301 - Moved Permanently, then click Add Redirect.

The plugin is free with no premium version, and its WordPress.org page lists it as compatible with PHP 7.4 to 8.5, updated on 19 September 2026 (WordPress.org). It has been in the plugin directory for over 10 years.

Redirection can also watch for permalink changes and create the redirect for you when a slug changes. Its docs list regex support, query-parameter matching, 404 tracking, and hit counts for each redirect (Redirection docs).

How do you set up a 301 redirect with Rank Math?

Rank Math includes a free Redirections module, but you must switch the plugin to Advanced mode before the module appears.

  1. Go to Rank Math SEO > Dashboard and switch to Advanced mode.
  2. Turn on the Redirections module under Modules.
  3. Go to Rank Math SEO > Redirections and click Add New.
  4. Enter the old URL in Source URLs and the new URL in Destination URL.
  5. Pick 301 Permanent Move as the redirection type, then click Add Redirection.

Rank Math's docs list five match types: Exact, Contains, Start With, End With, and Regex. Exact matches only the URL you typed, while Contains redirects every URL holding that term (Rank Math docs).

Rank Math does not allow redirecting the homepage, and its docs warn that trying can lock you out of your site. You can also add several source URLs to one rule with the Add another button, which helps when several old posts point at one new page.

How do you set up a 301 redirect with Yoast SEO Premium?

Yoast SEO Premium includes a redirect manager that prompts you when you change a slug or delete a page.

  1. Go to Yoast SEO > Redirects in your dashboard.
  2. Pick 301 Moved Permanently from the Redirect Type list.
  3. Enter the old path under Old URL and the new address under New URL.
  4. Click Add redirect.

Yoast's redirect manager also offers 302, 307, 410, and 451 types in the same list, so pick 301 only when the move is permanent (Yoast help). Yoast uses relative input, so you enter the path after your domain rather than the full address.

If you already use Yoast SEO, our Yoast redirects guide walks through the same manager in more detail, including regex redirects.

How do you add a 301 redirect in .htaccess?

Editing .htaccess puts the redirect on the server, which Google recommends whenever possible for permanent moves.

Back up the file first, since one wrong line can break your whole site. The file sits in your site's root folder, and you can reach it through your host's file manager or an FTP client.

Add one line per redirect, near the top of the file and above the WordPress block:

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

The change takes effect at once, with no plugin needed. Our htaccess redirect generator builds the rule for you if you prefer not to write it by hand.

If your host runs NGINX instead of Apache, there is no .htaccess file. Use your host panel or one of the plugin methods above instead.

How do you check that your redirect works?

Open the old URL in a private browser window. It should land on the new page without a warning.

For a precise check, open your browser's developer tools, load the old URL, and look for a 301 status code on the first response. A redirect checker site shows the same status code and the full chain of hops.

Google Search Console's URL Inspection tool can also confirm that Google sees the redirect, though it may take days for the change to show in search results. Fix any 404s you find along the way with our 404 error on posts fix guide.

Keep a note of every redirect you add, with the date. When traffic to an old URL dries up, you can review the rule instead of guessing whether it still matters.

What is the difference between 301, 302, 307 and 308?

The code you pick tells search engines whether the move is permanent or temporary.

CodeMeaningWhen to use it
301Moved permanentlyPage moved for good
302Found (temporary)Short-term move
307Temporary redirectShort-term move, keeps the request method
308Moved permanentlyPermanent move, keeps the request method

Google lists 301 and 308 as permanent, and 302, 303, and 307 as temporary, in its Search Central docs on redirects.

Pick 301 for almost every permanent move. Use 302 or 307 only when you plan to bring the old URL back, such as during a short promotion or maintenance window.

What mistakes should you avoid?

The biggest mistake is stacking redirects into a chain, where one old URL points to another redirect instead of the final page.

  • Redirecting to a page that is itself redirected, which slows the page down and confuses search engines.
  • Redirecting every old URL to the homepage instead of the closest matching page.
  • Forgetting to update internal links that still point at the old URL.
  • Using a 302 for a permanent move, which tells search engines to keep showing the old URL.
  • Never checking the redirect after adding it.

Redirect loops are a related problem, where two URLs point at each other and the browser gives up. Our too many redirects guide explains how to spot and break a loop.

Frequently asked questions

Do 301 redirects hurt SEO?

No. A 301 redirect passes ranking signals from the old URL to the new one, and Google treats the new target as the canonical URL. Problems come from mistakes such as redirect chains, redirecting everything to the homepage, or using a 302 for a permanent move.

How long should I keep a 301 redirect in place?

Keep it as long as the old URL still gets traffic or has links pointing at it. Removing a redirect too soon sends those visitors to a 404 page. Check your redirect logs or analytics every few months and only remove rules with no traffic and no incoming links.

Can I redirect one URL to a different domain?

Yes. The Redirection plugin, Rank Math, and Yoast SEO Premium all accept a full external address as the destination, and .htaccess rules can point at another domain too. Use this when you move a site or merge two sites into one.

What happens if I redirect to a page that no longer exists?

Visitors land on a 404 page, which defeats the purpose of the redirect. Always check that the destination loads before you save the rule, and re-check old redirects after you delete or move content.

Do I need a plugin to create 301 redirects?

No. On Apache hosting you can add a Redirect 301 line to .htaccess, and many hosts offer a redirect tool in their control panel. A plugin is easier to manage, shows 404 errors, and lets you edit rules without touching server files.

How many 301 redirects can I add to a WordPress site?

There is no fixed limit. The Redirection plugin states it works on sites with a few redirects and on sites with thousands of them. Keep the list tidy by removing rules for URLs that no longer get traffic or links.

Sources

  1. Redirection – WordPress plugin WordPress.org
  2. Redirects and Google Search Google Search Central
  3. How to Set Up Redirections Rank Math
  4. How to redirect a post or page in Yoast SEO Premium Yoast
  5. How to create a 301 redirect in WordPress Yoast
  6. Redirection documentation Redirection

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

WPLegible editors

Researched from the primary sources listed above and checked against our editorial rules. About the site · How we test