Are you trying to create a redirect in WordPress? Not sure what a redirect is and why it is important? Don’t worry, we have got you covered in this beginner’s guide to WordPress redirects, we will cover what a redirect is, how to create a redirect in WordPress, why do you need, and when you should use redirects.
Ready? Let’s get started.
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 different types of redirects such as 301 redirect, 302 redirect, 307 redirect, etc.
However to keep this article simple and useful, we will only cover 301 redirects as that’s the most important.
Let’s take a look at why it is important by understanding the use case.
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.
This article idea came to us when one of our readers asked us for a way to redirect users from an old post to a new post.
– You need to create a redirect when you are planning on deleting a post or page in favor of new content.
– You need to create a redirect when you are planning on changing the permalinks of your post or page.
Why? Because not creating a redirect will cause your users to see a 404 not found error. Which is not only bad for users, but it can also impact your site’s SEO and hurt your search engine rankings.
That’s when 301 redirects become very important.
It allows you to tell search engines and your user’s browser that the page they are trying to reach has been permanently moved to a new location.
This allows for all your old page’s traffic and backlink (SEO) strengths to be transferred on to the new page.
Now that we have covered the why and when of redirects, let’s take a look at how you can create 301 redirects in WordPress using the different methods that are available.
Video Tutorial
If you don’t like the video or need more instructions, then continue reading.
How to Create Redirects in WordPress (using Plugins)
An easier approach to create and manage 301 redirects is by using one of the many WordPress redirect plugins. This allows you to setup redirects without ever writing a single line of code.
1. Redirection
The simplest way to add and manage redirects in WordPress is by using the Redirection plugin. Install and activate the plugin. Once activated, visit Tools » Redirection to setup your redirects.
Redirection plugin not only allows you to setup redirects, it also helps you find out 404 errors on your WordPress site. You can then redirect those URLs to an appropriate destination. See this tutorial on how to track 404 pages and redirect them in WordPress.
2. Page Links to
Sometimes you may want to keep a post/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 post edit screen where you can enter the address of the new location where you want to send your users.
3. Simple 301 Redirects
Another easy to use plugin is Simple 301 Redirects. As the name suggests, it makes 301 Redirects simple. Simply install and activate the plugin and then visit Settings » 301 Redirects to add your URLs.
Now while setting up 301 redirects using a WordPress plugin is easy, it has some minor performance setback. Based on your WordPress hosting provider, your WordPress redirects maybe a bit slower by some microseconds.
If you want to make your redirects faster, then you can do so by using the code method and .htaccess file.
Setting Up 301 Redirects in WordPress using .htaccess
Using the web server configuration file .htaccess, WordPress users can set up 301 redirects that are fast.
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.
To edit your .htaccess file, you will 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 .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.
That’s all. We hope this beginner’s guide to creating WordPress redirects helped you setup redirects on your site.
You may also want to check out these 9 most useful .htaccess tricks for WordPress.
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.
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.
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.
You would want to take a look at the redirect in our article below:
https://www.wpbeginner.com/wp-tutorials/how-to-properly-move-wordpress-to-a-new-domain-without-losing-seo/
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?
You could either use an analytics tool to find where the link is on your site or you could take a look at a plugin from our previous article below:
https://www.wpbeginner.com/plugins/search-and-replace-plugin-for-wordpress-database/
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
For moving your site from WordPress.com to org you would want to go through our guide below: https://www.wpbeginner.com/wp-tutorials/how-to-properly-move-your-blog-from-wordpress-com-to-wordpress-org/
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.
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.
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.
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
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.
It sounds like you’re trying to remove the uncategorized category from your site. If that’s the case you would want to take a look at our article here: https://www.wpbeginner.com/beginners-guide/rename-the-uncategorized-category/
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!
You would want to take a look at steps 4 and 5 in our article here: https://www.wpbeginner.com/wp-tutorials/how-to-properly-move-wordpress-to-a-new-domain-without-losing-seo/
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.
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.
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.
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.
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
Correct, glad we could help
Once I have set up the redirect, what do I do with the original post, delete it?
While not required, most people do that if they no longer want the old post.
Thank you this is just what I was looking for!
Glad we could provide the answer you were looking for
After setting a redirection can I trash the page?
Yes you can
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
For moving your site from a subdomain, you would want to take a look at our article here: https://www.wpbeginner.com/wp-tutorials/how-to-properly-move-wordpress-from-subdomain-to-root-domain/
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
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.
Great, thank you, I went with the .htaccess redirect, exactly what I was looking for.
Glad we could help
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.
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.
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
Great Information helps me to get out of a serious issue
Thanks for this! I needed the Redirect plugin. Didn’t know it was a thing
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??
Hi Emmanuel,
If you do that on your old website, then you will not be able to access it as the plugin will redirect you and your users to new domain name.
Oops, so how can I achieve this?
You can do that by adding the following code to the .htaccess file on your old site.
How can I redirect a single homepage to another domain but the rest of the pages from my redirected domain won’t be affected?/
Thank you for this guide. Helped me a lot for a client’s request.
I have a subdomain for affiliate store. I want to know how to redirect from my site page to subdomain page. Please help.
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!
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
Thank you so much. I spent so many hours looking for this and finally got the answer here.
Just FYI – the screenshots are out of date I think. Under Add New Redirection, I just see Source/Target URL and Group.
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!
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.
Hi Abdul Rehman,
It is certainly possible, but we are not aware of a plugin that does it.
Is there a way to redirect using htaccess and that it will be opened in a new tab?
Hi
Is it possible to make a redirect from the wix platform to wordpress?
Hi Laura,
Please see our guide on moving Wix to WordPress.
Which plugin is best to create referrel links like:
Thanks
Hi Hafiz,
Thirsty Affiliates is the best way to manage your affiliate/referral links. Please see our guide on how to cloak affiliate links in WordPress.
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
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
your lesson is very helpful. i like it.
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!
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.
Hi Roshni,
It uses your WordPress Site Address as defined in WordPress Settings > General page.
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?
Very helpful. Thank you for the tip. Thank you for making it so simple.
Melissa
Thanks so much, I would’ve spent so much time doing it the long way. So happy Redirection worked instantly after install.
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.
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
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 :
and
None is working for me.
Thank you so much! I am very grateful.
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?
Hey Shubham,
Yes, you will need that domain for your redirects to continue working.