Learn How You Can Set Up & Verify WordPress 301 Redirects

Table of Contents
    Add a header to begin generating the table of contents

    Looking to set up 301 redirects for your website?

    No one wants to send users or search engines to outdated content, which could lead to perceptions of unprofessionalism and carelessness. 

    Ensure that your business doesn’t fall into that category by getting 301 redirects set up and verified on your WordPress site. 

     

    Top Tips 

    • This blog is only suitable for WordPress websites. 

     

    Benefits 

    • Once completed, your website will not show a 404 error any more. 
    • Your users will be directed to the correct website with the updated information. 
    • By the end of this blog, you will have set up 301 redirects across your site, ensuring no outdated information is available.

     

    Setting Up 

    You will need to ensure “Redirection” has been installed on your WordPress site – to do this, follow these instructions:

    1. You will need to start on the Admin Panel of WordPress 
    2. Now you will need to go over to plugins, and then select “Add New” 
    3. You will need to input “Redirection” in the search box in the top right corner of the screen. 
    4. Then you’re going to need to select “Install Now” and then “Activate” 

     

    Single Page Redirection

    It’s vital that you have a backup of your website before you start setting up the 301 redirects (unless you are currently using a staging environment). 

    It’s important that you do this because there is a slim possibility that you will set up a redirect loop, meaning your website is not available. 

    There is also the possibility that the redirect rule will be a match for the Admin login page, meaning that the Admin Panel will become unavailable. 

    You also need to be aware of the fact that this process may not be effective for you – this will be depending on the URL structure and set up of your website. 

    • If you find that this is true for you, then the best course of action is for you to get in contact with your developer in order to resolve the issue. 

     

    When Is This Used?

    • In the event that you were running a short-term sale on a landing page and this sale has now finished. 
    • You need to set up a redirect so that users are shown the current sales page rather than an outdated one. 
    • You have found a 404 error on your site, and so you’re looking to send users over to a page with similar content that is fully-functioning. 
    • You’re intending to create a vanity URL – this is a URL which is easy to input for the user – this will redirect them to the page you need them to go to. This is something which is usually used when you’re intending for users to be tagged with UTM tags, however, you don’t want the UTM tags to be visible in the URL. 
    • If you have moved the structure of your website, this means that the URLs you used to have no longer work – this means that you need to set up redirects based around the new website structure.

     

    How To Do It

      1. You will need to start on the WordPress Admin Panel and then go over to “Tools” in the sidebar before then selecting the “Redirection” option. 
      2. Now you will need to tick “Regex” this will be beneath the “Add new redirection” – you’re going to need to enter the following data:
        • Source URL 
        • You will need to input your old URL 
        • Take away the domain and then take away the last forwarding slash (if there is one), and then add this:

    (?!\/.*\/)((\/?)$|.*.*=.*)

          • The reason that you need to input this code is so that users who come to the page through a URL which has a parameter will not be redirected. 
          • Not only it also makes sure that the subpaths which have the same name will not be matched up – this means that it will work regardless of if the older URL did have a forward slash. 

     

        • Target URL – This is the URL that you’re intending to redirect your users to.
        1. You’re going to need to select the gear icon – you will find it next to the “Add Redirect” button
        2. Input these fields:
          • Title – internal-only – this should explain why the redirect is being done. 
          • Match – just the URL 
          • Once matched – Redirects 
          • With 301 HTTP Code – Permanently Moved 
        3. Now hit the “Add Redirect” button
        4. Your redirect should not be prepared – you will just need to see if it’s working correctly by dedicating a little time to testing. 

     

    Entire Subpath To A Page Redirection Process 

    It’s vital that you have a backup of your website before you start setting up the 301 redirects (unless you are currently using a staging environment).

    It’s important that you do this because there is a slim possibility that you will set up a redirect loop, meaning your website is not available.

    There is also the possibility that the redirect rule will be a match for the Admin login page, meaning that the Admin Panel will become unavailable.

    You also need to be aware of the fact that this process may not be effective for you – this will be depending on the URL structure and set up of your website.

    • If you find that this is true for you, then the best course of action is for you to get in contact with your developer in order to resolve the issue.

    Why Is This Done?

    • In the event that you have a product range that you’re no longer intending to sell – this means that you’re going to need to redirect all of the relevant product pages to other pages which offer similar items.

     

    How To Do It

      1. You’re going to need to start on the Admin Panel of WordPress – you will need to be logged in.
      2. Go over to “Tools” in the sidebar and then select “Redirection” 
      3. Once you have found “Add new redirection” you’re going to need to tick “Regex” and then input the following:
        • Source URL:
          • Input the category’s base URL
          • Take away the domain 
          • At the end add these characters: (.*) 

     

        • Target URL 
          • Input the new URL
          • Take away the domain 

     

    1. You’re going to need to select the gear icon – you’ll see it next to the “Add Redirect” button. 
      • Title – internal-only – this should explain why the redirect is being done. 
      • Match – just the URL 
      • Once matched – Redirects 
      • With 301 HTTP Code – Permanently Moved 
    • Now hit the “Add Redirect” button
    • Your redirect will be set up now, and to test if they are working, ensure that you follow the last step. 

     

    URL Structure Movement 

    It’s vital that you have a backup of your website before you start setting up the 301 redirects (unless you are currently using a staging environment).

    It’s important that you do this because there is a slim possibility that you will set up a redirect loop, meaning your website is not available.

    There is also the possibility that the redirect rule will be a match for the Admin login page, meaning that the Admin Panel will become unavailable.

     

    Traditionally URL structures can be appropriately redirected using WordPress, by giving a category a different name.

    • You can do this by clicking on these in the following order:
      • “Posts”
      • “Categories”
      • “Quick Edit” – this is under the category you’re intending to alter
    • Now you’re going to need to alter the Slug to the name of the category that you’re intending to rename.

     

    Why Is This Done?

    • In the event that you have moved the structure of the URL, and now you have had 404 errors on older URLs. 

     

    How To Do It?

      1. You’re going to need to log into the Admin Panel of WordPress, and then go over to the left sidebar, select “Tools” and then “Redirection”
      2. Now you will need to go to “Add new redirection” and then click the checkbox that says: “Regex”, and enter the following:
        • Source URL 
          • Input the URL you’re intending to change 
          • You need to take away the domain 
          • Now at the end, make sure to add: (.*)

     

        • Target URL
          • You need to input the new URL 
          • Take away the domain 
          • Now at the end, you need to add these characters: $1 

     

      1. You’re going to need to select the gear icon and then click on the “Add Redirect” button.
        • Input information into these fields:
          1. Title – internal-only – this should explain why the redirect is being done. 
          2. Match – just the URL 
          3. Once matched – Redirects 
          4. With 301 HTTP Code – Permanently Moved 
      • Your redirect will be set up now, and to test if they are working, ensure that you follow the last step. 

     

    Redirects Testing 

    1. You will need to open this: http://www.browseo.net/ 
    2. Now you should see an input box in the left-hand corner, you will need to input the URL you’re intending to test and then select “Browse”
    3. Once you have seen the tool has loaded the results, one by one they should be visible to you under “Response” – you should then be able to see what kind of redirect they are. 
    4. In the event that you have followed this blog in order to set up the redirect, then you should be able to see: “301 Moved Permanently”. 
      • In the event that you do see a “404” error instead, then this means that the redirects you have set up have not been successful. 
        • There could be a number of reasons why your attempts have not been successful, if you are using the “Cache” plugin and have just set up a redirect, then you’ll benefit from refreshing your website’s cache before you attempt testing again. 

     

    Thanks for reading! We hope you found this blog useful, if you did, then make sure to check us out on social media, that way you can keep updated with our latest news and blog posts.