301 Redirect in WordPress – A Complete Guide on How To Create WordPress 301 Redirects
Say for example you published an article a month ago and added some internal links to it which is taking your visitors to another page on your website. Suppose for some reason you changed the URL or removed that page but the link still exists on your article. In that case, you would want to create a 301 redirect on your WordPress website.
What is WordPress 301 Redirect?
As the name suggests, “Redirect” takes your visitors to another destination which is different from the original one. You have to assign an alternate destination to that URL so that the user doesn’t end up on a 404 error.
WordPress 301 Redirect is not the only type of redirect. There is a 302 Redirect as well which is different from a 301. The difference between the two is that the WordPress 301 Redirect is a permanent redirect and the 302 is a temporary redirect. There is also a 307 Redirect but for the sake of this article, we will stick to a 301 Redirect.
Importance of a 301 Redirect
You wouldn’t want your visitors stumbling upon a 404 error as it will worsen your website’s user experience. Visitors will also doubt your credibility as a blog or site owner and will perceive your website as unprofessional and immature.
Apart from the visitors, you must also think about Google crawlers. WordPress 301 Redirects will prevent Google crawlers from seeing a 404 page. 404 pages have a huge impact on your website’s SEO. You will see your Google search rankings drop dramatically if you have 404 pages on your website. A 301 Redirect takes the Google crawler to an alternate destination rather than landing on a 404 page.
How To Create a WordPress 301 Redirect?
There are two methods to create a WordPress 301 redirect. You can either choose a plugin and it will do the work for you, or you can do it manually from the .htaccess file.
Let’s take a look at the top WordPress 301 Redirect plugins and later we can go through the manual process.
WordPress 301 Redirect Plugins
Redirection is the most popular WordPress 301 redirection plugin. With over 1 million installs, it has to be your first choice if you want to create 301 redirects using a plugin. The plugin helps you create 301 redirects easily and also keep a track on your 404 pages.
The Redirection Manager allows you to manage all your 301 redirects without having any knowledge about Apache or Nginx. It also keeps an eye on the permalinks that have been changed and creates a 301 redirect automatically.
Simple 301 Redirects
Simple 301 Redirects is also an effective redirection plugin with more than 300,000 installs. The plugin comes in handy especially when you have to migrate your website to WordPress and are unable to preserve your URL’s Structure.
301 Redirects is another free plugin that creates 301 redirects easily without using any code. The plugin is ideal for new websites that are created from old websites. It is very user-friendly and doesn’t take more than 2 minutes to configure.
SEO Redirection Plugin
SEO Redirection Plugin is used to create a 301 Redirect, 302 Redirect and a 307 Redirect for a WordPress post. It has support for wildcard redirection and can also fix crawl errors in Google’s search console. The plugin also supports WPML plugin.
SEO Redirection Plugin also creates 301 redirections when a post’s URL is changed. It also includes an advanced control panel that manages all your 301 redirections. The plugin keeps a log for all your redirected URLs so you can keep track.
Manually Create WordPress 301 Redirect
Using too many plugins on your website can negatively affect its performance. So it’s a good practice to avoid a plugin when you can perform that function manually. WordPress allows users to create 301 Redirects using the .htaccess file.
Before I start telling you the changes you need to make in your .htaccess file, you must know that .htaccess file is crucial to your website. Any incorrect change can make your website inaccessible. So you have to be very careful while applying the WordPress 301 Redirect.
Also, make sure that you backup your files before making changes to your .htaccess file.
The first step is to connect your website to an FTP client. For this article, we are using FileZilla but you can use any FTP client you want.
Once you have connected your website to your FTP, this is how your files will show. The right-hand side contains all the files from your computer, and the left-hand side contains all your WordPress website files.
To find the .htaccess file, access the public_html folder which is also called the root directory.
Note: You might not find the .htaccess file in your WordPress root directory at first. So you must see the hidden files in your FTP client.
Once you access the public_html folder, you will find the .htaccess file. Create a new folder on your desktop and copy the .htaccess file in that folder. Create another folder in that folder and name it “New”. Again copy the .htaccess file in the “New” folder. We did this step because the .htaccess file in the “New” folder is where we will make the chances. And the other .htacccess file is to keep it secure.
Open the .htaccess file in the “New” folder using Notepad and copy this code under the RewriteEngine On.
Redirect 301 /index.php/2018/08/07/old-post/ http://wordpress-168726-575304.cloudwaysapps.com/index.php/2018/08/07/new-post/
The first part of the code is where you include the URL of the old post. You must include that URL without the domain name.
The second part of the code is where you include the URL of the new post where you want to redirect your visitors to. You must include that URL with the domain name.
Save the .htaccess file and copy it to your WordPress files. Just drag the file from the left side of your FTP to the right side. Make sure you have a public_html folder open.
That’s it! You have successfully applied a WordPress 301 Redirect using the .htaccess. I hope this guide has answered all your questions regarding WordPress 301 Redirect. If you have any feedback or query regarding the topic, let us know in the comments.
Frequently Asked Questions
Q1. Can you undo a 301 redirect?
Yes you can undo a WordPress 301 redirect, although it is permanent. However, while you are canceling a 301 redirect, you must also perform the Fetch and Render in Google search console. The idea is for Google to know that there is content available on that page again. If you don’t perform this function, it might take a very long time for Google to comeback to that URL.
Q2. Does 301 redirect affect Google ranking?
WordPress 301 redirects will not harm your Google rankings. Previously you would lose around 18% pagerank after a 301 redirect. But now the rules have changed. You would lose absolutely 0% pagerank after a 301 redirect.
Q3. How to apply 301 redirect without .htaccess”?
If you don’t have access to your .htaccess but you do have access to your code. You can use this code to create 301 redirects:
header(“HTTP/1.1 301 Moved Permanently”);
If your website is built on WordPress, you can use WordPress 301 redirect plugins to create redirects easily. Some of the best plugins for this purpose include:
Simple 301 Redirects
SEO Redirection Plugin
Q4. How to 301 redirect in cPanel?
It is really simple to create a 301 redirect in cPanel. Just follow these steps and you will be able to create a 301 redirect:
Click redirects in the domains section of cPanel home screen.
Select the redirection type under Add Redirect option
Select “Permanent (301)”
Subscribe to Get a FREE WordPress Ebook Right in Your Inbox
WPblog provides the complete guide to launch your WordPress website completely FREE!
Moeez is ‘The’ blogger in charge of WPblog. He loves to interact and learn about WordPress with people in the WordPress community. Outside his work life, Moeez spends time hanging out with his friends, playing Xbox and watching football on the weekends. You can get in touch with him at moeez[at]wpblog.com.