How To Create Redirects With WordPress

Posted on May 12, 2014 by in Tips & Tricks | 86 comments

How To Create Redirects With WordPress

In my recent guide to WordPress permalinks, I spoke about the need of choosing the correct permalink structure for your website from the start.

If you later decide to change your permalink structure, or if you remove posts or pages, you will generate 404 page errors. A 404 page error should be displayed to visitors when a page has been removed, however if the content has simply been moved to a different location on your website, you should redirect the visitor to the new location.

To see if your website has any 404 page errors, log into Google Webmaster Tools then go to the crawl section. In the Crawl Errors page, Google highlights any page of yours that Google is unable to index.

Google Crawl Errors

Google Webmaster Tools will advise you of any 404 page errors on your website.

There are other reasons why you would want to redirect a page, however for 99% of website owners, redirection is necessary when they change their URL structure or alter the post slug of an article.

In this article, I would like to show you how you can redirect a URL on a WordPress website.

What is a 301 Redirect?

The majority of redirects use what is known as a 301 redirect. This is named after the HTTP response status code 301, which informs search engines that a page has moved permanently.

Search engines advise website owners to use a 301 redirect whenever a page has permanently moved. 301 redirects ensure that page rank, and any other “juice” that a search engine gives a page, is transferred to its new URL.

There are other redirects available such as 307 (temporary) and 308 (permanent); however you should use 301 redirects whenever a page URL has changed so that search engine rankings and traffic are not affected.

How to Redirect a Page Using Htaccess

As I stressed last month, the .htaccess file has to be taken seriously. One incorrect character in your .htaccess file is enough to bring your whole website down. It is therefore vital that you create a backup of the file before you modify it. This will allow you to restore a working version of the file in the event of something go wrong.

You can create 301 redirects using the .htaccess file if you are using an apache server. All you have to do is specify the old location and the new location. You can do this with the following code:

Redirect 301 /oldpage.html

Folders can also be redirected in the same manner. You can also redirect a whole website with a 301 redirect using the following code:

Redirect 301 /

All you need to do to check if your redirection is working is load the page you are redirecting. If its working correctly, you will be redirected to the new page.

How to Redirect a Page Using PHP

It is possible to apply redirects using many different languages including ASP, ColdFusion, Perl, and Java. You can even redirect a page by adding a meta tag into your page header by utilizing the http-equiv attribute.

WordPress uses the PHP platform, therefore if you integrate any other scripts with WordPress, they will probably use PHP too. If you find yourself in a situation where you need to redirect a PHP web page that is outside your WordPress installation, you can use a PHP redirect.

You can redirect a PHP page by adding this line of code to the header:

header("HTTP/1.1 301 Moved Permanently"); 

Note that the “301 Moved Permanently” line is necessary to advise search engines that you are using a 301 redirection. You also need to ensure that this code is placed at the top of the page to ensure the redirection works correctly.

If you would like to use redirection within a theme or plugin you are developing, you can use the WordPress wp_redirect function. The function will redirect links using a 302 redirect by default; however this can be changed by modifying the $status parameter.

How to Redirect a Page Using a WordPress Plugin

The beauty of WordPress is that you do not have to have a technical background in order to maintain your website. While you can use .htaccess or PHP to redirect pages, it is simpler to use one of many great redirect plugins available for WordPress.

One such solution is Quick Page/Post Redirect Plugin. The plugin allows you to perform 301, 302, 307, or meta refresh redirects.

Redirects can also have nofollow tags attached to them and be opened in new windows. All you have to do is check a box to enable this functionality.

Quick Page/Post Redirect Plugin

Quick Page/Post Redirect Plugin is a practical redirect solution that is easy to use.

Redirection is a great plugin that features 404 page monitoring. It will show you exactly what pages are generating 404 page errors and allow you to create 301, 302, and 307 redirects, for each of those links.

It allows you to redirect URLs to random blog posts or directly to your 404 error page. Redirections can also be allocated into groups to help you can manage all of your redirection links correctly.


Redirection helps you find 404 page errors and allows you to redirect links to many other URLs and random posts.

Another solution is SEO Redirection Plugin. The plugin supports 301, 302, and 307 redirection. It also supports wildcard redirection and can automatically redirect any 404 errors it finds to a specific page.

SEO Redirection Plugin

SEO Redirection Plugin is one of the few plugins that supports wildcards.

I hope you have found this tutorial useful. If so, I encourage you to subscribe to the Elegant Themes blog for updates of our latest articles πŸ™‚

Article thumbnail image by Dr. Cloud /


  1. I never knew plugins existed for redirects until now. This is good to know. Thanks Kevin.

    • Kevin Muldoon

      No problem Adam. Yeah they are handy as they allow you to add redirects directly through the admin area. πŸ™‚

      • Thank you Kevin !

        SEO Redirect is awesome. I have merge my HowToGhost blog to
        First I have export and imported the posts and then Redirected all posts links. So, none of my search traffic dropped πŸ™‚

  2. Hey Kevin! Great article! I just had a quick question. I recently moved my wife’s food blog from to Obviously, the old blog was on WordPress servers, but the new one is a custom url on my personal hosting package with Host Gator. We are trying to monetize on her blog and she gets really great traffic (about 40,000/mo). Adsense rejects us time and time again (about 4 times) and we can’t figure out why. Do you think it might be because some of her blogs are redirected from her original blog ( Would Adsense dislike the redirects like that? Thanks!

    • Kevin Muldoon

      If there is a 301 redirection sending all articles to their new location, it should be ok. It’s not like you are redirecting unrelated traffic to the website.

      I am not sure whether traffic levels are the reason for being rejected as you have enough. Your website design looks great too, therefore I do not seeing that being an issue.

      I was accepted into Adsense when it was first launched, so I do not know much about why websites get rejected. What did their rejection email say?

      • The email states that it’s because the site doesn’t abide by Google policies. However, looking over the Google policies, I can’t see where that’s the case. The email provided tips for us which were:

        1) “It’s important for sites displaying Google ads to offer significant value to the user. As a publisher, you must provide unique and relevant content that gives users a reason to visit your site first.” Lindsay’s site has original content on every post. Not only are the pictures original, but she types up original posts with each recipe. And obviously every post is relevant to the content that people are looking for when they come to her site.

        2) “Don’t place ads on auto-generated pages or pages with little to no original content.” We don’t have any auto-generated pages or pages with little or no original content. I created each page by hand, so nothing was automatic.

        3) “Your site should also provide a good user experience through clear navigation and organization. Users should be able to easily click through your pages and find the information they’re seeking.” The site obviously provides a good user experience. It’s very organized, easy to read, clear text and good use of colors. The index page and search option allow for users to navigate her site very easily, along with the tags and categories she puts on each post.

        At first when we were rejected we were thinking that it was because she was copying recipes and reposting them, however after looking at these policies, I find this to not be the case. The policy states:

        “AdSense publishers may not display Google ads on webpages with content protected by copyright law unless they have the necessary legal rights to display that content. This includes sites that display copyrighted material, sites hosting copyrighted files, or sites that provide links driving traffic to sites that contain copyrighted material. Please see our DMCA policy for more information.”

        The way she takes the recipes is completely legal and because she links back she isn’t doing anything wrong.

        The last change I made was to create a Privacy Policy that I’ve placed in under the About sub-menu. That didn’t help either. So I figured that it might be the redirects.

        I wish I could actually talk to someone within the Adsense program. That would help a lot! Sorry to get a little off topic though, I was mainly curious about the redirects and wondering if they might be the problem.

        • Kevin Muldoon

          I do not know for sure, but I suspect that using the exact same recipes is raising a duplicate content issue with Google.

          I checked a few of your articles through and they all highlight many other articles with the same content.

          I am not sure how Google handles this kind of thing. You would think that it allows text to be copied etc for the purpose of reviews. Perhaps it is the fact that all of your articles are raising duplication concerns.

          If one article had the same text, it may not be an issue, though if every article has the same text, it might suggest your website is simply scraping content.

          Again, I am only speculating at this point.


          • Kevin Muldoon

            Send me an email and I’ll set you up an account for Rise Forums. I don’t know the answer to this myself, though other members might have a better idea πŸ™‚

  3. Nice article! Thanks!

    What about the performance? Isn’t it better to use the htaccess file instead of one more plugin!?

    • Kevin Muldoon

      It depends on the plugin. Some plugins use htaccess redirection, therefore it should be the same πŸ™‚

      • Great article. Do you know which plugins are making use of the.htaccess?

        • Kevin Muldoon

          Not of the top of my head. Some of them give you the option of which type of redirection to use. If a plugin does not offer that option, my guess would be that it uses htaccess; though I would not know for sure without checking.

  4. I recently moved a blog to digital ocean. To my surprise they performance was super awesome compare to my old shared hosting. Now I need to set redirects and this article came just in time πŸ™‚

  5. Thanks, Kevin! It had always seemed so intimidating.

  6. Thank you very much Kevin, I’m presently having a small issue with permalinks right now. I used custom permalinks to construct a community site I’m building but I changed to postname structure to suite a plugin and that generated 404 error page for one of my vip category page. I reverted to the custom permalinks and things return to normal but still render the hangout plugin registration pages useless, because I can’t get to the page front page when I linked to it. Maybe I will give some of the plugin you suggested a shot.

  7. Hi Kevin,

    I use Redirection plugin or .htaccess directives for SEO reasons, when I have a new site moved from another platform to WordPress.

    To find all links, first i catch them with Xenu’s Link Sleuth, copy them in an excel file, then redirects the old ones to new ones, where they are appropriate.

    Good to see some other plugins, I’ll try them all. Thank you for all valuable posts.

    • Kevin Muldoon

      No problem Gina. Glad you liked the article πŸ™‚

  8. I can’t even tell you what perfect timing this was for me! I just sent out this massive newsletter with 2-3 bad links! I should have checked, but am in the midst of a family emergency and just wanted to get the newsletter out! I WAS SO relieved to see this. Thank you! Problem solved. πŸ™‚

    • Kevin Muldoon

      That’s good you resolved the issue. Happy to help πŸ™‚

  9. Hi Kevin

    Another great post. Thanks a lot.

    Every post from you is a lesson and I jumped immediately on this one for a try.

    I just installed “Redirection”. It is doing what is expected and easily. I’m used to track who is on line and what url they are requiring. Few minutes after installation, I have redirected 10 old .html URL to new ones. Just great and more secure than tweeking .htaccess file.

    Even more funny, one of our picture is used by a site without our agreement. I have designed a special picture for it, with a message to avoid copycat. Redirection allows to send the new picture instead of the ‘stolen’ one.

    Waiting eagerly for your next post !


    • Kevin Muldoon

      haha nice. I used to do that frequently with blog scrapers. They would frequently link to images hosted on my website, so I would take their domain and add a piece of hotlinking code to my htaccess file so that all of the images instead showed a picture of dog poo. Crude, but effective πŸ™‚

  10. Hi, I don’t know if this comment will go through, I’ve been trying to comment but can not because your commenting box bounced my contribution twice. Is this selective regiment? What’s happening?

    • Kevin Muldoon

      I am not sure. Did you include a link in your comment?

      Comments with links are usually held in moderation.

  11. Thanks for the tutorial. I was completely unaware about the Redirect plugin. Surely I’ll try it.

  12. Handy and timely info for me, as I’m beginning to slowly migrate my sites over to WordPress, one paragraph at a time. So far I’ve just edited the .htaccess file, but will check out the plugins now also.

  13. Just Awesome Kevin : a complete guideline of redirect link in WordPress based website. Thanks for share

  14. I also use a bulk redirect plugin, complement of Quick 301 Redirect plugin.
    This plugin helps us to do a redirect of a specific page that we do not need to specific pages we want

  15. I am just wondering what the best way is, if you have many domains and redirect those to the main domain. The reason doing such is to measure different print campaigns (using those different domains) and Google Analytics doesn’t show 301 redirects (e.g. as referral). Any idea to how see redirects in Google Analytics?

  16. Thanks for all your posts Kevin, they are all very informative and helpful. I just wondered what you would suggest as being the best approach with regards to redirection for the following scenario. I’m looking to rebuild an older html website with a new version using wordpress. The site is hosted on a windows server with a cpanel that allows manual entry of redirects. The hosting company are not specifically wordpress orientated so I will need to set up the database and then do a manual install of wordpress, then set up the site. My question is, if I keep the same set up and rebuild the site with wordpress and manually set the redirects from the old html urls to the new wordpress urls, would this work best or alternatively I was considering moving the hosting and site to a more wordpress friendly hosting company and then doing the redirects once set up with the new hosting company. Obviously, if I move the site to a new host this involves the DNS as well. The site doesn’t have massive traffic but does ok. I feel however that traffic could be greatly improved by changing to wordpress and then working on the seo. Just not sure of the best approach to take as I dont want to trash the current traffic levels and ranking it currently has.

  17. Hi!
    Thanks for the info Kevin.

  18. Thanks Kevin, this article couldn’t come at a better time. Trying to set up redirects at the moment.

  19. What do you have to do i’ve you deleted 3000 tags and getting 3.000 -404- error pages into google webmaster tools? I’m running in such problem.

    Good post!

    • Kevin Muldoon

      First thing to do is to look at why you are generating that many 404 error pages. Have you changed your permalink structure? Have you deleted old posts or pages?

      • A few weeks ago i deleted 3.000 tags into my wordpress website because there was an overflow of unuesed tags. Now i’m getting those errors.. Any solutions…

  20. Great tutorial, thanks!

    Any plugipart from 301 redirection to other web-site, to have full controll over 404 page?
    How to have full control over 404? How to easily customize it? Any plugin here?

    By the way, I think it is time to add 404-customization option for Divi 2.0, don`t you think?

    • Kevin Muldoon

      Your theme should have a 404 template. You should be able to modify it through the template area or through the options area.

  21. Hostgator many times giving 500 Internal Error. I want to change the Hostgator Ad in that page. Any idea ?

    We are paying for them and when our blog gets traffic or sometimes they block the website and started showing their ads.

    • Kevin Muldoon

      I’d leave any hosting company that starting messing around with your website without your permission. Best to look for an alternative.

      • Sage advice Kevin! When companies start messing with your websites, it’s time to leave. And thanks for the very informative article and thoughtful replies.

        Was just looking for some good quality reasonably priced Word Press themes and was surprised to find so much excellent how-to content on the site. Way to go!

    • Kevin Muldoon

      There is no benefit to using www over non-www. Simply choose one and stick to it.

      I personally use www as that is what all major websites use πŸ™‚

      • Thanks for the reply!

        One quick question.. I’ve been using different versions of my address all over the internet in signatures, etc. without knowing that’s a bad idea.

        Some URL’s are,,,

        I’m using the ‘Redirections’ plugin mentioned up top and I don’t know how to get all my URL types to go to just I don’t want to hurt my pagerank. I know it’s not your plugin but am I even thinking correctly here by having this goal?

        Last question, I promise!

        • Kevin Muldoon

          Hi Will,

          Email me through my blog’s contact form and I’ll send you a free invite for Rise Forums. It will be easier for me to help you out there πŸ™‚


  22. Great article. You briefly mention performing an entire site redirect using the htaccess methodology. Is this the preferred practice? For example, I have a WP site and I would like to move the entire site to, can I just 301 redirect the folder to the main site? Or is there a better way? BTW, if it’s a little more complicated, this would make a very valuable post for you to explain precisely how to perform this change, since its pretty confusing…

    Thanks for reading.

    • Kevin Muldoon

      Yes you can just redirect the full folder to your main website. That is what I would do.

  23. Hello Kevin,

    Thanks for this great article, it’s really helpful.

    We are trying to integrate our blog to our website and so switch our blog from to The first link has no hosting so we can’t install this pluging. Do you know how we can redirect the links from the first to the second link?

    Thanks a lot!


  24. I run Shining Star Photo Booth, an event entertainment company that provides photo booth rentals. I have based my site on Chameleon ( and if I type in an invalid URL, it goes to a theme page saying those results do not exist. Is this the same as a valid 404 and 301 redirect?

  25. Thanks for the article it is very helpful and I think it is a piece of the puzzle I am trying to figure out for our library.

    I have created searchform.php in my theme in order to add a radio box below the search box. This radio box will allow a library patron to either search the site (using WP built in search), or search our library catalog (a hosted service on another site).

    I tried to use the javascript function window.location.assign(), but it appears that WordPress does not permit this. If I use the redirect plugin, could I then use the javascript window.location.assign() to make WP think that I am redirecting within the site and allow the plugin to take the user to the catalog site?


  26. Hello, I have a blog on and created another blog for a category in the previous blog. Now I want to redirect specific posts from the old blog address to the new one. All help I received previously talked about plugins, unfortunately i don’t code either. The problem is that I can’t see a plugin menu in my admin sidebar…can you help me? Can I do a redirect without codes and without plugins? Or can I get the plugin menu unto the admin bar?


  27. Hi!

    Thank you so much for the article. I understand everything except (and this is a silly question) should I change all URLs first, i.e. the site I’m working on was never changed from Default permalink types and I need them on Postname- the site has been up a while, and I don’t want to affect the SEO they have….. So should I change the permalink type first and then write the redirections in the htacces. Or should I leave the permalinks on default, with the written redirections in the htaccess file acting as the new URLs?

    Sorry that may seem confusing but Im confused about where the new URLs are taken from…

  28. Thanks, Kevin! It had always seemed so intimidating!!!

  29. Hey Kevin,

    Great article, thanks for taking time to create it.

    What are your thoughts on Pretty Link?

    With appreciation,
    Ian Robinson

  30. Hi Kevin. Thanks for the tips. Any ways to redirect URLs within a free blog? thanks in advance. Anthony

  31. Hello Kevin,
    This is a very informative article post and I am sure that it is very helpful for those who are not as technically challenged as I am.

    My problem:
    I recently changed my domain to and now when I submit my site to Google I receive redirect errors.
    What can I do to correct this?
    Your help is appreciated and thanks!
    Yvonne Finn

  32. Hi Kevin,

    Hope you can help. I’m sure this is not new and mentioned many times, but I can’t seem to find an answer.

    My setup is having a WP Multisite Network install in the root directory. Then I installed a few more fresh WP Networks in different subdirectories just so I can keep things separate and not be using the same database.

    Question is, can I map domains to any of these subsites that are part of these subdirectory networks?

    I can’t find a plugin that can handle it and am looking to see if htacess redirects would work.


  33. Hey Kevin!
    I’ve slightly changed slugs of my various post URLs and was looking for some suitable plugin which could accommodate this change in bulk. Thanks for such nice informative post and this great help.

  34. Hey Kevin,

    Very informative and detailed post. I use the ‘Redirection’ plugin for 301 redirects. It is really simple and easy to use. Great for people who don’t know how to edit the .htaccess file as well !

    Wish you happy holidays.

  35. Hi.

    Thanks for your post.

    I want to redirect to other plugin page so how can i do it?

  36. Hi Kevin,

    very useful article. Is there a way to redirect using a user id?

    I have a menu page that i want to use to direct logged in members to their own page that displays their own unique fitness results.

    Currently I’ve got it set to redirect to the page on log in, but could do with this redirect in the navigation menu too


  37. Thank you for giving info about redirects. I never knew, it would be so easy with the plugin you mention.

  38. Thanks! I have a theme that creates “call to action” / “featured” sections that have me select an existing page, and in the header they use the page title directly from that page, without any option to set it manually. I had no idea plugins existed that would make redirecting so easy – now I can create a “dummy” page with the title that I want in the header of the call to action section, and then have it redirect to the page that I actually want people to land on (with a different title). Thanks so much!

  39. thanks, very interesting reading. Any advices/suggestions if I would like to redirect users from e.g. the US to one site and users from the UK to ?

  40. Hey Kevin, Just googling for the plugin and got your link with individual descriptions. Another awesome thing is, elegant themes blog comes up in most wordpress related search results on the first page. Thats a huge achievement.

  41. Hey Kevin, Just googling for the plugin and got your link with individual descriptions. Another awesome thing is, elegant themes blog comes up in most wordpress related search results on the first page. Thats a huge achievement.

  42. Hello,
    I have a question. I have a site and want to move my articles to my new website. I paid for the redirect site WordPress offers (and later cancelled) but it only redirects articles to my homepage and not to the destination to where the article was moved too. If I just delete the article on the wordpress site and leave a link to where the article is in the new location, will I get penalized by Google’s rankings for this? Thank you in advance.

  43. Hello,
    I have used redirection plugin for my website cause I changed into pretty permalinks. After that the website was very down. I swiched again to the the default ugly permalinks but was also down. I changed again to pretty permalinks and used seo redirection plugin and checked if the redirects are working but now the website is more down than ever…goes to o visits . I am a little desperate. What mistake I did? Very happy for an answer.
    Thank you,

  44. Hi,

    Thank you for an excellent article, and some great Comments. I have a problem/question that is related.

    Can 301 redirects placed in the htaccess file of a new WordPress site pick up people looking for pages from an html site that has been closed down.

    Say, existing html site page is
    I set up a new WP site, and a corresponding page
    and I need to close down the old host
    Will a 301 redirect
    Redirect 301 /widgets.html
    pick up people looking for the old page, which isn’t on the new WP host?

    If I’m asking the wrong question, and there’s a better answer, shoot!

    Many thanks,


  45. I have a blog on WordPress.Com, i want to redirect it to a difrent URL but i dont think there’s a possibility to add a plugin.

    Any advice?

  46. Hi Kevin,

    I have a question re: the need to use a plugin for this in WordPress. I understand the use of a plugin to help automate a large number of redirects if I moved my blog to a new URL, but what about the case of needing only one or two redirects? Can I use cPanel for instance?

    For instance, I want to create a promo card and have a shortlink that takes people to a blog post with a long title. So i created a redirect using the cPanel tool in GoDaddy. It doesn’t seem to work though. The redirect from “” doesn’t open the page “”.

    Any ideas if redirects with cPanel will work in WordPress?


  47. Hi, I just read on the link to the Quick Page/Post Redirect Plugin you provide, that his plugin also deals with 404 errors and can redirect them. This was not very clear in your overall great article just my 2 cents πŸ™‚

  48. Great article!
    Thnks for this complete guideline of redirect link in WordPress based website. You sharing a informative and helpful post with us.
    You briefly explained plugins.

  49. Thank you very much, but what code I have to add into htaccess to redirect old posts to new posts (of the new website)? Thanks again.

  50. If for example I wanted google to crawl a page but when an end user clicks that link is then redirected to another page. Is this possible?

    Further info
    I have multiple pages with keywords to certain geographic areas but want all web users to end up on a generic page.

  51. Hey,
    amazing article.
    But i still have something to ask, since wordpress plugin causes site to load slow, i was wondering is there any way to make REDIRECT instead using wordpress plugin ?

  52. Hi Kevin – I have some old posts that I want to update a bit and recycle. I then want to publish them as new posts (so that my email subscribers see them as new) but I also want the old post to stay within the frame of the blog when it was originally published. Does the plug in work for this situation? I really don’t want to lose any permalink information.

500,591 Customers Are Already Building Amazing Websites With Divi. Join The Most Empowered WordPress Community On The Web

We offer a 30 Day Money Back Guarantee, so joining is Risk-Free!

Sign Up Today

Pin It on Pinterest