Key Takeaways
WordPress redirects can improve user experience and SEO. Implementing redirects in WordPress can prevent visitors from encountering ā404 page not foundā errors and help maintain SEO rankings by guiding traffic to new URLs.
Choose between permanent and temporary redirects based on your needs. Selecting the appropriate redirect type (301 permanent or 302/307 temporary) in WordPress informs search engines how to handle the redirection, impacting long-term traffic flow.
Consider using redirect plugins for ease of management. Redirect plugins like Quick Page/Post Redirect offer a user-friendly interface within WordPress to efficiently set up and manage various types of redirects.
Apache users can utilize .htaccess for manual redirects. For those comfortable with editing .htaccess files, manual redirects can be implemented by adding specific lines of code to redirect old URLs to new destinations.
There may be times that you want to add a redirect within your WordPress website to point your visitors from one URL to another. For example, if you change the permalink structure of your site or remove posts or pages, if someone tries to visit that old link, all theyāre likely to find is a ā404 page not foundā message.
Thankfully like many things within WordPress, there are a number of ways to achieve redirects quickly and simply:
Redirect Plugins:
There are a number of plugins out there that you can use to take care of redirects. A personal favorite is Quick Page/Post Redirect.
This plugin lets you do exactly what it says on the tin ā redirect pages and posts, quickly.
Once installed, you will find a redirects section in the page/post editor in the back end of WordPress. In here, simply select the type of redirect you would like.The type of redirect you choose will depend on whether the redirect is temporary or permanent ā in other words, whether you simply want a redirect for the time being, or you are not planning on switching it back. Your options are:
- 301 permanent redirect: If the page you are redirecting will always be redirected, more often than not, youāll want to choose this option, as it informs Google to redirect all traffic to the new page, forever.
- 302/307 temporary redirect: The opposite of the above. If you plan on turning the redirected pageās URL back on at some point and donāt want Google to redirect all traffic, then you can choose this option.
- Meta redirect: This redirect actually happens after the initial page has loaded. It adds code to the original pageās source in order to cause the page to redirect after a set period of time. This may be useful if you wanted to add a message to the original page to tell visitors that the page theyāre looking for is now at a new address, but otherwise, a 301 or 302 redirect would be sufficient.
Once youāve chosen your redirect type, simply set where you want the page to redirect to, and mark it as active. When you publish/save the page or post the redirect will be active.
Alternatively, you can add a whole list of redirects in the plugin settings section itself. This allows you to create redirects for pages that perhaps donāt even have an entry in the WordPress CMS, which can be particularly helpful if you have previously moved from a non-WordPress site. You can add redirects to any link relative to your siteās URL; as long as the link begins with your siteās web address, you can add a redirect for it.
.htaccess Redirect
If your site is on apache and you have access to your .htaccess file, you can use it to add redirects to your site. If you donāt know what youāre doing with .htaccess files, it might be worth sticking to the plugin method above, as making an error in this critical file can cause some pretty serious site-wide consequences (such as it crashing completely and locking you out of WordPress!)
But for those who like to venture into this file, simply add the following line for each of your redirects:
Redirect 301 /pagetoberedirected.html http://www.yoursite.com/newpage The first URL is the one that you want to redirect, the second is where you want visitors to land instead.
And thatās it! Thereās nothing much to redirects, but redirecting visitors from broken links can improve their user experience and can help with your ranking amongst Google, so itās definitely worth giving it a go.