India English
Kenya English
United Kingdom English
South Africa English
Nigeria English
United States English
United States Español
Indonesia English
Bangladesh English
Egypt العربية
Tanzania English
Ethiopia English
Uganda English
Congo - Kinshasa English
Ghana English
Côte d’Ivoire English
Zambia English
Cameroon English
Rwanda English
Germany Deutsch
France Français
Spain Català
Spain Español
Italy Italiano
Russia Русский
Japan English
Brazil Português
Brazil Português
Mexico Español
Philippines English
Pakistan English
Türkiye Türkçe
Vietnam English
Thailand English
South Korea English
Australia English
China 中文
Canada English
Canada Français
Somalia English
Netherlands Nederlands

WordPress Redirect: How to Redirect One URL to Another

Buy domains, business emails, hosting, VPS and more: Get Started

You change a page URL. Or you delete an old page. Or you move content to a new address, or even switch domains. 

The problem is that people and search engines may still visit the old address.

Without a fix, they land on a 404 error. 

A WordPress redirect solves that. It sends the visitor from the old URL to the new one automatically.

This guide covers the main ways to set one up:

  • 301 redirects
  • 302 redirects
  • Redirects through a WordPress plugin
  • Redirects through the .htaccess file
  • Redirects using WordPress code

You will also find fixes for common problems, a simple testing process and answers to frequent questions.

WordPress Redirect Types

Not every redirect works the same way. 

The status code tells browsers and search engines what kind of move happened.

RedirectMain UsePermanent?
301Permanent URL changeYes
302Temporary redirectNo
307Temporary redirect while preserving the request methodNo
308Permanent redirect while preserving the request methodYes

Most readers only need two of these. A 301 is for permanent moves. A 302 is for temporary ones.

  • Use a 301 when a page has moved for good. Examples include a new permalink, a merged article or a new domain. Search engines treat it as a signal to pass the old page’s standing to the new one.
  • Use a 302 when the move is short term. Examples include a seasonal landing page, a maintenance page or a test. Search engines keep the original URL in mind, because you plan to bring it back.
  • The 307 and 308 codes are stricter versions. They keep the original request method, such as POST. This is useful for forms and APIs. Most WordPress site owners will never need them directly.

There is one more reason to pick the right code. Browsers cache 301 redirects hard. 

If you set a 301 by mistake, some visitors may keep getting sent to the new page even after you remove the rule. A 302 is easier to undo. When you are testing, a 302 is the safer starting point.

How to Redirect a URL in WordPress With a Plugin

A plugin is the easiest WordPress redirect method. You don’t edit any files. You fill in a form and save.

This walkthrough uses the free Redirection plugin. It supports 301, 302, 303, 307 and 308 redirects. 

It also includes redirect logs and 404 monitoring, which helps you spot broken links.

1) Install the Redirection Plugin

redirection plugin

In your dashboard, go to Plugins → Add New. Search for “Redirection.” Click Install Now next to the plugin by John Godley.

2) Activate the Plugin

Click Activate once the install finishes. The plugin may show a short setup screen. Follow the prompts. The basic setup is quick.

3) Open Tools → Redirection

wordpress redirect plugin

Go to Tools → Redirection in the left menu. This is where all your rules live. You can add, edit and delete redirects from here.

4) Enter the Source URL

The source URL is the old address. Enter only the path, such as /old-page/. You don’t need the full domain for internal pages.

Copy it exactly. A missing slash or a typo is a common reason a redirect fails.

5) Enter the Target URL

add redirect url

The target is the new address. Use the full URL, such as https://example.com/new-page/. Make sure the page exists and loads. Include https if your site uses it.

6) Select the Appropriate Redirect

Pick the status code from the dropdown. Choose 301 for permanent moves. Choose 302 for temporary ones. 

If you are not sure, think about the future. Will the old URL ever come back? If not, use 301.

7) Save the Redirect

Click Add Redirect. The rule appears in your list right away. It starts working immediately.

8) Test the Old URL

Open the old URL in a private window. It should take you to the new page. We cover testing in more detail below.

What a Successful Redirect Should Do

A good redirect is quick and quiet. The visitor types or clicks the old URL. The browser lands on the new page. 

The address bar shows the new URL. There is no error and no long delay.

Behind the scenes, the server sends the right status code first. Then the browser follows to the destination. If you see a 404, a loop or a blank page, something needs fixing.

The Redirection plugin offers a few extras worth using. The 404 log shows which missing URLs visitors are hitting. 

You can turn a logged 404 into a redirect with one click. The redirect log shows which rules get used and how often. That tells you which old links still bring traffic.

You can also group redirects into modules and import or export them as a file. 

That helps when you move many pages at once, such as after a site redesign. Instead of adding rules one by one, you upload a list.

One tip for site moves. 

Make a spreadsheet of old URLs and new URLs before you start. Map each old page to the most relevant new page. 

Avoid sending everything to the homepage. Visitors and search engines prefer a close match.

How to Redirect a WordPress URL Without a Plugin

You can also set up a redirect at the server level. 

This avoids adding another plugin. It also means the redirect runs before WordPress even loads.

i) Using the .htaccess File

how to redirect a wordpress url using Using the .htaccess File

This method mainly applies to WordPress sites running on Apache. 

Many shared hosting plans use Apache. Sites on NGINX handle redirects differently, in the server configuration.

Here is a basic example:

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

That single line sends /old-page/ to the new URL with a 301 status.

Some points worth knowing about the file:

  • Where it lives. The .htaccess file sits in your site’s root folder, usually public_html. It is a hidden file. You may need to turn on “show hidden files” in File Manager.
  • Back it up first. Download a copy before you edit anything. If something breaks, you can restore the original in seconds.
  • Syntax mistakes cause trouble. One wrong character can take your whole site offline with a 500 error. Edit carefully.
  • Place custom rules carefully. Put your redirect lines above the WordPress block that starts with “# BEGIN WordPress.” WordPress can overwrite its own block.
  • Test afterward. Open the old URL right away. Then open a few other pages to confirm the site still works.

This method is not the best choice for complete beginners. 

If you are new to WordPress, use the plugin method first. Come back to .htaccess once you feel comfortable with files and backups.

ii) Using WordPress Code

Developers can also write a redirect in PHP. 

WordPress provides the wp_redirect function for this. It usually goes inside a theme function or a small custom plugin.

The code checks the requested URL. 

If it matches, it sends the visitor to the new address with a status code. 

Always add an exit call right after the redirect. Without it, the rest of the page may keep running.

Avoid editing theme files directly. A theme update can wipe your changes. A custom plugin is the safer home for this kind of code.

Common WordPress Redirect Problems

a) Redirect Loop

A loop happens when URL A sends visitors to URL B, and B sends them straight back to A. The browser gives up and shows an error.

Common causes include:

  • Conflicting HTTPS settings
  • Mismatched WordPress Address and Site Address settings
  • Proxy or CDN settings that force a different protocol
  • A redirect rule that points to itself

WordPress documentation lists conflicting URL and HTTPS configuration among the usual causes of “too many redirects.” 

Check Settings → General first. Make sure both addresses match and use the same protocol.

b) Too Many Redirects

TOO MANY REDIRECTS

This error also appears when you build a chain. A chain looks like this: A → B → C → D.

Each hop adds delay. Browsers and search engines may stop following after a few steps. Instead of a chain, redirect A straight to D where appropriate.

Review old rules from time to time. Over the years, pages move more than once. Old redirects can pile up into long chains without anyone noticing.

c) Redirect Isn’t Working

Work through this checklist:

  • The redirect rule. Check the source and target for typos.
  • Plugin settings. Make sure the rule is enabled, not paused.
  • .htaccess. Look for conflicting rules or errors.
  • Cache. Clear your caching plugin and any server cache.
  • CDN. Purge the CDN cache if you use one.
  • Browser cache. Browsers remember 301 redirects. Test in a private window.

Cache is the most common culprit. The redirect may be working, but an old cached page is still being shown.

d) Redirect Goes to the Wrong Page

Check the source and destination URLs. 

A small mistake in the target sends visitors somewhere unexpected. Look for extra characters, wrong slugs and old paths.

Also check for pattern or regex rules. A broad rule can catch more URLs than you intended.

e) Redirect Creates a 404

Check whether the destination actually exists. Open the target URL in a browser. 

If it shows a 404, the redirect works but the page is missing. Fix the target, or restore the page.

How to Test a WordPress Redirect

Testing takes a minute. Do it after every change.

  1. Open the old URL in a private window. This skips browser cache.
  2. Check where it lands. It should reach the intended page.
  3. Check the HTTP status code. Use a browser developer tool or an online header checker. You should see 301 or 302, as intended.
  4. Test from another browser or device. Try your phone on mobile data.
  5. Check for redirect chains. A header checker shows each hop. Aim for one step.
  6. Check that HTTPS is used correctly. The final URL should load securely, with no warnings.

If all six checks pass, the redirect is healthy.

FAQs

Does WordPress automatically redirect changed URLs?

Partly. WordPress can redirect an old post URL if you change only the slug. It looks for a matching post name. This does not cover every case. Changes to categories, permalink structure, deleted pages or new domains usually need a manual redirect.

Is a 301 or 302 redirect better?

Do WordPress redirects affect SEO?

Why is my WordPress redirect not working?

How do I fix too many redirects in WordPress?

Host Your WordPress Site With Truehost

URLs change. Pages move. Domains get replaced. When that happens, you need a hosting setup that gives you easy access to the right tools.

Truehost WordPress hosting runs on cPanel. That means you can manage your website files, domains and .htaccess in one place.

You can install WordPress in one click. Daily backups are included, which is a useful safety net before you edit server files.

If you are building or moving a WordPress site, explore Truehost WordPress hosting and pick a plan that fits.

You will have what you need to set up a clean WordPress redirect whenever your URLs change.