Beginner's Guide for WordPress / Start your WordPress Blog in minutes

Beginner’s Guide to Creating 301 Redirects in WordPress (Step by Step)

Do you want to create 301 redirects on your WordPress website?

301 redirects help fix 404 page not found errors and point users to the correct page. It helps in providing a better user experience and improving your keyword rankings.

In this article, we’ll explain what is a 301 redirect and how you can create them on your website.

Beginners Guide to Creating 301 Redirects in WordPress

What is a Redirect in WordPress?

A redirect is a way for your website to send a quick message to your reader’s browser and tell them that the page they want to visit has been moved, so their browser can automatically point them to the new page of your choice.

There are various types of redirects, such as 301 redirects, 302 redirects, 307 redirects, etc.

In this beginner’s guide, we will focus on 301 redirects as that’s the most important for your WordPress website.

A 301 redirect is permanently moving a page to a new location. It tells the browser that the page is permanently moved to the new location, and we don’t intend to move it back.

That said, let’s take a look at when you should use them.

When Do You Need a 301 Redirect in WordPress?

The primary reason to use 301 redirects is when your site or a page on your site has been moved, and you want to point the user to a new page instead.

You need to create a 301 redirect when planning on deleting a post or page in favor of new content. It is also needed when you are planning on changing the permalinks of your post or page.

If you don’t set up redirection, then it will cause your users to see a 404 page not found error. This is not only bad for your site’s user experience, but it can also impact your WordPress SEO.

404 Page example

You can lose valuable backlinks if there are a lot of broken links on your site. This would result in a significant drop in your domain authority and keyword rankings.

That’s why 301 redirects are very important. They allow you to tell search engines and your users that the page they are trying to reach has been permanently moved to a new location.

This way, all your old page’s traffic and backlinks are transferred to the new page.

Now, let’s take a look at how you can create 301 redirects in WordPress using the different methods that are available.

Video Tutorial

Subscribe to WPBeginner

If you’d prefer written instructions, just keep reading.

How to Create Redirects in WordPress With Plugins

An easier approach to create and manage 301 redirects is by using one of the many WordPress redirect plugins. This allows you to set up redirects without ever writing a single line of code.

1. All in One SEO (AIOSEO)

The simplest way to manage and create 301 redirects is through the All in One SEO (AIOSEO) WordPress plugin. It’s the best SEO plugin for WordPress and used by over 2 million professionals to improve their site’s SEO.

AIOSEO offers a powerful redirection manager addon that makes it very easy to find broken links on your website and set up 301 redirections to fix them.

Note: You’ll need AIOSEO Pro version to use the redirection manager. There is also a free version of AIOSEO, but it doesn’t include 301 redirects.

First, you need to install and activate the AIOSEO Pro plugin on your website. For more information, please refer to our step-by-step guide on how to install a WordPress plugin.

Once the plugin is active, you’ll need to go to All in One SEO » Redirects from your WordPress dashboard and then click the ‘Activate Redirects’ button.

Activate AIOSEO redirects

Next, you can click the ‘Settings’ tab under Redirects and select ‘PHP’ as the Redirect Method. It’s the simplest method for creating redirects and doesn’t require any server-side configuration.

AIOSEO also lets you select Web Server as the Redirect Method. However, it requires configuring Apache or NGINX on your web server. This method requires technical knowledge and not recommended for beginners.

Select the Redirect Method

Next, headover to the ‘Redirect’ tab to create 301 redirections.

You can now enter the link you’d like to redirect in the Source URL and enter the new destination for the link in the Target URL field. After that, select the Redirect Type as ‘301 Moved Permanently’ from the dropdown menu.

Once you’ve entered all these details, go ahead and click the ‘Add Redirect’ button.

Enter Source URL and Target URL

If you want to redirect multiple URLs to a new location, then simply click the ‘Add URL’ button under the Source URLs field.

Next, you can scroll down to view the logs of the redirects you’ve created. It shows the number of people who visited the redirected link under the ‘Hits’ column and an option to disable your 301 redirects.

View redirect logs in AIOSEO

Aside from that, AIOSEO also helps you track 404 error pages and fix them.

All you have to do is go to the Settings tab and scroll down to the ‘Logs’ section. Then enable the options for ‘404 Logs’ and ‘Redirect Logs.’

You can also select the time period to keep the logs. We recommend keeping them for a maximum of one month for smooth and fast server performance.

Enable 404 logs

After enabling these options, make sure to click the ‘Save Changes’ button.

You should now see a new ‘404 Logs’ tab appear in the Redirects section. This is where AIOSEO will track and show your broken links and allow you to set up redirections.

However, when you first enable the 404 logs, you won’t find any data. The plugin only starts to record 404 error pages after enabling the settings.

404 Logs Under Redirects

Once enabled, you can go to the 404 Logs section and see the URL of your broken links. You’ll also see the number of visits to the link under ‘Hits’ and the last accessed date and time.

Next, select the 404 error URL you’d like to redirect and click the ‘Add Redirect’ button. You’ll now see options to enter a Target URL and select the Redirect Type from the dropdown menu.

Go ahead and enter your new URL, choose 301 Moved Permanently as your redirection type, and then click the ‘Add Redirect’ button.

Click the Add Redirect button

AIOSEO will now create a 301 redirect for your broken link. To check if your redirections are working properly, simply visit the old URL and check whether they open the new target destination.

2. Redirection

Another way to add and manage redirects in WordPress is by using the Redirection plugin.

First, install and activate the Redirection plugin on your site. You can follow our detailed guide on how to install a WordPress plugin.

Once activated, visit Tools » Redirection and then click the ‘Start Setup’ button to set up the plugin.

Start setup of Redirection plugin

Next, you can select options to monitor permalink changes in WordPress and keep a log of all your redirects and 404 errors. You can simply enable these options and click the ‘Continue Setup’ button.

Basic setup Redirection plugin

The plugin will now test the Rest API. When the status comes back as Good, go ahead and click the ‘Finish Setup’ button.

Rest API test in Redirection

After that, you can go to Tools » Redirection » Redirects and create your 301 redirects.

You’ll see the basic settings to add a redirection. However, if you click the gear icon, you’ll see more options to choose your redirection type.

Basic settings in Redirection plugin

After clicking the gear icon, simply enter the Source URL of your old page and add the Target URL you want to redirect to.

Next, set the HTTP code option to ‘301 – Moved Permanently’ from the dropdown menu. Once you’ve entered all the details, go ahead and click the ‘Add Redirect’ button.

Add new redirection to your website

3. Page Links to

Sometimes you may want to keep a post or a page but redirect it to another post or page. This is where Page Links to comes in handy.

This simple plugin adds a meta box on your WordPress editor where you can enter the address of the new location where you want to send your users.

Page Links to in WordPress editor

4. Simple 301 Redirects

Another easy-to-use plugin is Simple 301 Redirects. As the name suggests, it makes 301 Redirects simple.

To start, you’ll have to install and activate the plugin on your website. If you need help, follow the instructions in our guide on how to install a WordPress plugin.

After that, visit Settings » 301 Redirects and enter your old URL under the Request field and your target URL under the Destination field.

Once you’ve entered the details, click the ‘Add New’ button to set up a 301 redirect.

Simple 301 Redirects

While setting up 301 redirects using a WordPress plugin is easy, it has some minor performance setbacks. Based on your WordPress hosting provider, your WordPress redirects may be a bit slower by some microseconds.

If you want to make your redirects faster, you can do so using the code method and .htaccess file.

Setting Up 301 Redirects in WordPress using .htaccess

WordPress users can also set up 301 redirects by editing the .htaccess web server configuration file.

Please keep in mind that a small mistake in your .htaccess code can make your WordPress site inaccessible, and it may start showing Internal Server Error.

That’s why it is important that you backup your .htaccess file before making any changes.

Edit your .htaccess file using All in One SEO plugin

The easiest way to edit your WordPress .htaccess file is by using the All in One SEO for WordPress.

Simply install and activate the All in One SEO plugin. After that, you need to visit All in One SEO » Tools page and switch to the .htaccess Editor tab.

Editing .htaccess file using All in One SEO

From here, you’ll see the contents of your .htaccess file in the editor. You can simply place any redirect code that you want to add at the bottom.

Here is a simple redirect where we are trying to send a user visiting an old post to a new post.

RewriteEngine On
Redirect 301 /a-very-old-post/ http://yoursite.com/a-very-new-post/

Don’t forget to click on the Save Changes button to store your settings. All in One SEO plugin will then update your .htaccess file.

Directly Edit Your WordPress .htaccess file

You can also edit your WordPress .htaccess file directly to set up any redirects.

To edit your .htaccess file, you’ll need to connect to your website using an FTP client. The .htaccess file resides in your WordPress site’s root directory.

If you can’t see your .htaccess file there, then you need to force your FTP client to show hidden files. (See why you can’t find .htaccess file on your WordPress site.)

You can edit the .htaccess file in any plain text editor like Notepad.

Here is a simple redirect where we are trying to send a user visiting an old post to a new post.

RewriteEngine On
Redirect 301 /a-very-old-post/ http://yoursite.com/a-very-new-post/

You can add the code above, preferably at the end of your .htaccess file.

Don’t forget to save your changes and upload your .htaccess file back to the server. After that, you can test your redirect to make sure it is redirecting properly as you intended.

We hope this beginner’s guide to creating WordPress redirects helped you set up redirects on your site. You may also want to check out our guide on how to start a WordPress blog the right way, or see our list of the best email marketing services for small business.

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.

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

144 CommentsLeave a Reply

  1. I actually don’t have any problems while doing redirects, however, I have more than 50 redirects and plan to do more. Does this cause a problem as I also need to delete categories and some posts?

  2. i have made redirection with plugin “Redirection”then i deleted the redirection item from Redirection’s setting ,but i want to get it back the same what should i do

    • The simplest method would be to recreate the redirect rather than attempting to restore it.

      Admin

  3. I have transfer my site from a domain to a brand new domain. how can I do the 301 redirect without entering address by address?
    I mean I want to define something like this : all URLs of example.com goes to example.net for example.
    thank you so much in advance.

  4. I have the redirects set up and working great, but I have a question about finding and replacing all these redirected urls.

    Is there a way to find/replace them across your complete WordPress site? Not just within the WordPress database, but also within personal HTML code, and urls within tables using TablePress added to the website.

    I’m looking for a global find/replace solution, is there one?

  5. Is there any chance I can implement 301 in free WordPress.com? It says I’m not allowed to install plugins. Only if I’m on business plan. And I want to migrate to WordPress.org

  6. Hi,

    I have done a redirect some time ago using ‘Redirection’ plugin.

    But now I cant find that url in the plugin. Even there is no code for that url in htaccess file too.

    I want to disable that redirect now. Is there any way to do this? Pls help?

    • If the redirect is not in the plugin, you would want to check your htaccess file or reach out to your hosting provider for their assistance with finding the redirect.

      Admin

  7. If I’m redirecting several web pages (not posts), do I make duplicates of the code you showed above (both lines 1 and 2) for each of the new page I am redirecting? And do I keep copying those codes at the bottom of the .htaccess file?

    I read another article that suggests adding redirection codes in the functions.php file in the theme folder. The code is long and seems complicated. But I wonder, which option is more efficient — editing the .htaccess or editing the functions.php?

    • You would add a new version of the second line of code, you only need the first line once. For where the redirect happens it is personal preference on which method is best.

      Admin

  8. Hi

    Apparently my site has a 301 redirect on it, but I cannot discover where this is, nor what it is redirecting. There is nothing in the htaccess file. The site was originally built using a different name on localhost, and all the urls were changed to become the new domain name. Could this be the problem? How do I track down where the 301 is because it is causing problems with the SSL certificate. Thanks

    • Updating the urls shouldn’t be an issue if they were updated correctly. If you reach out to your hosting provider they should be able to help you find what is causing the redirect.

      Admin

  9. I can’t thank you enough for this simple guide as I’ve always been told to not touch redirects unless you know what you’re doing, so my seo suffered a bit because I ended up not doing anything. Fact is, I know enough and can follow instructions if they’re not written for developers and I don’t have to rely on a plugin that may cause problems later ’cause they all do at some point, right? Thank you. This link is going in my toolbox to share with others having the same problem.

    • You’re welcome, glad our guide could be helpful for you and anyone you share it with :)

      Admin

  10. I used the method in the video, but my site still has Uncategorized listed at the top and the side. I tried to find the third part of the video about changing the 301 redirect links in my settings, but it is not there. However, when I click on Uncategorized it changes to general, but when I visit my site again or refresh it is back to Uncategorized. The plugin for redirects said it was compatible with my theme. Any help is appreciated, thank you.

  11. Hey there! thank you for the helpful info! I am wondering does this plugin work for a change of domain on my blog? I recently changed my domain and read that it is very important to implement a 301 redirect in order to not lose rankings and exposure. Would this do the trick? If so, would I put my old domain in the source line and the new domain in the target line?

    Thank you!

  12. Can I use “page links to” and “redirection” one the same site?

    They seem like they serve different needs, but I have seen warnings that you shouldn’t use more than one redirection plugin at a time. True?

    I like redirection features, but I like having something on the “edit post” view that I can use to set up a redirect (e.g., teaser/excerpt linking out to a landing page or to another site). Thanks!

    • We would not recommend using the two plugins at the same time to prevent any conflicts between the two, you could check with the plugin authors for if there is a recommended method for the two plugins to work together.

      Admin

  13. I migrated a WP website to a new domain and set up a redirect from the old domain to the new one within cPanel. The redirects are nearly instantaneous (that’s good, right?) but I’d like to delay them for a few seconds, long enough to display a screen on the old homepage explaining why they’re being redirected.

    I’m not a programmer. Is there a plugin that will allow me to adjust the time before the redirect occurs? TIA

    • Unless I hear otherwise, we do not have a simple method we would recommend to set that up sadly.

      Admin

  14. Hello,
    A great post by the way.
    I have numerous pages which have been redirected to new urls, I have updated all page link urls to the new urls, so no broken links on front end.
    My question is after a few months is it safe to delete any redirects which were created?
    Many thanks.
    Lee

    • If there are no references to the broken links you could remove the redirects, otherwise it may be best to keep the redirects active.

      Admin

  15. Hi, I have been using the redirection plugin for a while now trying to sort my old posts out from when I first started ( the permalinks were awful )
    What I have been doing is creating another post with a better permalink and copy and pasting the content from the old URL to the new one and then 301 redirecting them.
    After reading this post I’m starting to think that I don’t need to create a completely new post but just change the permalink on the old one and redirect it like that, Am I Correct?
    If so, can I delete all the old duplicate posts from before or should I leave them as they are?
    Thanks if you can help :)

    • Correct you can modify the permalink and redirect without the need for the old post to be active. As long as the redirects are in place you can remove the old posts if you wanted.

      Admin

      • So just to clarify, I can delete the old posts that I copied and pasted into a new one and redirected the URL, and that all I have to do is to modify the permalink and not copy and paste the whole URL into a different post but just redirect the old permalink to the new one?
        Thanks so much for replying to me, you have saved me so much time if that’s the case :)

  16. Hi, I recently duplicated a site. Let’s say the original site’s url is original.com and I created a subdomain http:testsite.orginal.com where the duplicate site is located. Now, the question is how do I do the redirection with this kind of setup. I want to make the site at original.com to be the main site.

    Thanks

  17. Hi – thank you for this! Love you guys. I downloaded the plugin and have redirected some pages. Can you tell me if I should redirect mysite.com to miresite.com/ – how do I do that? somewhere along the line the “/” fell away. There were 4 different redirect plugins on the WP site I am working on for a client and the site crashed last week – I deactivated them all and installed this one – all is good except for the/ thing. Am I even asking a logical question?

    • You shouldn’t need to worry about redirecting the site to an address with a / at the end

      Admin

      • Hi – I have now discovered that my page mydomian.com/ is being redirected to mydomain.com – without the /

        I don’t know where this happened or how except from possibly one of the plugins I downloaded?? It is a 301 and I do not know now if this has damaged anything? All the search results show the address with the /. but when the result is clicked it go to the non /. please can you help or send me to somewhere that can help of fix

        • You would first want to take a look at your plugins if any of them are designed for redirects you would want to see if that is set there. If none of those are causing the redirect you would want to see if the redirect is created in your htaccess file or under Settings>General if the address was changed there.

  18. does this work the same for 302 redirects in an htaccess file? A client has asked to 302 redirect around 800 urls from a wordpress site to a Wix site. There are moments when it all operates fine, then we get several 404’s. Not sure if it’s because there are way too many urls or if we are overlooking something?

    • The htaccess method would work for 302 redirects if you changed the number to 302. 302 redirects are temporary which could be part of your problem as well as your caching.

      Admin

  19. I have a WordPress site. I face some problem. I am using the woo commerce plugin. Woocommerce site automatically added product category page in my permalinks as- google.com/product-category/up/this-is-my-page. I want to redirect this link like- google.com/this-is-my-page. how can i solve this? any help

    • For editing WooCommerce’s permalinks, you would want to check under Settings>Permalinks to modify them. If you take a look at WooCommerce’s documentation they explain more in depth. :)

      Admin

  20. Hi, Wp beginnger, if you could help me i will be do happy, I used the Htacces code and it worked perfectly. But i want My Media Files to redirect to itself,
    So is there a code to stop The d=redirection in Wp-contents Folder..pls help me my Website is Dieing

  21. Hello, does this redirection works for a URL complete change?

    For example, I’m using olddomain.com and I bought newdomain.com, and want to redirect olddomain.com to open up newdomain.com.

    Any help on that??

        • You can do that by adding the following code to the .htaccess file on your old site.

          RewriteEngine on
          RewriteCond %{HTTP_HOST} ^oldomain.com [NC,OR]
          RewriteCond %{HTTP_HOST} ^www.olddomain.com [NC]
          RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301,NC]
          
  22. How can I redirect a single homepage to another domain but the rest of the pages from my redirected domain won’t be affected?/

  23. I have a subdomain for affiliate store. I want to know how to redirect from my site page to subdomain page. Please help.

  24. Thank You so so much! I have been blogging for about 8 months and have worked so hard to build my Pinterest account. It is where almost all my traffic comes from. A month ago I changed over to https and I didn’t realize until last night that none of my pins were redirecting to the https. I just fixed it all thanks to you!

  25. thanks for the information. i have small doubt how can i redirect old post to new post without loss of comments. i mean i need previous comments

  26. Just FYI – the screenshots are out of date I think. Under Add New Redirection, I just see Source/Target URL and Group.

  27. Hi, I am trying to find a way to redirect to a single page similar to a 404 when a user enters a non-existent subdomain. for example if they mash the keyboard or make a typo when keying in the domain. I want to get rid of the standard wordpress ‘No Results Found…The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.’

    Can someone point me to the solution of this problem? Or what this is called so I can try find the solution? All I’m getting is results about making my multisite a single url…

    Thank you!

  28. I only want to redirect when a visitor to my website clicks on an external link from my website. For example, if you were to click on a product from my page it would then redirect you first to a “You are being redirected” page, then off to the affiliate’s website.
    I have been spending hours trying to do this. Please help. At this point I just want to know if it is possible with any wp plugin or any other workaround and if so how to do it.

  29. 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

  30. 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

  31. 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! :)

  32. 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.

  33. 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?

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

  35. 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

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.