Are you trying to create a redirect in WordPress? Not sure what a redirect is and why it is important? Don’t worry, Beginner’s Guide to 301 Redirects in WordPress (Step by Step). We have got you covered in this beginner’s guide to WordPress redirects, we will cover what a redirect is, how to create a redirect in WordPress, why do you need, and when you should use redirects.
Ready? Let’s get started.
What is a Redirect in WordPress?
A redirect is a way for your website to send a quick message to your reader’s browser and tell them that the page they want to visit has been moved, so their browser can automatically point them to the new page of your choice.
There are various different types of redirects such as 301 redirect, 302 redirect, 307 redirect, etc.
However to keep this article simple and useful, we will only cover 301 redirects as that’s the most important.
Let’s take a look at why it is important by understanding the use case.
When do you need a 301 redirect in WordPress?
The primary reason to use 301 redirects is when your site or a page on your site has been moved, and you want to point the user to a new page instead.
This article idea came to us when one of our readers asked us for a way to redirect users from an old post to a new post.
– You need to create a redirect when you are planning on deleting a post or page in favor of new content.
– You need to create a redirect when you are planning on changing the permalinks of your post or page.
Why? Because not creating a redirect will cause your users to see a 404 not found error. Which is not only bad for users, but it can also impact your site’s SEO and hurt your search engine rankings.
That’s when 301 redirects become very important.
It allows you to tell search engines and your user’s browser that the page they are trying to reach has been permanently moved to a new location.
This allows for all your old page’s traffic and backlink (SEO) strengths to be transferred on to the new page.
Now that we have covered the why and when of redirects, let’s take a look at how you can create 301 redirects in WordPress using the different methods that are available.
Subscribe to Designtalks
If you don’t like the video or need more instructions, then continue reading.
How to Create Redirects in WordPress (using Plugins)
An easier approach to create and manage 301 redirects is by using one of the many WordPress redirect plugins. This allows you to setup redirects without ever writing a single line of code.
The simplest way to add and manage redirects in WordPress is by using the Redirection plugin. Install and activate the plugin. Once activated, visit Tools » Redirection to setup your redirects.
Redirection plugin not only allows you to setup redirects, it also helps you find out 404 errors on your WordPress site. You can then redirect those URLs to an appropriate destination. See this tutorial on how to track 404 pages and redirect them in WordPress.
2. How do I redirect a URL to another URL in WordPress?
Sometimes you may want to keep a post/page, but redirect it to another post or page. This is where Page Links to comes in handy. This simple plugin adds a meta box on your post edit screen where you can enter the address of the new location where you want to send your users.
After activating SSL, we want to redirect everyone who attempts to visit http URLs to https. A 301 redirect indicates that the page has been permanently moved to another URL, in this case, the http version. With Really Simple SSL, we distinguish two types of 301 redirects:
Another easy to use plugin is Simple 301 Redirects. As the name suggests, it makes 301 Redirects simple. Simply install and activate the plugin and then visit Settings » 301 Redirects to add your URLs.
Now while setting up 301 redirects using a WordPress plugin is easy, it has some minor performance setback. Based on your WordPress hosting provider, your WordPress redirects maybe a bit slower by some microseconds.
If you want to make your redirects faster, then you can do so by using the code method and .htaccess file.
The WordPress SSL 301 redirect
Really Simple SSL can issue a 301 redirect via PHP, which we call the ‘WordPress 301 redirect’. We enable this redirect by default, as it is unlikely to cause any conflicts once SSL is enabled. The downside of this PHP redirect is that it won’t work well on websites that use PHP caching
Setting Up 301 Redirects in WordPress using .htaccess
Using the web server configuration file .htaccess, WordPress users can set up 301 redirects that are fast.
That’s why it is important that you backup your .htaccess file before making any changes.
To edit your .htaccess file, you will need to connect to your website using an FTP client. The .htaccess file resides in your WordPress site’s root directory.
If you can’t see your .htaccess file there, then you need to force your FTP client to show hidden files. (See why you can’t find .htaccess file on your WordPress site.)
You can edit .htaccess file in any plain text editor like Notepad.
Here is a simple redirect, where we are trying to send a user visiting an old post to a new post.
You can add the code above preferably at the end of your .htaccess file.
That’s all. We hope this beginner’s guide to creating WordPress redirects helped you setup redirects on your site.
You may also want to check out these 9 most useful .htaccess tricks for WordPress.