Protect your sites from hackers and boost performance with Sucuri’s Junior Dev Security Bundle — now $500 off.
The Best Way To Set Up Redirects In Your WordPress Blog

The Best Way To Set Up Redirects In Your WordPress Blog

The Best Way To Set Up Redirects In Your WordPress Blog

There are 101 reasons why you might need to redirect one URL to another, but it is not a feature that comes as standard in WordPress. Fortunately, there are quite a few plugins out there that can handle URL redirects for you. I know, because I have used a lot of them. Some very simple, some rather complicated. But in my opinion, by far the best redirection plugin available is the aptly named Redirection.

There is just one problem – compared to other less complicated redirection plugins, Redirection can seem rather overwhelming. Whilst you can use something like the simple Quick Page/Post Redirect Plugin, you would be far better off installing its bigger brother and taking a few minutes to better understand how it can better serve you.

Setting Up Redirects

Once you have installed and activated Redirection, you can access the plugin’s screens by hovering over the Tools option in your sidebar and selecting the appropriate option.

You will then be presented with the Add New Redirection screen:

Add New Redirection

There are a few potentially confusing options here, but don’t worry – if you just want to set up a simple redirect, you don’t need to do anything out of the ordinary. Just enter the URL for which you want to set up the redirect in the “Source URL” box, and the destination URL in the “Target URL” box. Hit “Add Redirection”, and you’re all set! That’s all there is to it.

Here’s a little tip to save you time – you do not need to enter your site’s domain in the “Source URL” box – just the extension. Let’s say your site was “http://www.mysite.com/” and you wanted to redirect the URL: “http://www.mysite.com/myurl/”. In order to set up the redirect, you only need to type in “/myurl/” in the “Source URL” box – the plugin will do the rest for you.

Groups

If you are going to be doing lots of redirects, it would be advisable to group them by type.

For instance, let’s say I wanted to create some URLs to mask affiliate links on my site (so that when my visitors hovered over a link, they saw “http://www.mysite.com/recommends/product/” rather than “http://www.affiliatesite.com/youraffiliateid”). It would make little sense to have these redirects bunched in with other unrelated ones. So I should set up a group for my affiliate links.

First, click on “Groups” from any of the plugin’s screens:

Groups

On the resultant screen, you can add and manage your groups. Using the example above, let’s type in “Affiliate Links” in the add groups box, and hit “Add”. The group is then listed on the page:

Affiliate Links

To add redirects to a specific group, just click on it and then enter redirections as normal in the subsequent screen.

Fix 404s With Ease

You know that we’ve been going 404 error crazy on the blog here recently, and with good reason – no one likes seeing them. But fear not – Redirection has an excellent feature that logs 404 errors:

404 Error Log

Setting up a redirect from one of these 404 errors to the intended page is just as simple as clicking the green plus icon to the right of the link, and then entering the target URL.

If you want to set a particular 404 error so that it is ignored in the future, just add the URL as a redirect and select “Do nothing” from the “Action” drop down box. It would be a good idea to keep all such redirects in an appropriately named group.

Click Tracking

There are many reasons why you might like to keep track of clicks on a particular link, and Redirection has a built-in ability to do so – even for URLs that you do not wish to redirect.

Say you wanted to track how many times your visitors visited a specific external website linked to from your blog. All you would need to do is add the website in question as a Source URL as you would do for any redirect, but then select “Do nothing” from the “Action” drop down box (as you did above for ignoring 404 errors). The URL will show up as a redirect, and you will be able to see the number of times it has been clicked to the right of your screen. You can even click on the URL to give it a name:

Click Tracking

Speed

Making sure that your site doesn’t get bogged down by plugins should always be a key priority. With that in mind, there are three things you should pay attention to regarding Redirection, which are found in the Options screen:

Logging

If you do not need to log redirect or 404 requests, uncheck these boxes. In all honesty, I don’t believe that keeping these boxes checked will have a major impact on most blogs. What you should however make a change to is the log expiry option found just below. If you leave the option set to zero, data will be collected indefinitely. Far better to keep things a bit more manageable – I would suggest you set items in the log to expire after 30 days.

Tip: Learn about asynchronous plugins to improve page speed

Further Reading

Redirection is capable of doing even more than what I have outlined above. If you are not afraid of getting your hands a little dirty, check out the pretty comprehensive user documentation that the plugin’s developer published here.

Download Redirection here.

Tom Ewer Avatar

93 responses

  1. Phillip Bryan Avatar
    Phillip Bryan

    This was great – setting up redirection on my site was super simple. Thanks!

  2. Sherese Duncan Avatar
    Sherese Duncan

    Finally! I found the information I was looking for. You’re right, Redirection has many features that are great for tracking. Thanks for sharing.

  3. FreddFDR Avatar
    FreddFDR

    I need a redirection tool that will load another website and still open my own post. Is that really possible. Something like all this clicksor sort of?

  4. Wine Dine Avatar
    Wine Dine

    Will give it a try. Looking for more of an automatic script, but this seems very precise.

  5. Randy Young Avatar
    Randy Young

    Thanks for this, it got me exactly what I was looking for. Much more versatile than SimpleURL.

  6. Barry Paul Price Avatar
    Barry Paul Price

    THanks! That works great!

  7. Optimator Avatar
    Optimator

    Great plugin, just what I was looking for. Thanks a lot!

  8. apps for mobile Avatar
    apps for mobile

    Hi Tom
    How i could use this plugin auto generate my aff link by php code?

  9. Nick Avatar
    Nick

    Thanks for writing this article. I was able to redirect one of my pages for my baseball site to ESPN Standings.

  10. Jalyn Avatar
    Jalyn

    This is the plugin that I am looking for. If I wish to redirect http://paauk-usa.org to http://paauk-usa.org/paauk_usa, I have to put ‘/’ in source and /paauk_usa/ in target field. Is it correct?

    I downloaded the plugin and I tested some redirection urls. Then I deleted all testing URLs. But it is still working even I had deleted. Then, I tried to uninstall plugin, it’s still working. Do I have to do something? How should I fix it?

    Thanks!

  11. Niche Master Avatar
    Niche Master

    I came to this page because I was looking for a reason why my website does a page redirect when i look at google page speed. Just wondering if anyone knows how to cache that?

  12. Akiko Avatar
    Akiko

    Hi, I’m sorry that my question might sound really stupid, but would really appreciate some help. I’ve ‘moved’ my blogger to wordpress, except that I didn’t do any importing – I manually copied all my posts to wordpress. Now I’m trying to do a redirect, but realize that because I hadn’t done it by way of the normal ‘importing’, it seems that all the plugins won’t work for me. I can’t do the importing now, it’s taken me a long time to copy the posts and format everything on my new wordpress site. Are there any other options for me now? Hope you could help me with this, thank you very much!

  13. Jeremy Avatar
    Jeremy

    I was going to install this plugin based on your review, but was a little concerned that I should select a different plugin since Redirect hasn’t updated in 365 days and is out of date with the current WP version (which i’m using). Any thoughts? People still seem to be using it, but I worry there’s no more support or updates for it to keep up with WP changes.

  14. Lasse Avatar
    Lasse

    Once Again, a very good guide from Tom! Explains many of my questions regarding redirecting in WordPress. Thanks Tom! 🙂

  15. Neeraj Bansal Avatar
    Neeraj Bansal

    Will you please help me to get a plugin which will redirect 404 error page to randomly any post or to post which closely resembles to the search query.

  16. Robinson3d Avatar
    Robinson3d

    That is nice. But is there no way one can make the plugin redirect any of your web page that is showing 404 error pages automatically?

  17. Istiak Rayhan Avatar
    Istiak Rayhan

    Hey Tom,
    Nice guide on redirection. I was not aware about making Group in Redirection Plugin.

  18. Paul Avatar
    Paul

    Hi.

    One thing that isn’t clear in all I’ve read about the Rediretion plugin….

    I set up a new WordPress blog. Imported a select number of posts from the old WordPress blog.

    When I setup redirection, do I do it once for the whole site, or do i have to enter each individual like per post?

    ie. Just http://www.mysite.com redirects to ‘mynewsite.com’

    Or do I have to add a 301 for each like

    http://www.mysite.com/post1 redirects to ‘mynewsite.com/post1’
    http://www.mysite.com/post2 redirects to ‘mynewsite.com/post2’
    http://www.mysite.com/post3 redirects to ‘mynewsite.com/post3’
    http://www.mysite.com/post4 redirects to ‘mynewsite.com/post4’
    etc.
    etc.?

    Can you clarify this?

    Ideally I just need to do one major redirect.

    Any insight is appreciated.

  19. Greg Avatar
    Greg

    Hey Tom,

    Apologies for dragging up an old post, but is there anything else as powerful as Redirection on the market that is kept up to date? Like the commenters earlier in this post, I’m pretty concerned with the folks saying it has been buggy with the last few versions of WP.

    Any recommendations or confirmations the plugin still works would be greatly appreciated! 🙂

  20. Avtar Singh Avatar
    Avtar Singh

    hi, nice post…but i want know that can we redirect 404 pages without using plugin..???

  21. Nosa E Nosa Avatar
    Nosa E Nosa

    Hey Tom,

    Thanks for the great post, I had already downloaded Quick Page/Post Redirect Plugin, but I decided to one last search and it lead me here.

    The Redirection plugin works like a charm. Thanks alot.

  22. Mio Avatar
    Mio

    Thanks to you, we installed Redirection for some quick and easy 301 redirects after we changed our permalink structure.

    Thank goodness because some of our most viewed posts were actually deadlinks after we switched our permalink structure.

  23. Michael Avatar
    Michael

    Great Post! I recently came across a premium plugin that does this with comments. Its called Comment Redirect (http://www.commentredirect.com) it also has a opt in pop-up to increase subscribers. If anyones interested in such a thing check it out its a very impressive redirect plugin.

  24. Chris Avatar
    Chris

    Great article, thanks so much! It also saved me from paying WordPress’ $13/year to do this same thing! =)

  25. Nikhil Avatar
    Nikhil

    This Plugin has been officially closed by WordPress due to multiple Security Vulnerabilities reported by me. Please DO NOT use this plugin any further. Also it is removed from downloads. Also there are 2 more plugin that is removed see here https://twitter.com/niksthehacker/status/385485630534189057/photo/1

  26. Line Hostmalingen Avatar
    Line Hostmalingen

    Thanks Tom, a useful tip of the day! (some days later 😉

  27. Srjtech Avatar
    Srjtech

    Tom, do you have a bit more list of plugins meant for just affiliate tracking, because I’ve been using the redirection plugin for some time and now I had to remove it because of server issues. Is there any plugin where I can export the data?

  28. Steve Avatar
    Steve

    I want to redirect all pages beginning with /news/ to the /News/ page but I cant work out how to do a wildcard equivalent to *

  29. Don Avatar
    Don

    Hey Tom. Great article as your directions seem pretty clear, but I’m mystified that I’m still having a problem.

    I’m trying to create a landing page for a print ad. All I’m trying to do is have a user type in “domain.com/gelpens” into a browser and be redirected to the landing page. Strangely I’ve followed your directions to a T and I’m getting this error:

    Not Found
    The requested URL /gelpens was not found on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    I’m not entirely sure what I’m doing wrong here. Thanks in advance.

  30. PrIyAnGsHu Avatar
    PrIyAnGsHu

    Hey Tom, I’m looking to redirect my whole WordPress blog to another domain. Actually, I have set up my current site on a new domain and I want to redirect the current domain to the new one, probably a 301 permanent redirection. Is doing a 301 redirection through .htaccess file, the right way to redirect a WordPress site to another URL? Or is there any other better way?

  31. Arafin Rubab Avatar
    Arafin Rubab

    Great tips.
    I have done my url redirection by using your tips.
    Thanks a lot for sharing. Keep it up.

  32. Jody Heath Avatar
    Jody Heath

    Hi Tom,

    So it’s been a little while since you wrote this post. Would you still say “redirection” is your top pick for plugins?

  33. Jody Heath Avatar
    Jody Heath

    Sorry for the double posting. Just to clarify (although you probably read b/w the lines), in the previous question, I was referring to only the category of redirection plugins.

    2nd question, in terms of duplicate content, once we’ve changed an old url, do we need to go into Google webmaster and request them to un-index the old url which we just redirected?

    Thanks!

  34. Ryan Avatar
    Ryan

    Maybe I misunderstood what you said, but you can redirect in WordPress with just a few lines of code at the top of the page you want the redirect on:

    <?php if(! is_user_logged_in()) {
    wp_redirect( home_url() );
    exit;
    }

    Why everybody use plugins for everything when most of this stuff is in the WP core API.

  35. Gerry Anderson Avatar
    Gerry Anderson

    Well done Tom! This worked very well to solve our redirect issues. You did a great job of education. How can I give back to you for this help? I really appreciate it.

  36. kieron Avatar
    kieron

    Hi there TOM, many thanks for your great instructions. My url is being redirected without any hassles. NICE ONE! its been really hard finding a plugin that just does the job without the bollocks!

    Thanks ive bookmarked you, regards k

  37. Mary Avatar
    Mary

    I am wondering about page rank and Google listing following with the redirect. I have been writing for 3 1/2 years and moving to a new domain, I don’t want to lose all that good google stuff I have earned. Will every single page and post follow? And what about RSS feed, will it follow too? Thanks for the help!

  38. Hannah Ransom Avatar
    Hannah Ransom

    I got this plugin a while back and I also love it. Problem is, now I just made my landing page into a separate “landing site” and the plugin won’t redirect to a different domain 🙁

    OR, do I just not know how to use this feature. Please let me know if you have any idea how to do that.

  39. Breedstraler Avatar
    Breedstraler

    Very useful post!
    Thank you

  40. Hollywood Movies Avatar
    Hollywood Movies

    Nice All Web Master Useful Posts And Site Like

  41. led lampen Avatar
    led lampen

    Well done Tom! Great Post!

  42. Will Franco Avatar
    Will Franco

    Watch out with the Redirection plugin though!

    a. Issue with and without trialing /

    b. Currently, I have to setup two redirects per URL

    ​If I don’t the URL that’s not setup in redirection will 404.​

    source: http://www.yourwebsite.com/thank-you-page/
    target: http://www.yourwebsite.com/swvd/

    if the url is http://www.yourwebsite.com/thank-you-page
    i.e. without the trailing slash it 404’s

    the bug is easy to miss!

    and the plugin documentation doesn’t specific you actually need to create two redirects per one.

    if you visit the target page by clicking the source first it will work

    and then if you visit the non-trailing slash it will work

    you have the visit the non-trailing slash first to get the 404 (i.e. like a visitor of your site)

    and it seems nobody is talking about this either.

  43. Satpal Singh Kajla Avatar
    Satpal Singh Kajla

    Thank you very much. I don’t know much about coding therefore it’s treasure for me. Thanks a lot.

  44. Dawid Ziółkowski Avatar
    Dawid Ziółkowski

    Good article, but what do you think about SEO Redirection Plugin (https://wordpress.org/plugins/seo-redirection/)? I tested it on a few of my sites after changing the domain and CMS (form other to WordPress) and it worked very well. It’s similar to Redirection plugin (you can set rules, handle 404 errors, keep logs etc), it’s under active development and has nice interface.

  45. Gung Avatar
    Gung

    Wow.. finally I could make the redirect url with redirection plugin. Nice post! Thank you.

  46. Ron Richardson Avatar
    Ron Richardson

    We’ve moved from a non-wordpress site that’s pure php to WordPress. I want to redirect files like: http://same-domain.com/contact.php to http://same-domain.com/contact/

    Will this plugin do that? I’ve tried a few but still get 404’s. If not, then ?

  47. Srp Avatar
    Srp

    Thanks for this, Is it possible to redirect from unused deleted website page to new website page using these redirect plugins.

  48. Elrond Burrell Avatar
    Elrond Burrell

    This rescued me this morning from my own mistyped URL in an email newsletter, thanks so much!

  49. Andrew @ Forever Formula Avatar
    Andrew @ Forever Formula

    Thanks! I needed the ability to redirect and track how many hits were passed through. This was very helpful.

    Andrew.

  50. Aanya Rajput Avatar
    Aanya Rajput

    Thanks for the detailed information about the Redirection plugin but I am in a trouble right now as for one of my blog I had mistakenly redirect the wrong url and then delete it from the redirection but still it is redirecting that url to the new one. Now my question is how to bring it back to normal.

  51. project Avatar
    project

    Hi
    thanks for sharing this, but I think this kind of plugins increase the server load time and resource usage especially on shared hostings

  52. Kristopher Avatar
    Kristopher

    Thanks for your post. I was having trouble with my redirections, but now they’re up and working just fine!

  53. Kama Avatar
    Kama

    Aha!! finally I found a great redirect plugin instead of using a shortcode for my web. Thanks for the help.

  54. Ruang Sehat Avatar
    Ruang Sehat

    Hi Tom, thanks for your useful tips. I just want to ask if I have subdomain and I have deleted it. Now I want to redirect all of subdomain url just from httaccess. Can I? and how the code I must write? Thanks

  55. David Avatar
    David

    I don’t know much about 404 error pages because I had started my blogging career recently.

    But somewhere I read that If any blogger or writer deleted the existing web page then the URL of that web page becomes 404 URL and that page becomes 404 page.

    It is also said that Google don’t like 404 page so I checked my site whether I had any 404 page or not then I found few of the 404 error pages on my site also.

    But Now after reading this post, I can easily handle these pages.

    Thanks for sharing such a helpful post with us. 😀

  56. Ali Sajjad Avatar
    Ali Sajjad

    Hi TOM,
    Very nice and helpful article on wordpress redirects. i want some bit more help about redirection.
    I have a blog for wrestling and now i want that what a user click on download link or view online link inside the post,
    wordpress redirects to a custom html page, which designed for only displaying iframe video box to view online and some ads.
    what should i do?

  57. Kanak Mehra Avatar
    Kanak Mehra

    Very informative post, Tom. I loved especially how you explained the way to setup redirects in WordPress. I never used this method. Thanks for explaining it to me.

  58. Amit Avatar
    Amit

    Hi,

    Thanks for this informative article. I just want to know more about this, will this plugin able to identify the 404 errors automatically? just like google search console? if yes then it is the best way to redirect such links.

    Thanks,
    Amit

  59. P.G. Avatar
    P.G.

    I have not used Redirection plugin before. I am looking at advanced options and just wanted to know what the item “position” is for. Is it to indicate which redirects get processed first? If I enter the number 1, will it be the first redirect processed? Thanks for your help.

Leave a Reply

Your email address will not be published. Required fields are marked *