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.

Access, manage, update and backup all your WordPress sites from one powerful dashboard

Sign up - it's free!
post a comment

65 Comments

  1. Jody Heath says:

    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!

    • Tom Ewer says:

      Hi Jody,

      To be honest, since I wrote this article I haven't used any other plugin with the same functionality, so I'd have to say it's still my pick!

      You don't need to request that old URLs are de-indexed. Google will figure it out.

      Cheers,

      Tom

  2. Jody Heath says:

    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?

  3. Arafin Rubab says:

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

  4. PrIyAnGsHu says:

    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?

  5. Don says:

    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.

  6. Steve says:

    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 *

  7. Srjtech says:

    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?

  8. Thanks Tom, a useful tip of the day! (some days later ;)

  9. Nikhil says:

    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

    • Tom Ewer says:

      Hi Nikil,

      It appears to still be on WordPress.org with no news of any major issues. Care to explain further?

      Cheers,

      Tom

      • Nikhil says:

        They told me that they have closed but now they patched the issue reported by me in 2.3.3 and launched 2.3.4; no issues i have done my work for community. bad thing is they didnt mention me :(

  10. Chris says:

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

  11. Michael says:

    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.

  12. Mio says:

    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.

  13. Nosa E Nosa says:

    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.

  14. Avtar Singh says:

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

  15. Greg says:

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

    • Tom Ewer says:

      No problem Greg. I've had no problems with it, I also use Pretty Link but that doesn't have exactly the same functionality. To be honest, it was last updated 5 months ago — I really don't think that's a big deal.

      • Greg says:

        Sorry for my delayed reply Tom – for some reason I never got an email about your reply.

        All I can do is give Redirection a try. It seems to be the most powerful plugin out there for what I'm trying to do.

        You say 5 months since last update. Were you referring to Redirection or Pretty Link? From the Redirection plugins page the last update was listed as 2012-May-07.

        I'll see how I get on. There are a few concerning comments in the support and reviews section, but I will soon see for myself!

        Thanks for the great article a (working) Redirection plugin is exactly what I was hunting for! :)

  16. Paul says:

    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.

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

  18. Robinson3d says:

    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?

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

  20. Lasse says:

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

  21. Jeremy says:

    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.

  22. Akiko says:

    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!

    • Tom Ewer says:

      Hello Akiko,

      I'm afraid I don't really understand your question but it sounds pretty complicated, so I would advise that you use the WordPress.org forums.

      Cheers,

      Tom

      • Akiko says:

        Hi Tom thanks for the reply. Have tried some coding methods and now my blogger blog has been marked as spam and deleted! Confusing I suppose. Anyway, thanks for the advice, I might do just that. Cheers!

  23. Niche Master says:

    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?

  24. Jalyn says:

    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!

  25. Nick says:

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

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

  27. Optimator says:

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

  28. THanks! That works great!

  29. Randy Young says:

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

  30. Wine Dine says:

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

  31. FreddFDR says:

    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?

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

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