Skip to content
WordPress Guide

How to Create a 301 Redirect in WordPress

When a page moves, send its old address to the new one. Three ways to set up a 301 redirect, choosing 301 or 302, and how to check it works.

A desk with website wireframes, a phone and coloured pens
9 sections · 7 min read
In this article · 9 sections

You renamed your “Our Services” page to “Plumbing Services” and, while you were at it, changed its address to match. The old address is still in Google, in a supplier’s directory listing and on a flyer you printed last spring. Anyone who follows it now lands on a “page not found” message.

The fix is to create a 301 redirect in WordPress: a rule that sends anyone who asks for the old address straight to the new one, and tells search engines the move is permanent. It takes a few minutes once you know where to do it. There are three usual places to set one up, and the choice between a 301 and a 302 matters more than it looks, so both come before the testing. Like most tasks in our WordPress owner’s guide, it needs no code unless you choose the server route.

301 or 302: which one you want

Both send the visitor to another address. The difference is the message they give search engines.

Type Meaning Use it when
301 Moved permanently A page has a new address for good, or has been merged into another page. This is the one you want almost every time.
302 Found elsewhere, temporarily The old address will come back, for example a seasonal page sent to a holding page for a few weeks.
307 and 308 Temporary and permanent, stricter versions Rarely needed on a small business site. Plugins offer them for technical cases.
410 Gone Content removed on purpose with no sensible replacement. Not a redirect, but some plugins list it alongside them.

A temporary redirect left in place for months is a common slip. Search engines may keep the old address in their records because you said it was coming back. If the move is permanent, say so with a 301.

Before you create a 301 redirect in WordPress

  1. Write down the old address exactly, including or excluding the trailing slash as it was. You only need the part after your domain, such as /our-services/.
  2. Pick the closest new page. The old pricing page should go to the new pricing page, not to the home page. If you are dealing with dozens of old addresses after a redesign, our guide to 404 errors after a website redesign covers how to map them.
  3. Check whether WordPress already did it. When you change the slug of a published blog post, WordPress usually remembers the old one and redirects it by itself. Pages do not get this treatment. Type the old address into a private window and see what happens before adding a rule you may not need.
  4. Use one redirect tool. If you already have the Redirection plugin, or Rank Math’s redirects switched on, keep all rules in that one place. Rules spread across a plugin, an SEO plugin and the server are hard to keep track of.

Option 1: the Redirection plugin

Redirection is a free plugin from the WordPress plugin directory and a sensible choice if your SEO plugin does not handle redirects.

  1. Install and activate Redirection, then go to Tools → Redirection.
  2. The first time, a short setup appears. It offers to watch for changed post and page addresses and to keep logs of redirects and 404s. Watching for changes is useful. Logging is optional; it is handy for finding broken addresses but adds rows to your database.
  3. On the Redirects screen, find the form for adding a new redirection.
  4. Enter the old address in Source URL, for example /our-services/.
  5. Enter the new address in Target URL, for example /plumbing-services/.
  6. Leave the type as a 301 unless you have a reason not to. The form’s extra options let you change it if you do.
  7. Save the redirect.

Option 2: Rank Math’s Redirections module

If Rank Math is your SEO plugin and its Redirections module is switched on, there is no need for a second plugin.

  1. Open the Redirections screen from the Rank Math menu in your dashboard and choose to add a new one.
  2. Enter the old address under the source URLs and the new page as the destination.
  3. Choose 301 Permanent Move as the redirection type.
  4. Save it.

Rank Math can also offer to create a redirect when you change a page’s address in the editor, depending on its settings. It is worth checking that what it created points where you expect.

Option 3: at the server or hosting level

Redirects can be written into the server configuration instead of WordPress. On Apache servers that means the .htaccess file in your site’s main folder, with a line like this:

Redirect 301 /our-services/ https://example.com/plumbing-services/

Some hosting control panels, cPanel among them, have a redirects tool that writes these lines for you. Server rules run before WordPress loads, so they keep working even if you change plugins. But a typing mistake in .htaccess can take the whole site offline, so download a copy of the file first and put your lines above the block that starts “# BEGIN WordPress”, never inside it. Nginx servers do not use .htaccess at all; on those, ask your host.

For most owners, a plugin is the safer route. Keep server rules for cases like moving a whole domain or forcing https, which your host often handles anyway.

Test the redirect

Open the old address in a private browser window. You should land on the new page and see the new address in the bar. Then check what kind of redirect it was: our redirect checker tool shows each step, the status code at each one and where it ends. You want one step, a 301, landing on a page that loads normally.

Browsers remember permanent redirects strongly. If you set a redirect wrongly and then fix it, your own browser may keep sending you to the old destination. A private window, or a different browser, shows what a new visitor sees.

Chains, loops and other things that go wrong

Chains

A page renamed twice can end up redirecting A to B, then B to C. It works, but each extra step is slower and less reliable. Edit the first rule so A goes straight to C, and keep B to C as well.

Loops

If A points to B and B points back to A, the browser gives up with a “too many redirects” error. Our post on fixing a redirect loop in WordPress explains how to find which rule is responsible.

Redirecting everything to the home page

It is tempting when a lot of pages go at once. It leaves visitors at a page that does not answer what they clicked for, and search engines tend to treat it much like a missing page. Send each old address to its nearest equivalent, and accept a 404 or 410 where there truly is none.

A redirect catches visitors from outside. Inside your own site, update the menus, buttons and in-text links to point directly at the new address rather than relying on the redirect.

How long to keep redirects

Keep them. Old links stay in emails, bookmarks and other websites for years, and removing a rule breaks every one of them again. A tidy-up that deletes “old” redirects is one of the more common ways a site loses visits it did not know it was getting. If you change redirect tools, export the rules first and import them into the new one.

Redirects sit within the wider SEO routine described in our guide to WordPress SEO basics, alongside sitemaps, titles and the pages you keep out of search.

Frequently asked questions

Can I redirect a page that still exists?

Yes, the redirect takes over and visitors never see the original page. That is confusing to manage, though. If you are replacing a page, set the old one to draft or move it to the trash after the redirect is working, so you do not later edit a page nobody can reach.

Does a 301 redirect pass on the old page’s search value?

Google’s own guidance treats a permanent redirect as the right way to move a page and as a strong sign that the new address should replace the old one in its results. That does not mean the new page will appear exactly where the old one did, especially if its content is quite different.

How do I redirect an old PDF or image address?

The same way as a page. Enter the file’s old address, such as the path to the PDF inside your uploads folder, as the source and the new file or page as the target. If the file itself still exists at the old address, the server may serve it directly, so remove or rename it first.

Do I need a redirect if I only change the page’s title?

No, as long as the address stays the same. Editing the title of a page that is already published does not change its slug. Look at the URL or slug field in the page’s settings panel. Only when that changes does the old address need a redirect.

Redirect rules collected over a couple of redesigns tend to overlap, and some end up in the server, some in one plugin and some in another. When yours have reached that point, our WordPress support can work out which rules are active and help you bring them together in one place.

Next in this series: How to Submit Your WordPress Sitemap to Google

Is Your Website Working Properly?

Get a free website health check from WebMaintor. We'll review your website's speed, security, forms, and technical health — and tell you exactly what needs attention.

No obligation. No automated reports. A real review by our team.