If you are trying to create redirects in WordPress and doubt whether it is important, read on this article to learn what redirects are, how to create them, and why you need them.
What Is the Purpose of Redirects?
A redirect is a way to send a quick notification to the visitor’s browser and inform them that the page they wanted to visit has been moved, so their browser can automatically forward them to a new page that you define.
Now the main question that probably arises in your head is, why do we need to redirect the visitor? Why can’t we just edit or delete the entry? The reason for using redirects is that deleted posts, and broken links can severely damage your site’s rankings.
The visitor comes to the page after seeing it in the search results – and there is nothing there. The bounce rate rises, and the credibility of your site drops. If you redirect the visitor to a new page or home page, these problems can be avoided.
So, page redirects may be required for several reasons:
- There is an error in the URL and title that you want to fix.
- The external link was pointing to the wrong address, and you want visitors to navigate to the correct page.
- Linking other keywords to your page.
- You’ve switched to a different domain and want your previous site’s traffic and SEO metrics to flow to your new site.
- You want to change part of your URL.
Redirect Codes and Their Meaning
There are two main types of redirects – permanent (301) and temporary (302, sometimes 307). The numbers in brackets are the codes used in the HTTP redirection protocol. Please note that a permanent redirect does not mean that it cannot be changed in the future.
Browsers and search engines remember permanent redirects for a longer period than temporary ones. To find out what type of redirect is used in a particular case, you can use the Network tab in the browser developer panel and view the headers sent by the web server.
Now let’s take a closer look at the types of redirects. The 301 type is the most common redirect. It says that the page has been moved permanently, and now its new version can be found elsewhere. Such page redirects can transfer up to 99% of SEO power (from the old page to new).
The 302 type means that the page has been temporarily moved. The original URL is currently unavailable, but it will be returned back, for now, you can use the page with the new link (the link power is not transferred).
As for 303, it is used only for form submission to prevent users from re-submitting data when using the browser back button. You probably won’t need this unless you are a developer. Speaking about 307, it can be said that it is the same as 302, only for HTML1. This type indicates that the content has been temporarily moved to a new address. 308 is a permanent version of a 307 redirect.
In general, you can use the 301 code if you plan to delete a page and want to redirect users to a different relevant URL, and also when you want to change the permalink to a web page.
302 is intended for making changes to a web page that users shouldn’t see and also when you redirect them to a temporary sales page. Thanks to this redirect, search engines will not index the temporary page.
Redirects and Their Disadvantages
Page redirects are a great tool for many specialists, such as webmasters and marketers, however, their disadvantage is that they can have a huge impact on page speed. Redirects are an extra step in page loading. Even though they add some milliseconds, this is all very important because visitors want the page to load as quickly as possible.
Efficient Ways of WordPress Redirection
There are several ways to implement a redirect in WordPress. You can do this via a plugin (Redirection, Quick Page/ Post Redirect, Safe Redirect Manager, SEO Redirection, Simple 301 Redirects) or manually via .htaccess. For instance, if your site has broken or deleted pages and links, Quick Page/Post Redirect plugin will help redirect them to the new page of your choice. It has the ability to add different types of forwarding with two functions – fast and individual.
This plugin is very good for 301 redirects: you just enter the request address and target address, and the plugin does all the work on its own. And it’s available completely free of charge. Both methods have their pros and cons. Plugins are an easy-to-use approach, but potentially slower, which can lead to performance issues.
.htaccess is a more advanced approach. Using .htaccess is faster because redirects are configured at the server level. Using the .htaccess web server configuration file, WordPress users can set up 301 redirects that are fast.
Please note that even the smallest mistake in your .htaccess code can render your WordPress site inaccessible, and an Internal Server Error may appear. This is why it is important to back up your .htaccess file before making any changes to it. In order to make changes to your .htaccess file, you need to connect to the site using an FTP client.
The .htaccess file is located in the root directory. If you do not see it, then you need to enable displaying hidden files in the FTP client settings. You can edit .htaccess in any text editor like Notepad.
We hope that we managed to clear things up for you a bit with this article and helped you understand how and why to create redirects in WordPress.