Whether you’re trying to redirect a page in WordPress or you want to find out and understand why it’s important, this guide will help you and show you what to do.
Sooner or later, we all find ourselves in a situation where we need to redirect a post or page on our WordPress blog or website. So that you are prepared for this eventuality, you will find everything you need to know here to be able to do it yourself.
Understanding redirects in WordPress
When we talk about redirects, we’re referring to the method of mapping one URL to another. When a user types in a link or clicks on a link to page A, you can redirect them to page B instead.
There are five main types of redirects that you can use below:
- 301 – This type of redirect is permanent. The 301 redirect indicates that the original page no longer exists at its current URL address. The 301 redirect is the best redirect you can use to make sure that your website maintains its standing in search results.
- 302 – This WordPress redirect serves as an alternative page if the requested file exists at the specified address but cannot be found for some reason. 302 is a temporary redirect that caused problems with some browsers, which is why most website owners no longer use it.
- 303 – This type of redirect was created as a replacement for the unhelpful 302 redirects and prevents refreshing the screen or bookmarking sensitive data such as credit card information.
- 307 – This redirect is temporary and almost identical to a 303 redirect. The only difference is that a 307 uses the same technique to send and retrieve information. 303 uses two different methods.
- 308 – This redirect is a cousin of 303 and 307 redirects and achieves the same functionality. However, it is permanent and more suitable for programmers than normal WordPress users.
Each type of redirect has its specific purpose and benefits. In this article, we will focus on 301 redirects, as this redirect is the most common when working with WordPress.
Reasons for using a redirect in WordPress
Some types of redirects can be used to directly support your website and business, while other redirects are used to resolve various technical issues. The top reasons why you may need a redirect on your website include the following:
404 errors
These errors usually occur when a user requests a page that cannot be found. This can happen when you move a page to a new URL address or simply because a visitor has entered a URL incorrectly.
Permalink changes
Changing your WordPress website’s permalinks to make them more readable can improve your website experience. However, if you change the default structure of your existing URLs, you should set up redirects so that your website visitors don’t receive a 404 error.
Directory changes
There may be times when you need to move your website’s directory, whether for general restructuring or other security reasons. With a 301 redirect, you can make sure that website visitors still end up in the right place.
Search Engine Performance (SEO)
When it comes to improving your search rankings, 301 redirects can be a powerful tool in your WordPress toolkit. The most common scenarios where they make a real difference include website redesigns, URL structure changes, and moving from HTTP to HTTPS.
Search engines, particularly Google, pay close attention to how you handle them, and there are some important rules to follow.
The golden rule of redirects is simple: make sure the page you’re redirecting to actually matches what visitors were looking for on the original page. If someone clicks a link expecting to read about WordPress security tips and gets redirected to your contact page, that’s not just frustrating for users – search engines will treat it like a soft 404 error. This can actually hurt your rankings rather than help them.
Before you start setting up redirects, take some time to map out your plan. Which pages are you redirecting, where are they going, and why? Having this documented will save you headaches later and help you spot potential issues before they impact your search performance.
Two ways to redirect a page in WordPress
How do you perform redirects on your website? There are basically two ways – manually and with plugins. Take a look at both options and decide which is best for you.
How to manually redirect a page in WordPress
To set up a redirect via a server, you will need to log in via FTP, access your .htaccess file and edit it by adding the following code.
Redirect 301 /old-page/ https://yoursite.com/new-page/
That’s it. Note that this method will only work if you are using an Apache server.
How to redirect a page in WordPress with plugins
Fixing the redirect in WordPress with a plugin may be an easier and hassle-free method for some, which is why we recommend these plugins.
301 Redirects is a free WordPress redirect plugin that takes care of all 301 and 302 redirects. Whether you’re a new website owner or not, it’s a simple and lightweight plugin that’s easy to install and use.
After installation, you need to click on the Configure Redirects link or find the dashboard in the settings to configure your redirects.
Select the status code, enter the old link and where you want to redirect it to, save the changes and that’s it. You can also redirect this URL to another post, page, medium, term archive or any other location you specify.
There are a variety of similar plugins you can use to complete this task, but they all do pretty much the same thing — make it easier to implement 301 redirects.
Final thoughts
If you change the URLs on your WordPress website, or create a new post to replace an old one, you will probably need to set up a redirect. Depending on the changes you’ve made to your website, you can use an automatic redirect, a manual redirect or a wildcard redirect.
Whether you’re planning to move your site, change your permalink structure, or use redirects to fix broken URLs and improve your SEO, there are different methods to implement them in WordPress sites — which method is best for you depends on your situation and level of knowledge.