You’ve been told by countless SEO guides & Webmaster Tools that if you move a URL you need to use a 301 redirect. But they usually don’t tell you what exactly it is or how to do it. This article will cover the what and how for 301 redirects on WordPress.
What is a 301 Redirect?
A 301 redirect is a permanent change of address for a website.
If you move a webpage from
http://example.com/new-page, you want to leave a forwarding address at your old-page to your new-page. Just like you would leave a change of address with the post office if you moved to a new house.
Why is it called a 301 Redirect?
Well the Redirect part of the name is for us humans, the 301 is a specific http response status code. It means permanently moved and is sent in response to browsers, web crawlers and like sending a request. When they were writing the specs for http codes (computers love codes), they picked the 3xx section to cover redirection.
The Redirection plugin has a simple interface for redirecting any URL on your site to another one.
The video at the beginning of this article covers these same steps.
This is particularly helpful if you’ve changed your website to WordPress, changed your permalink settings, or reorganized your site in another way.
To get started you need to install the Redirection plugin (if you want to see how to install, see the video above). Once it is installed and active, go to Tools in your WordPress admin area and select Redirection.
Look for the section that says Add new redirection and enter your old page’s URL in the Source URL box and then your new page’s URL in the Target URL box. You don’t need to change any settings for basic redirects. Then just click on the Add Redirection button.
There are more advanced settings, such as using Regular Expressions, but I don’t recommend those for beginners.
For the Source URL this MUST be a URL on your existing site. For example, if your website has the url http://example.com, then the source URL must start with http://example.com. If you have a website that is on a temporary domain, you should use relative URLs (remove the domain part) instead of absolute URLs. For example if your old URL was
http://example.com/old-url and your new URL is
http://example.com/new-url you would enter the following into your new redirection:
At the top of the page is an Options button. If you click that and then look for the Import section you will be able to import a csv file. CSV files are comma separated value spreadsheets that can be created in any spreadsheet program. To setup a CSV file, just put your old URL in the left column and your new URL in the right column.
After importing the URLs you will see a notice at the top of the screen telling you that they were successfully imported.
Note: The Redirection plugin will monitor your redirections and your 404 errors. You should periodically (I generally recommend about once per quarter) clean out your logs. To do that click on the Log and 404s links on the main Redirection screen.
Then scroll down on both of those pages to the Process Current Logs section and click on Delete Logs. Regularly cleaning out your logs will help keep your database from getting bloated (I’ve cleaned out databases to under 1MB which were bloated to over 30MB — but a full database scrub is another topic).
If you are getting a lot of actions in your logs (especially 404s), you should look into the source of them and get that corrected — frequently it means you have an error in one of your links on your site or you need to add a 301 redirect.
The Redirection plugin does a great job of creating, managing and checking on your 301 redirects in WordPress. When it comes to redirection, it’s always recommended to keep all of the redirects on one location so that you can easily check on them, edit them, and view log data. If you have redirects in multiple locations, I always recommend consolidating them to just one location to help keep your site organized.