Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
30 Million+
Websites using our plugins
20+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Create a Redirect in WordPress (Ultimate Guide)

Ever clicked an old link to one of your own posts and landed on a 404 error page? That usually happens because the URL changed, but a proper redirect wasn’t set up.

Fixing it takes a couple of minutes, and it doesn’t involve any code. Most people use an SEO plugin for this, but you can also add redirects yourself in your site’s .htaccess file.

In this guide, we’ll walk through both, so you can send old links to the right page and keep the search rankings that page earned.

How to create a redirect in WordPress

What Is a WordPress Redirect?

In WordPress, a redirect sends your website visitors and search engines from one URL to another. Redirects are often used to fix broken links, replace outdated URLs, or point an old URL to a new one.

They also tell search engines that your content has moved, so you can pass the search authority (link juice) from an old page to a new one.

Example of how a redirect works

There are a few different types of redirects that every WordPress site owner must know:

  • 301 Moved Permanently: Use this when a URL has changed permanently, such as after changing a permalink, moving or merging content, deleting a page and replacing it, or switching from HTTP to HTTPS. You should also use a 301 redirect when moving your site to a new domain. It passes the original page’s SEO value to the new URL.
  • 302 Found: Use this when the change is only temporary, such as during website maintenance, a limited-time campaign, or while a page or product is temporarily unavailable.
  • 410 Gone: This isn’t a redirect. Instead, it tells search engines that a page has been permanently removed and won’t be coming back. It’s the right choice when you delete a page that doesn’t have a suitable replacement.

For most WordPress websites, a 301 redirect is the right choice because most URL changes are permanent.

How to Create a Redirect in WordPress With a Plugin (Easy Method)

The easiest way to create a redirect in WordPress is with a plugin. For most websites, we recommend the free 404 to 301 – Redirect Manager plugin because it lets you create custom redirects and track broken links from one dashboard.

At WPBeginner, we use All in One SEO for redirection though because it’s the SEO plugin we use and it comes with a Redirect Manager. Most Pro versions of popular SEO plugins, including Yoast SEO and Rank Math, include one too.

However, for this tutorial, we’ll use the free features in 404 to 301 because they provide everything most WordPress websites need.

First, install and activate the 404 to 301 – Redirect Manager plugin. If you need help, then see our guide on how to install a WordPress plugin.

After activation, go to 404 to 301 » Redirects and click the ‘Add Redirect’ button.

Click the Add Redirect button in the 404 to 301 plugin

In the popup that appears, enter the old URL in the ‘Source URL or pattern’ field.

Next, choose where you want to send visitors in the ‘Target URL’ field. You can redirect them to a custom URL, an existing page on your site, or choose not to redirect the URL.

Next, select a ‘Redirect Status.’ For most URL changes, you’ll want to use ‘301 – Moved Permanently (SEO)’, which tells browsers and search engines that the page has permanently moved.

If you need a different type, then you can pick one from the dropdown menu.

Choose a redirect status in the 404 to 301 plugin

When you’re ready, simply click ‘Create Redirect’. Your redirect is now active, and anyone visiting the old URL will be automatically sent to the new destination.

After creating a redirect, you should test it to make sure it sends visitors and search engines to the correct page.

Simply visit the old URL in your incognito or private browsing window to see if it redirects you to the new page instead of showing a 404 error. This prevents the browser cache from showing your old page instead.

You can also use a free online redirect checker tool, like Redirect Checker, to confirm your redirect is returning the correct HTTP status code, such as 301 Moved Permanently.

How to Create Redirects Manually With .htaccess (Advanced)

If you don’t want to use a redirect plugin, then you can create redirects by editing your website’s .htaccess file. This method is best for advanced users because even a small mistake can cause your website to stop working.

Note that this method only works if your host runs Apache or LiteSpeed. Standalone Nginx has no .htaccess file, so if your host runs Nginx, then use the plugin method above or ask your host to add the redirect for you.

Before making any changes, we recommend creating a complete WordPress backup so you can quickly restore your site if something goes wrong.

Next, connect to your website using an FTP client or your hosting provider’s File Manager. Then, navigate to your site’s root folder (usually public_html) and locate the .htaccess file.

Open the .htaccess file using the File Manager

Note: If you don’t see the .htaccess file, make sure your FTP client or File Manager is set to show hidden files, since files that begin with a period are hidden by default.

Open the file in a text editor and add the following line above the #BEGIN WordPress line:

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

Replace /old-page/ with the path of the old page and https://example.com/new-page/ with the full URL of the new page.

Create a redirect using the .htaccess file

Save the file and upload it back to your website if you’re using FTP. If you’re editing the file in your hosting account’s File Manager, then simply click the ‘Save Changes’ button.

Finally, visit the old URL in your browser to make sure it automatically redirects to the new page.

How to Redirect a WordPress Page After Changing Its Permalink

If you change a post’s permalink, then you should redirect the old URL to the new one. This prevents visitors from landing on a 404 error page and helps search engines find the updated URL.

When you change a post’s slug, WordPress remembers the old one and redirects it to the new URL automatically. It does not do this for pages, so a renamed page’s old URL returns a 404 until you create the redirect yourself.

With the 404 to 301 plugin, you can automatically create these redirects whenever you change a post or page slug.

Go to 404 to 301 » Settings and enable ‘Monitor post slug changes’ in the ‘General’ tab. Then, click the ‘Save Changes’ button to store your settings.

Enable Monitor Post Slug Changes option in 404 to 301 plugin

From now on, the plugin will automatically create a redirect whenever you rename a post or page slug.

For more details, see our guide on how to redirect a page or URL in WordPress.

How to Redirect a Deleted Page in WordPress

If you delete a page, then it’s a good idea to decide what should happen when someone visits its old URL. Use a 301 redirect if you’ve replaced the page with newer content, or a 410 Gone response if the page isn’t worth keeping, like a thank-you page, for example.

To return a 410 Gone response, follow the same steps as above to create a redirect. This time, choose ‘No Redirect’ as the ‘Target Type’ and ‘410 – Gone’ as the ‘Redirect Status’ before clicking ‘Create Redirect’.

Select 410 as the the redirect status in the 404 to 301 plugin

How to Redirect Multiple URLs to One Page in WordPress

Sometimes you need to send several old URLs to the same new page. For example, you might merge a few outdated tiny travel guides into one comprehensive travel guide.

Instead of creating a separate redirect for each URL, you can match multiple URLs with a single redirect rule.

Follow the same steps above to create a redirect, but this time, choose ‘Prefix’ or ‘Regex’ as the ‘Match Type’ when you enter the ‘Source URL or pattern’.

Choose Prefix as the match type in the 404 to 301 plugin

For example, choose ‘Prefix’ if you want to redirect every URL that starts with /travel/japan/, such as /travel/japan/tokyo-guide, to your new Japan travel guide. Choose ‘Regex’ only if you need to match more complex URL patterns.

Then, complete the remaining fields using the steps we described earlier and create your redirect.

If you have a large number of redirects to create, then you don’t have to add them one by one. The free Redirects Importer add-on lets you import redirects from a CSV file, which makes it much faster to add multiple redirects at once.

How to Redirect an Entire WordPress Website to a New Domain

If you’re moving your WordPress website to a new domain, then you’ll need to set up a full site redirect.

This automatically sends visitors and search engines from your old domain to the matching pages on your new domain, which helps preserve your traffic and SEO.

An example of moving an entire website to a new domain

Before setting up the redirect, make sure your website has already been moved to the new domain and is working correctly. See our guide on how to properly move WordPress to a new domain without losing SEO.

If you’re using a plugin that doesn’t support this feature, then you can redirect your entire domain at the server level using the .htaccess file or your web host’s redirect tools.

If you’re already using All in One SEO Pro, then you can create a full site redirect directly from your WordPress dashboard instead.

Simply go to All in One SEO » Redirects » Full Site Redirect, enable the ‘Relocate Site’ option, enter your new domain, and save your changes.

Set up a full site redirect in All in One SEO Pro

If you plan to cancel your old hosting account, then you’ll need to set up the redirect at the server or hosting level instead. Otherwise, visitors to your old domain won’t be redirected because WordPress will no longer be running.

For full details, see our guide on how to redirect an entire WordPress website.

A 404 error appears when someone tries to visit a page on your website that no longer exists. This can happen after you change a URL, delete a page, or when another website links to an outdated URL.

If you’re using the 404 to 301 plugin, then go to 404 to 301 » 404 Logs to see a list of broken URLs that visitors have tried to access on your website.

404 logging is enabled by default, but you can review or change these settings anytime under 404 to 301 » Settings » Logs.

View the 404 error log in the 404 to 301 plugin

The log shows the broken URL, it’s referring page, how many times the error occurred, its current status, and when it was last seen. This makes it easy to identify the most important broken links to fix first.

If you find a URL that should point to another page, then click ‘Actions’ next to it and choose ‘Custom redirect’.

Add a custom redirect for a 404 error in the 404 to 301 plugin

The plugin automatically fills in the ‘Source URL or pattern’ field. Complete the remaining fields using the same steps described earlier, then create your redirect.

You can also check the Page indexing » Not found (404) report in Google Search Console to see broken URLs that Google has discovered while crawling your website.

View 404 not found errors in Google Search Console

Frequently Asked Questions About WordPress Redirects

301 vs. 302 redirects: what’s the difference?

A 301 redirect tells browsers and search engines that a page has moved permanently. A 302 redirect indicates the move is temporary and the original URL will be used again. In most cases, you should use a 301 when permanently changing a page’s URL.

What’s the difference between a 301 redirect and a canonical tag?

Both help search engines understand your content, but they do different jobs. Use a 301 redirect when a page has permanently moved and you want visitors and search engines sent to the new URL.

Use a canonical tag when several pages have the same or similar content that should all stay accessible, but you want search engines to treat one as the primary version.

What causes a redirect loop in WordPress?

A redirect loop happens when a URL redirects back to itself, either directly or through another redirect. This prevents the page from loading because the browser gets stuck following redirects. Reviewing your redirect rules usually helps identify and fix the problem.

Should you redirect all 404 pages to your homepage?

No. Redirecting every 404 page to your homepage can confuse visitors because the content they expected isn’t there. Google may also treat these homepage redirects as soft 404s, meaning it recognizes that the original content is still missing.

Instead, redirect each broken URL to the most relevant page on your website. If there isn’t a suitable replacement, then it’s usually better to leave the page as a 404 or return a 410 Gone response if the content has been permanently removed.

If you’d rather keep visitors on your site, then you can also design a helpful custom 404 page that guides them to your popular content instead of a dead end.

Can I redirect a WordPress page to another website?

Yes. When creating a redirect, simply enter the external URL as the destination instead of another page on your website. This is useful if you’ve moved content to a different domain or want visitors to reach a resource hosted elsewhere.

We hope this beginner’s guide helped you set up redirects on your site. You may also want to see our pick of the best WordPress redirect plugins, and our WordPress SEO checklist to improve your search engine rankings.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

162 CommentsLeave a Reply

  1. How do I redirect from a wordpress blog (free) to a .com blog? I cannot install plugins in the free blog, so how could I do the redirect? Any advice?
    Thanks in advance

  2. Hello! I just created a website on Wordpress.org and imported all of my content from my old site, example.wordpress.com (using Wordpress.com). Is there a way to redirect all of the content from that site to my new one? The redirect instructions provided by Wordpress gave me an error that the domain already exists, probably because it thought I was trying to create a new domain on Wordpress.com.

    My website traffic before is pretty minimal, so if anyone clicks on previous blog posts on my social channels, they’d be taken to the shut down version of my old site without the redirects – not the end of the world because I don’t have the following that would generate clicks at a later date, but you never know?

    Any advice anyone has would be great!

    Thanks,

    Hannah

  3. Brilliant solution to reduce redirects for worpress!

    For a few days, I’m looking to solve my WP redirects issues. I don’t find out better solution even read this content.

    Here, I got few good points and try to reduce redirect to increase my page load speed.

    Thanks! :)

  4. Hello,
    Please can you tell me – in the simple 301 redirect in the request URL column does wordpress / plugin take it as starting from http or https? Form where does it pick up this value?

    Thanks for the article. It was useful. However the redirects using 301 redirect plugin is not working and landing on ‘Page does not exist’ page.

  5. Hi,

    If I want to change the url structure of my posts, even then redirection is necessary? Isn’t that already taken care of in WP?

    Also if I don’t redirect, will it be harmful for seo or search engines can figure out WP’s automatic redirection?

  6. Thanks so much, I would’ve spent so much time doing it the long way. So happy Redirection worked instantly after install.

  7. Hi Wpbeginner, I have a question about 301 permanent redirect and your advice will be great. I have an website about snoring and on that website are 2 related articles, 1 of them ranks for a lot of kws position 2-10 ( article A) and the other one just for 4-5 kws position 1-3 (article B). Both articles are on first google page and I want to permanent redirect the article B to A. Also on my website are some articles that point to article B and I want them to point to article A using same anchor texts. Now my question: Does this changes will pass the juice to article B to A and it will increase the article A rankings? And if I do this changes should I delete article B and reuse the content on other websites? Thank you very much for your time I will wait your answer, please excuse my bad english.

    • Hi Christian,

      A 301 redirect will pass the link juice to new article. However, other search ranking factors would also apply to the new article, like relevance, context, keyword density, and more. Search engines may not find it relevant for the old keywords.

      Admin

  8. Hi WP beginner team,

    A quick question.

    Last year, when we changed URLs, Wordpress was automatically redirecting Old urls to new urls.

    But after a recent wordpress core update, the automatic redirection is not happening.

    Would you be able to explain? Or am I missing anything

  9. I am changing the domain of a wordpress website example.com to example.com.ng . I tried several 301 redirect rules in .htaccess , only the homepage redirects.
    Please, assist me on the right code.

    I have tried each seperately :

    # BEGIN WordPress
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.example.com
    RewriteRule (.*) http://www.example.com.ng/$1 [R=301,L]
    # END WordPress
    

    and

    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^example.com [NC,OR]
    
    RewriteCond %{HTTP_HOST} ^www.example.com [NC]
    
    RewriteRule ^(.*)$ http://example.com.ng/$1 [L,R=301,NC]
    

    None is working for me.

  10. Do I need to own the domain while redirecting? My Domain is getting expired on 31st July and I will be redirecting to a new domain. So while it is redirected do I need to own the domain after 31st?

  11. I have over 850 old post which I recently deleted on my site due to some reasons. I want to ask if there is an easy and automated way to redirect all the old post to just one post. The methods you listed are easy to do if you are trying to redirect 1 or 2 posts. pls, help me. Your reply is important.

    • You can try the permanent redirection methods from the cPanel. You can redirect all your 404 error into particular page.

  12. Hi, this is a very helpful post thank you, but it seems like the instructions are for redirects from WP to WP.

    I am moving my website from Wordpress to New Kajabi platform.

    I have around 250 post/pages in WP to 301 redirect to my new kajabi site.
    My domain name will be the same but the url structures and names of the posts/pages will be different.

    Would the tools you recommend still work in my case? If yes, how?
    I would appreciate your urgent reply, Thank you
    Ahu

  13. One thing I’m not clear about. Actually 2 things. 1 – Do I do the redirect on my new site or my old site. 2 – Where do I get a full list of my web pages from the old site?

  14. Hi. I have a WordPress website with 100 posts. But most of the backlinks are to the post rather than to the homepage. Does any of the methods above redirect all the posts to the new URL also. I want a 301 redirect to my new domain from only one URL.not all the 90 URLs.but at the same time I don’t want to lose link juice from those posts. Please specify a way to first redirect all the old posts to old homepage then redirect the old homepage to new URL.

  15. Hi, thanks for this info, very helpful.
    So I decided to use the Simple 301 Redirects plugin… but did something REALLY dumb….
    My wordpress site is still located in a subdirectory, with the Site address set to the main url (so WordPress Address URL is http://example.com/dev2017 and Site Address URL is http://example.com and .htaccess file updated)
    There were some google search results showing the subdirectory address, so I installed the plugin and set a redirect with a wildcard for the subdirectory (obviously wasn’t thinking very well) and so now I can’t get in to the WP admin (as it’s in the subdirectory!!)
    Is there a way to undo the redirects somehow? If I uninstall the plugin via FTP is it going to break the website???
    Silly me….

    • Hey Ado,

      First you need to deactivate plugin. After that you need to delete the .htaccess file in your site’s root folder. You will be able to login to your WordPress site. Once logged in you will need to regenerate .htaccess file. Simply visit Settings » Permalinks and then click on the save changes button without changing anything.

      Admin

  16. Please, I changed the permalink of my WordPress site from http://www.example.com/blog/%postname% to http://www.example.com/articles/%category%/%postname% and ALL my previous posts are affected.

    Please help me on how to setup a onetime redirection for ALL posts.
    Thank you.

  17. What is the best way to redirct adress like that: mywbsite.com/wp-content/uploads/2008/12/mybook.pdf to normal web page. Tha it not normal wordpress page or post but is ranking on some keywoords and i would like to redirect to specyfic wordpres page. WHAT metod redirection should i use ? In that case simple 301 edirect plugin not work for me.

    thanks

  18. I have what may be a silly question. I have a site that is not a WordPress site (it’s using Shopify right now) and I am recreating the site on a new URL in WordPress. Will the redirect plugins still work to direct the old (Shopify) links to the New (WordPress) ones?

    • Hey Chrissy,

      WordPress plugins will be installed on your WordPress site. They can redirect users to correct post/page/product once the user reaches your website. You will have to redirect Shopify visitors to your WordPress site, and then redirect plugins take it from there.

      Admin

  19. I’m able to create a redirect using the Redirection plug-in, but with this problem:

    /old/ to /new/ works fine, but

    /old to /new/ picks up pages that I do not want to redirect, such as
    /old-2016 which then points to the non-existent /new/-2016.

  20. I have an annoying problem. My site had the default settings for the blog posts, so I set up redirects and changed it to the %postname% option. Unfortunately, when I do that, my home (blog) page disappears. I’ve been chasing this problem for a while. Do you have a video with a solution? Or at least a way to point me in the right direction?

  21. I want to redirect my site form wordpress.com to wordpress.org. Is there any other way to redirect for free?

    By the way,are those plugins free?

  22. I want to redirect my current live wordpress site (hosted by Hostgator) to a new domain name that I just bought from Godaddy. My questions are: 1) does my new domain name need to be hosted by HG in order to have my live site redirect to the new domain name. 2) does the new domain site need to have content already?

    Thank you for your help.

  23. Is there a way to do bulk redirects with one of these plugins? I want to update my permalinks to exclude the date, but don’t want to have to manually redirect 200+ posts. Please help!

    Also, thanks for all of your great articles. You are great at putting them in non-technical terms.

  24. i want to know if this could be done. have a user that had a site working, after i installed wordpress they wanted to change to wordpress so i created them a space and a site that calls wordpress/newsite.

    now i want:
    when typing my.old.url/site the information that comes out should be worpress/newsite

    could this be possible whith the redirect.

  25. I have deleted some of my posts from my website earlier.
    Now, I am getting not found errors for those pages as expected.
    I tried to redirect old URLs using a method provided by my hosting provider. But those redirects are not working.
    I want to ask, if I use .htaccess redirects and keep previous redirects setup on hosting provider, can it cause any problems?
    I need expert advice.

  26. Ok, I am not sure why the .htaccess method is not working for me. I would like to avoid installing any more plugins on the client’s site. They have too many already for my liking. I’ve used your instructions because what I’ve used for redirect in the past didn’t seem to be working on her site for some reason. But this isn’t either. Not sure what the problem is. Have you run into this before? I’ve flushed the Permalinks, but am still getting a 404 when I try to go to the old URL I’ve rewritten.

    • @Aslam & @Laura,

      One little got ya with 301’s and wordpress via the .htaccess file is that you need to place your redirects between:
      RewriteEngine On

      And:
      RewriteBase /

      This is because wordpress has its own mods to the htaccess file to apply and changes the RewriteBase setting which I think causes problems with regular ol 301 redirects on shared hosting.

  27. Now how wpbeginner chooses to do redirection on the site? .htaccess, Redirections plugins, or what?

    Thanks,

  28. I think in wordpress, there is no need to set redirection when changing slug of the post. It is done automatically. Right ?

    • If someone has bookmarked the old URL, for instance, or if the search engines have indexed the old URL and are still serving it in search results, you need to have a redirect in place so you aren’t losing traffic.

  29. I research everywhere and I want to confirm what I learned.

    I want to redirect my site form wordpress.com to wordpress.org. There is no other way to redirect but to pay for site redirect. Right? Is there any other option?

    If there is no other way, can I redirect every single post for free? if there is HOW?

  30. Thank you very much. You saved my day. I need this post to redirect all my old posts to new posts. I have a question though. I just forwarded the old post to the new updated post, but I didn’t delete the old post contents. My old and new post have the same contents, but I redirected the old post to new post. Should I delete the contents of the old article to avoid plagiarism issues? Does it affect my SEO? Thanks again for this valuable post.

  31. How I can have a redirect on a free wordpress account. I am pretty sure I cannot add a plug-in.

    Is it possible or if not; another way to redirect the users to my new page (which is NOT a free hosting)

    P.S gave the info about the new site as not free hosting because maybe something can be done about it.

  32. Thanks for this, but nothing is working for me. I have tried 3 different plugins – Quick Page / Post Redirect, Simple 301 Redirects, and Redirection. The only thing they are able to accomplish is redirect me when I am logged in to WP-Admin. For non-logged in users, the redirect does not work. How do I fix this?

  33. I changed a TAG name.

    How can I use your .htaccess solution to redirect old-tag to new-tag?

    Is that possible?

    Thx!

  34. Oops…my comment, which was actually a question, doesn’t seem to have struck well with you.

    It’s alright if you don’t have an answer. It just means, you need to work more & better.

    Thanks anyway :)

  35. Hi,

    Thanks for introducing the redirection plugins.

    Using the ‘redirection’ pluginsis it possible to add bulk redirects?

    The case in point is change in domain name, where you would want to redirect all pages from old domain to new domain. Adding redirects one by one for each page doesn’t sound like a good solution.

    Appreciate you help please.

  36. When using the coding way to get a redirect, do you need to include RewriteEngine On for each redirect? Or do you include it once and just follow through with each redirect on it’s own line?

  37. So, do we keep google search positions with redirects, lets say my posts i want to redirect are on the first page of google What happens after redirect? Thanks, hoping for an answer.

    • If you are doing a 301 redirect, then Google will consider replacing your new url with the old one. However, the position of that page in search results will depend on whatever content it has. For example, if your old page was about “apples” and your new page is about “oranges” then it will certainly not appear for apples related keywords anymore.

      Admin

      • Thanks, i have one more question. I forgot to tell you i want to redirect some posts from blog A, to new blog B. I can still use these techniques? I have to copy paste old content to new post on blog B then am i right ? I want content to stay the same, only want it to be shown on blog B instead of blog A. In this case google also keeps rankings or not?
        Thanks a lot again:)!

  38. Can you pls run a article on how to create a landing page or squeeze page and link it to mail chimp. Thank you.

  39. Simple but very useful information.
    I started working with WP recently and YOUR BLOG is the first point of reference when I need help.
    Thank you team for your help.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.