Beginner’s Guide: How to add 301 redirects to WordPress

Are you scuffling with how to add 301 redirects to WordPress? These useful redirects are an website positioning pleasant strategy that permits you to redirect visitors to your web site in lots of helpful methods. But they’re additionally complicated for a lot of common WordPress customers.

To allow you to, I’ll use this put up to discover 301 redirects that apply to your WordPress web site.

I’ll begin with a primary dialogue of what 301 redirects are and if you need to add 301 redirects to WordPress. Then I’ll present you the way to set them up with a free plugin or .htaccess file.

If you might be already acquainted with the fundamentals, you’ll be able to click on the button beneath to go instantly to the tutorials:
Go instantly to the tutorials
Otherwise we’ll begin!

What does 301 redirect do?

In normal, redirects are a method to robotically ship guests who land Page A instantly to Page B. In precept, you utilize redirects to robotically redirect visitors in case you ever want to transfer web page (s).

You can implement various kinds of redirects in your web site, normally marked with a sure quantity. Without being too technical, these numbers principally point out whether or not the web page has moved completely or quickly.

Redirects 301 take care of steady actions.

This implies that the 301 redirect tells internet browsers and serps, “Hey, this page has permanently moved to a new location.” So deal with it identical to the outdated web page “

The most important benefit of this everlasting strategy is website positioning. According to Moz, redirect 301 “passes between 90-99% of the juice from the links (ratings) to the redirected page.”

Basically, if you’d like to redirect human visitors and If you need your new web page to keep the identical Google rating because the outdated web page, a 301 redirect is normally finest.

You can redirect multiple web page

One neat factor about 301 redirects is that you’re not pressured to use 301 redirects on a 1: 1 foundation.

You can redirect a number of pages to one new web page, or robotically redirect all pages that meet sure standards to your new model.

Below I’ll deal with these extra superior forms of 301 redirects.

Some examples the place WordPress customers want a 301 redirect

Now I need to be just a little extra particular and really offer you a couple of examples of if you need to use 301 redirects in your WordPress web site.

  • Change the construction of a permalink or snail. If you do, you will need to redirect URLs utilizing the outdated permalink or slug construction to the brand new one.
  • Change the URL of a single put up or web page. WordPress ought to robotically redirect the URL of the outdated put up to the brand new one, however I nonetheless suggest manually setting the 301 redirect, as a result of the method would not at all times work.
  • Merge a number of posts into one. Some website positioning consultants suggest merging a number of small posts into one horrible put up. If you do, you will have 301 to redirect all these small posts to massive ones.
  • Move to HTTPS / SSL in your web site. If you add SSL to your WordPress web site, you could add a 301 redirect to ship all unsecured visitors to the SSL model of your web site.
  • Change your area identify. If you utterly change your area identify, you could use 301 redirect to redirect visitors from the outdated area to the brand new area identify.

Below we’ll present you two strategies of including 301 redirects to WordPress that may deal with these completely different conditions.

How to add a 301 redirect to WordPress utilizing easy 301 redirects

For most smaller 301 redirects, you need to use a free plugin referred to as Simple redirect 301. Although you’ll be able to manually use .htaccess for all the pieces (one other technique I’ll present you), I like this plugin as a result of:

  • You can shortly create a 301 redirect with out leaving the WordPress Dashboard
  • Managing current 301 redirects is way simpler
  • For starters, it is simply simpler than copying an .htaccess file

To get began, set up and activate the plugin. After activation, you’ll be able to go to Settings → 301 Redirect begin establishing roughly 301 redirects:

simple redirection 301

Redirect one web page to one other web page

Let’s begin with the best instance – redirecting one put up or web page to one other particular person put up or web page.

Let’s say you need to redirect:

yourdomain.com/old-page

On

yourdomain.com/new-page

All you’ve to do is seize the URL of every web page relative to the foundation area of your web site. This normally implies that you solely need to take the a part of the URL that follows „.com’ (or what ends your area identify).

For our instance, because of this you’ll configure the plugin as follows:

  • Request: / outdated web page
  • Destination: / new web page

how to add 301 redirects to wordpress

Although you need to use the complete URL, utilizing solely the half relative to the foundation is a cleaner method to accomplish that.

Then click on Save Changes.

And that is all! Anyone who visits the outdated URL shall be robotically redirected to the brand new URL.

Using wildcards for extra complicated redirects 301

Wildcards are a barely extra superior function that permits you to dynamically redirect a number of pages to a number of related pages.

For instance, to illustrate you’ve a complete class of posts, equivalent to:

yourdomain.com/journey/POST-SLUG

You have 10 posts within the journey class, all utilizing the identical URL class service.

Let’s say you need to change the snail class to “adventure.” So you need all 10 of those posts to have a brand new URL:

yourdomain.com/journey/POST-SLUG

Rather than going by the tedious technique of manually redirecting every particular person put up, you need to use wildcards to robotically course of the method for you.

Essentially wild card, represented by an asterisk *, is “any dynamic value entered in this part of the URL structure.”

Let’s return to an instance to present you the way it works.

If you configure Simple 301 Redirects, observe these steps:

  • Request: /journey/*
  • Destination: / journey / *
  • Check Use wildcards? field

using wildcards in simple redirects 301

This configuration implies that:

  • yourdomain.com/journey/vietnam will get redirected to yourdomain.com/journey/vietnam
  • yourdomain.com/journey/thailand shall be redirected to yourdomain.com/journey/thailand
  • Etc.

You may even be extra inventive through the use of wildcard redirection if you’d like. Here are some examples from the plugin documentation:

examples of wildcards

How to add a 301 redirect to WordPress by way of .htaccess

If you want to arrange a broader redirection — for instance, to redirect the complete area to one other area or to redirect visitors to SSL, it’s also possible to implement 301 redirection by an .htaccess file.

Although it’s also possible to add a primary 301 redirect to your .htaccess file in case you’re solely redirecting content material to your current WordPress web site, I believe it is simpler to use Simple 301 Redirects.

To add a 301 redirect to your WordPress web site, you want to join to eradicate a folder of your WordPress web site by way of FTP or cPanel File supervisor instrument.

Then find the .htaccess file:

where to find the .htaccess file

It is necessary to again up your current .htaccess file earlier than making any modifications to your web site. Even small bugs can tank your web site – so you will positively need to use a current backup in case one thing goes improper.

Once you have backed up the present contents of the .htaccess file, you’ll be able to add a 301 redirect to the highest of the .htaccess file.

Here are some examples of 301 redirect sorts you’ll be able to implement:

301 Redirect one web page utilizing .htaccess

To redirect one web page to one other, you need to use:

Redirect 301 /old-url /new-url

Where every half is a part of the URL that comes up after your area identify (as with the Simple 301 Redirects plugin).

Set the 301 redirect to SSL

If you have not too long ago arrange SSL, it is best to add a 301 redirect to ship HTTP visitors to https to guarantee higher safety and keep away from duplicate content material.

To do that, add the next code snippet:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

301 Redirect the complete area utilizing .htaccess

If you are transferring your WordPress web site to a brand new area identify, the next code snippet redirects every web page in your outdated area to the identical web page in your new area (offered that you just keep the identical permalink construction):

#Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]

You should add this snippet to the .htaccess entry file in your outdated area identify – Not your new area identify.

Be positive to change “newdomain.com” with the precise new area identify.

We pack issues

301 redirects are website positioning apply everytime you change the URL of any content material in your WordPress web site.

To handle 301 redirects instantly from the WordPress Dashboard, Simple redirect 301 is a superb free plugin.

Otherwise, you need to use .htaccess to manually redirect all or a part of your WordPress web site.

Do you’ve additional questions on how to add 301 redirects to WordPress? Let us know within the feedback and we’ll strive to assist!

Leave a Comment