Goal: To properly implement and test 301 redirects on your WordPress website.
Ideal Outcome: The page you want to redirect no longer displays a 404 error or the old content and is now redirecting users and search engines to the new URL. Another outcome would be when other websites make typo errors in linking to your website, you can redirect the wrong backlinks to the correct URL.
Prerequisites or requirements: This exact process only applies to self-hosted WordPress sites.
Why this is important: Having users or search engines experience either 404 (Page Not Found) errors or outdated content should be avoided as much as possible.
Where this is done: In your WordPress Admin panel.
When this is done: Whenever unexpected 404 (Page Not Found) errors are detected, or you want to redirect users automatically and permanently from a URL to another.
Who does this:
The person responsible for website management, or SEO.
- Environment setup
If you havenât yet, youâll need to install âRedirectionâ on your WordPress website:
- Log in to your WordPress Admin Panel.
- On the sidebar to the left, hover âPluginsâ đĄȘ âAdd New.â
- On the top right corner type âRedirectionâ on the search box.
- Click âInstall Nowâ đĄȘ âActivate.â
- On the sidebar to the left, hover âToolsâ and click âRedirectionâ:
- You will be redirected to the âWelcome to Redirectionâ page, click âStart Setupâ button:
- Next, you will see the âBasic Setupâ page:
- Check âMonitor permalink changes in WordPress posts and pagesâ â This is helpful in keeping track of URL changes (e.g., You may have a seasonal landing page like âBlack Friday Sale 2020â last year, âBlack Friday Sale 2021â this year -- you can keep track of the URL changes here).
- Check âKeep a log of all redirects and 404 errorsâ â This will help you identify backlink errors from other websites, or your website is being hacked when unfamiliar URLs are being logged here from search engines.
- [Optional] Check âStore IP information for redirects and 404 errorsâ â If you choose to put a check on this, you have to declare it in your privacy policy for GPDR compliance.
- Click the âContinue Setupâ button.
- Next, the Redirection plugin will check if there is no other plugin that will affect its functionalities. Most of the time, it will appear as âGoodâ then youâll be able to proceed to the âFinish Setupâ button. If REST API is âDisabled,â you might need to disable the plugin causing it or get support to get it enabled.
- Wait for the progress bar to reach 100% and click âFinished.â
- Next, weâll go over three very common redirect scenarios â click on the links below to the one that fits your needs:
- Redirecting a single page
**Note: Make sure you have a backup of your website when doing 301 redirects (or that you are doing it first on a staging environment), there is the small chance you might cause a redirect loop which can make your website unavailable. There is also the small chance your redirect rule matches your Admin login page, causing your Admin Panel to become inaccessible.
Remember: If you havenât implemented a backup solution for your WordPress website, you can do so by following :
How to backup and restore your WordPress website**Note 2: In rare cases, depending on the URL structure and your setup, the process covered in this SOP might not work for you. If this is the case, it is recommended to get in touch with a developer to find you a specific solution.
Typical use-case:
- You were running a flash sale on a specific landing page and the sale has ended. You might want to redirect users to the current sales page now.
- You detected a 404 error on your website and want to redirect users to a similar page that is working.
- You want to create a vanity URL. An easy to remember and easy to type URL that you can give to your users that will redirect them to the actual page that you want them to go to. Typically used when you want users to be tagged with UTM tags, but you do not want the URL to display the UTM tags.
- You moved your website structure and now your old URLs are not working anymore. You want to redirect them to the new website structure.
- For off-page SEO benefit, you can also redirect backlinks from other websites that have URL typos in them to the correct or updated URLs.
**Note: If you are not using UTM tags already you can start doing so by following :
Creating UTM URLs to Track Your Campaigns**Note: There are instances where you might not need to redirect every single page using this method. Even though it would work you may want to check if any of the other redirecting options covered on this SOP would work for you and if they would be more time efficient.
Example:
http://www.asiteaboutemojis.com/old-page/
To
http://www.asiteaboutemojis.com/new-page/
Procedure:
- On the sidebar to the left, hover âToolsâ and click âRedirectionâ:
- Below the âAdd new redirection,â you can fill up the fields under it:
- Source URL:
- Enter your old URL.
Example:
http://www.asiteaboutemojis.com/old-page/
- Remove the domain from it.
Example:
- Remove the last forward slash (If it exists)
Example:
- Query Parameters: âIgnore & pass parameters to the targetâ Note: If you donât select âIgnore & Pass parameters to the targetâ it will still appear to work, but users that arrive at the page through an URL containing an URL parameter (like UTM tracking for example) will not be redirected.
- Target URL: This is the new URL you want to redirect your visitors to, when they try to visit the source URL.
- Example: http://www.asiteaboutemojis.com/new-page/
- Click the gear âïžicon and Input the following fields. When youâre done click âAdd Redirectâ:
- Title: This field is for internal use only. It should explain why this redirect was implemented.
- Example: [Discontinued Product] Blue Emojis
- Match: URL Only
- When matched: Redirect to URL
- With HTTP Code: 301 - Moved Permanently
- Thatâs it! Your redirect should be ready, you should now test if it is working properly by following the last chapter of this SOP.
- Redirecting an entire subpath to a specific page
**Note: Make sure you have a backup of your website when doing 301 redirects (or that you are doing it first on a staging environment) â there is the small chance you might cause a redirect loop which can make your website unavailable. There is also the small chance your redirect rule matches your Admin login page, causing your Admin Panel to become inaccessible.
Remember: If you havenât implemented a backup solution for your WordPress website, you can do so by following SOP 053 - How to Backup and Restore your WordPress Website.
**Note 2: In rare cases, depending on the URL structure and your setup, the process covered on this SOP might not work for you. If this is the case it is recommended to get in touch with a developer to find you a specific solution.
Typical use-case:
- You used to have an entire category on blue emojis being sold on your website but you no longer sell those. You might want to redirect all those product pages beneath it to the main category with similar products (violet emojis).
Example:
Redirecting all the product URLs that were under the subpath:
http://www.asiteaboutemojis.com/blue-emojis/
To
http://www.asiteaboutemojis.com/violet-emojis/
So, in this case, if there was a âblue emojiâ product in the URL:
http://www.asiteaboutemojis.com/blue-emojis/product1
Then you will be redirecting users who try to access that link to:
http://www.asiteaboutemojis.com/violet-emojis/
Procedure:
- On the sidebar to the left, hover âToolsâ and click âRedirectionâ:
- Below âAdd new redirection,â at the right side of the âSource URLâ field, click the âURL options/Regexâ toggle and check âRegexâ:
- Source URL:
- Enter your base URL for that category:
Example:
http://www.asiteaboutemojis.com/blue-emojis/
- Remove the domain from it.
Example:
- Add ^ at the start and add the characters (.*) at the end.
Example:
^/blue-emojis/(.*)
- Target URL:
- Enter your new URL.
Example:
http://www.asiteaboutemojis.com/violet-emojis/
- Remove the domain from it.
Example:
- Click the gear ( âïž) icon next to the blue âAdd Redirectâ button.
- Input the following fields and when youâre done click âAdd Redirectâ:
- Title: This field is for internal use only. It should explain why this redirect was implemented.
- Match: URL Only
- When matched: Redirect to URL
- With HTTP Code: 301 - Moved Permanently
Example: [Discontinued Category] Blue Emojis (All pages) â Violet Emojis Main Category
- Thatâs it! Your redirect should be ready, you should now test if it is working properly by following the last chapter of this SOP.
- Moving URL structure
**Note: Make sure you have a backup of your website when doing 301 redirects (or that you are doing it first on a staging environment) there is the small chance you might cause a redirect loop which can make your website unavailable. There is also the small chance your redirect rule matches your Admin login page, causing your Admin Panel to become inaccessible.
Remember: If you havenât implemented a backup solution for your WordPress website, you can do so by following SOP 053 - How to Backup and Restore your WordPress Website.
**Note 2: URL structures are typically well handled and correctly redirected by WordPress simply by either renaming your category (Under âPosts â Categories â Select âQuick Editâ under the category you want to change â Change the Slug to the name of the category you want to rename) or changing your URL structure. (You can change your URL structure by following SOP 050)
Typical use-case:
- You moved the URL structure on your website and now you found 404 errors (Page Not Found) on your old URLs.
Example:
- Renaming categories, such as changing the name of the category slug from /business/ to /enterprise/ and keeping all the old URLs downstream to redirect to the new slug.
Example:
Redirecting all the blog posts that were previously under the subpath:
http://www.asiteaboutemojis.com/business-related/
To
http://www.asiteaboutemojis.com/enterprise/
So, in this case, if before changing the URL structure a typical blog post URL would be:
http://www.asiteaboutemojis.com/business-related/we-do-awesome-301-redirects
Then you will be redirecting users to:
http://www.asiteaboutemojis.com/enterprise/we-do-awesome-301-redirects
Procedure:
- Log in to your WordPress Admin Panel.
- On the sidebar to the left, hover âToolsâ and click âRedirectionâ:
- Under âAdd new redirectionâ, tick the âRegexâ checkbox, and input:
- Source URL:
- Enter your old URL.
Example:
http://www.asiteaboutemojis.com/business-related/
- Remove the domain from it.
Example:
- Add the characters ^ at the start and (.*) at the end.
Example:
^/business-related/(.*)
- Target URL:
- Enter your new URL.
Example:
http://www.asiteaboutemojis.com/enterprise/
- Remove the domain from it.
Example:
- Add the characters $1 at the end.
Example:
- Click the gear (âïž) icon next to the blue âAdd Redirectâ button.
- Input the following fields and when youâre done click âAdd Redirectâ:
- Title: This field is internal only. It should explain why this redirect was implemented.
- Match: URL Only
- When matched: Redirect to URL
- With HTTP Code: 301 - Moved Permanently
Example: [Renamed Category] Business to Enterprise
- Thatâs it! Your redirect should be ready, you should now test if it is working properly by following the last chapter of this SOP.
- Testing if redirects are working properly
- On your browser, go to http://www.browseo.net/
- On the input box on the top left, insert the URL you want to test â Click âBrowseâ
- On the input box on the top left, insert the URL you want to test â Click âBrowseâ
- When the tool loads the results, you should be able to see under âResponseâ the redirects one by one, and what kind of redirect it is.
- If you followed this SOP to implement the redirect you should be seeing â301 Moved Permanentlyâ.
**Note: If you see a 404 (Not-found) instead, it means your website is not redirecting successfully. There are multiple reasons why this could be happening, if you have just implemented the redirect and you are using a âCacheâ plugin, you might want to refresh your websiteâs cache and try testing again.