How to Create Redirects in WordPress

Several times, you have to add a redirect to the different pages of your WordPress sites. It is necessary when you change URL structure or alter the post slug of an article. This is because when you change your permalink structure, or if you remove posts or pages, you more likely to generate 404-page errors.

A 404 error means the page you were trying to reach on a website couldn’t be found on the server. It causes because of a website owner has moved a page or resource but did so without redirecting the old URL to the new one. In such cases, you should redirect the visitor to the new location.

[clickToTweet tweet=”Introduction to #WordPress #redirection and how to add them.” quote=”In this guide, I will introduce you to WordPress redirection and how to add them.”]

So let’s start.

What is Redirect?

It is the simplest way for your reader’s browser and tells them that the page they want to visit has been moved. Finding this, their browser will automatically point them to the new page of your choice, where you have redirected the original page.

Redirects are categorized into various types including 301 redirects, 302 redirects, 307 redirects.

301 redirect:

Majority of redirects are 301 redirects. It is an HTTP response code that shows a message that a page has moved permanently.

Adding 301 redirects is the most efficient and Search Engine Friendly method for webpage redirection. When you add 301 redirects, it sends readers and search engines to a different URL than the one they originally typed into their browser or selected from a search engine results page.

It is far better way than temporary redirect as transfers the inbound links from the redirected domain to the new one. Thus, it helps to maintain site ranking. Check out most important ranking factor.

 302 redirect:

A 302 redirect is a temporary redirect. It actually does not pass on all qualities of the redirected page to the detour page.

You can use this redirect if you want to redirect your readers to another webpage but you plan to bring the redirected page back after some time.

Although, its bit critical to use 302 redirects as it does affects site ranking.

307 redirect:

A 307 redirect is the successor of the 302 redirect. Most of the crawlers treat it as a 302 redirect. The only difference between 307 and 302 is that 307 guarantees that the method and the body will not be changed when the redirected request is made.

Which WordPress Redirection should You Use?

There are various options for doing this. But I recommend 301 redirect as it is preferable for both users and search engines. The engines will also carry any link weighting from the original page to the new URL.

How to Redirect a Page Using Htaccess

  • First, at all, keep a backup of your .htaccess file before making any changes.
  • Next, to edit your .htaccess file, go to FTP. The .htaccess file resides in your WordPress site’s root directory. (How to edit the .htaccess file?)
  • Add following code to .htaccess file.
# Redirecting old post to new post
RewriteEngine On 
Redirect 301 /a-very-old-post/ http://yoursite.com/a-very-new-post/

This will add redirection to your old URL.

Another approach to create and manage redirects is by using one of the many WordPress redirect plugins. This will also save your time of writing code.

Here, I have listed best effective plugins that will ease your task.

1. Redirection:

This is the best plugin to easily manage 301 redirect keep track of 404 errors, and generally tidy up any loose ends your site. In other words, it is quite popular and has all the basic features including conditional redirects, full logging and tracking 404 errors.

adding redirect using redirection plugin in wordpress
Adding post/page redirect using redirection plugin in WordPress (Normal mode)

Setting up Redirection plugin:

  • Go to Plugin directory and search for Redirection.
  • Install and Activate the plugin.
  • Now, go to tools from Dashboard menu >> Tools and select Redirection.
  • Paste in the old URL of the page you want to be forward in the box labeled ‘Source URL’.
  • Paste the new URL where you want Google and your visitors to end up in the ‘Target URL‘ field.
  • Hit Add Redirect button.

Now, check if old URL redirecting to the new URL.

The plugin comes with the advanced options which can be seen after clicking on the gear icon next to the Add Redirect button. Below screenshot showing the Advanced Options in the plugin.

Adding post/page redirect using advanced options in redirection plugin in WordPress
Adding post/page redirect using advanced options in redirection plugin in WordPress

Get Plugin

2. Simple 301 Redirects:

It is considered as the easiest way of redirecting requests to another page on your site or elsewhere on the web. Moreover, it allows you to edit PHP header to create a redirect.

Setting up Simple 301 Redirects plugin:

  • Install and activate the plugin.
  • Go to Settings >> 301 Redirects page.
  • There will be two clear boxes to add your OLD URL in Request box and NEW URL in the Destination box.
  • Save changes.

It will automatically add 301 redirection type.

3. Safe Redirect Manager:

It is an HTTP redirect manager for WordPress. Basically, it uses the wp_safe_redirect function which only allows redirects to whitelisted hosts for security purposes.

Setting up the plugin:

  • Install and activate the plugin.
  • Navigate to Tools >> Safe Redirect Manager.
  • At the top of the redirect page, select Create Redirect Rule.
  • Copy and paste the old URL into the “Redirect From” section.
  • Copy and paste the new URL into the “Redirect To” section.
  • Click on Publish.

That’s all we have done by creating WordPress redirection. Hope this guide helped you set up redirects on your site.

You might like to read How to Secure WordPress Blog using the .htaccess method.

ALSO READ

Subscribe to our newsletter

To be updated with all the latest news, offers and special announcements.

Comment Policy: Your words are your own, so be nice and helpful if you can. Please, only use your real name and limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please.

2 COMMENTS

  1. Hi Amit,
    Thanks for the detailed post. I am using Redirection for my 301 redirects. I have a question – do I permanently delete the post from the old url after I redirect it?

LEAVE A REPLY

Please enter your comment!
Please enter your name here

GET STARTED

Start WordPress Blog: Ultimate Guide For Beginners

Here is our step by step guide for beginners to start a WordPress blog.

Top 6 Best WordPress Theme Frameworks

There are many websites themes which are created by using a framework. Likewise, WordPress Theme frameworks also becoming so popular. The framework allows you...

The Most Essential WordPress Plugins

Here, I have listed some excellent plugins which will surely add more features and new functionality to your WordPress blog.

Tips to Speed Up WordPress Performance

Here, I am sharing some tips to speed up WordPress performance. All you need to modify .htaccess file on your server and add some plugins.

The Ultimate Guide to Harden WordPress Security

Learn how to improve WordPress security. Here are some basic security concepts that will help you to harden WordPress security.

How to Setup CloudFlare Free SSL for WordPress Blog

Google has announced that they will count HTTPS as a ranking factor which means if you using HTTPS you will get a higher position...

DEALS

SEMrush

TRY SEMrush for Free!

POPULAR NOW

Get almost 100% PageSpeed on Newspaper theme

The newspaper theme is the most popular premium theme for a self-hosted WordPress blog. The theme is developed by team tagDiv. You...

How to Remove jQuery Migrate in WordPress?

jQuery Migrate greatly simplifies the process of moving older jQuery code to a higher jQuery version by identifying deprecated features. It then restores deprecated...

How to setup CloudFlare CDN for WordPress blog

In today's world website speed is a crucial element to getting good ranks on the web. Website speed also aids for indexing your site...

How To Reduce Admin-Ajax Server Load In WordPress

To increase better user experience, we always end up by increasing site speed. After clicking a website link seems like a simple thing. But...

How to Delete Multiple Images in WordPress Media Gallery

Hey, guys today one of my friends asked me a question, How can I delete Multiple Images in WordPress? I replied, "It's very simple." Yeah,...

WP Super Cache Plugin: Best Settings & Configuration Guide

A cache plugin serves static contents to the visitor which improves page load speed. There are so many cache plugins available in the...