Learn how to Setup Bulk 301 Redirects in WordPress (The Finest Means)



Seeking to arrange bulk redirects in your WordPress web site to deal with something from a permalink construction change all the way in which to web site structure enhancements?

No person likes damaged hyperlinks, which is why everytime you (completely) change the unique location of a webpage to a brand new one (the place it’s nonetheless accessible), a 301 is the most effective & best suited option to direct guests to the brand new, up to date web page. 

On this information, we’ll check out:

1 What Is A 301 Redirect? 

301 Redirect

A redirect that returns the HTTP response code 301 Moved Completely is used when the placement of a useful resource (i.e. a webpage) is up to date with the intention of being modified completely. That is good for conditions the place you’ll want to change the URL of a web page in your web site that’s already been printed (and might also already be rating in search outcomes). 

Widespread examples of situations wherein utilizing 301 redirects is a superb selection embrace when a web page isn’t related, helpful, or has been moved, in addition to after a web site rebuild when URLs change – by altering permalink construction or general web site structure. It’s essential to keep away from dropping natural visitors because of the results on search engine optimisation to implement redirects as quickly as doable after the placement of useful resource adjustments or is altered. 

Word: You will need to observe that canonical URLs are totally different and needs to be utilized in totally different conditions. Study extra about canonical URLs right here. 

2 The Distinction Between 301 Redirects & Different Redirects

A 301 redirect is particularly for everlasting adjustments or adjustments which might be supposed to be everlasting on the time of being made. In distinction, the aim of 302 and 307 redirects are each designed for conditions wherein you want to ahead visitors to a brand new URL briefly. In different phrases, should you’re trying to direct guests to another web page briefly however then intend on bringing the unique URL again sooner or later sooner or later, use a 302 redirect.

Whereas within the case of a 301 redirect, the intention needs to be that the change is taken into account everlasting.

Right here’s a short overview of the totally different redirect varieties: 

Redirect Sort Description / Utilization
301 (Everlasting) A everlasting redirect is utilized in plenty of situations corresponding to when deleting a web page (to redirect visitors to the following logical location) or when the unique location of a useful resource is altered. 
302 (Short-term) A 302 redirect lets engines like google know {that a} web site or web page has been moved briefly.
303 (See Different) The 303 redirect standing response code signifies that the redirects refer to a different web page (corresponding to a affirmation web page or an add progress web page). This response code is normally despatched again on account of PUT or POST
307 (Short-term) A short lived redirect – as above, is usually utilized in extra complicated improvement environments corresponding to when processing bank card funds and redirecting guests to make sure that them refreshing their web page doesn’t resubmit the checkout kind.
308 (Everlasting) There is no such thing as a actual distinction in implementation with the usage of the 308 redirect besides {that a} 301 redirect doesn’t permit altering the request technique from POST to GET whereas a 308 does (because it repeats the request utilizing the brand new URL).

Study extra concerning the various kinds of redirects right here.

3 The Results of 301 Redirects on search engine optimisation (and Visitors)

Google formally recommends utilizing 301 redirects within the case of area identify migrations and the opposite situations we’ve recommended. And, as such, they’ve suggested that 301 redirects (since thought of everlasting) can protect PageRank. That means 301 redirects sign to engines like google that the web page nonetheless exists however simply in a (barely) totally different location – in order that they’ll have the ability to crawl and index the brand new web page on the new URL to rank them as quickly as doable. 

On this video – which continues to be referenced to this present day – regardless of being from 2013, Matt Cuts alludes to a lack of PageRank prompted through the use of redirects. Google has since confirmed that that is not the case. 

4 When To Use A 301 Redirect

A 301 redirect needs to be used if you’ve eliminated or deleted a web page completely from the web site’s structure but need to protect its visitors, rankings, and hyperlinks. 

Under are among the examples the place 301 redirects could be an excellent possibility:

  • Shifting a brand new area completely

Authentic area: https://www.yoursite.com/

New area: https://www.yournewsite.com/

  • Shifting a doc or web page completely

Authentic “About Us” web page: https://www.yoursite.com/about-us/

New “About Us” web page: https://www.yoursite.com/about/

  • Altering a web site’s construction completely

Authentic construction: https://www.yoursite.com/2021/07/post-name/

New construction: https://www.yoursite.com/post-name/

You, nevertheless, would not use 301 redirects for the next: 

  • Geotargeting
  • A/B testing
  • Machine Concentrating on 

5 How To Setup 301 Redirects In Bulk

Now, let’s get onto the most effective methods to implement 301 redirects in bulk:

Methodology #1 – Utilizing Rank Math’s Constructed-In Redirect Supervisor

With Rank Math’s Constructed-in Redirection Supervisor – managing 301 redirects couldn’t be simpler. So with out additional ado, let’s enable you to arrange your bulk 301 redirects. 

[step 1] Set up & Activate Rank Math

Each WordPress web site wants a WordPress search engine optimisation plugin – ideally one that permits you to take full management of your web site’s technical & on-page search engine optimisation. Thankfully, that’s precisely what we do right here at Rank Math.

Rank Math

So, as you would possibly’ve guessed, step one – should you haven’t already – is to go forward and set up the Rank Math WordPress search engine optimisation plugin:

  1. Obtain Rank Math
  2. Observe Rank Math’s Setup Information
  3. And that’s it! Preserve studying…

Word: Bulk redirections are doable within the free model of Rank Math however should you’re serious about studying why the most effective SEOs on the planet select Rank Math PRO & Enterprise to get a aggressive edge, see how our plans examine right here

[step 2] Allow The Redirections Module

Subsequent, because you’ve now put in Rank Math – whereas there’s nothing additional to put in, you simply want to go on over to Rank Math > Dashboard in your WordPress admin space with a purpose to verify that the Redirections module is enabled. 

Enable Redirections

[step 3] Add A Single Redirect

Now that Rank Math is put in and the Redirections module is enabled, you’ll have the ability to navigate to Rank Math’s Constructed-In Redirection Supervisor by navigating to Rank Math > Redirections in your WordPress admin dashboard as proven beneath: 

Rank Math Redirections

After which, you’ll be able to go forward and create a 301 redirect by merely coming into the URL you want to redirect as your Supply URL and the placement of the brand new useful resource (i.e. the place you’d prefer to redirect the supply URL to) because the Vacation spot URL

Redirect Options

And as soon as able to activate, merely click on Add Redirection

Study extra about creating redirects in our documentation or in our detailed video tutorial beneath: 

[step 4] Including A number of Redirects / Bulk Redirects

However that’s not all! You’re right here to learn how so as to add 301 redirects in bulk. In order that’s what we’re right here for and let’s see how simple Rank Math makes this for you. 

Possibility #1: Copy & Paste A number of Supply URLs

Add Redirects In Bulk

Relying on the situation wherein you are attempting to create redirects in bulk – the primary approach to do that in Rank Math is just making a single redirect with a number of supply URLs. That means that this could, after all, solely work if every of those supply URLs has the identical supposed, new location & vacation spot URL.

Possibility #2: Updating, Modifying & Importing Redirects through CSV PRO

Thankfully, we constructed Rank Math to make on a regular basis, tedious and repetitive search engine optimisation work as simple as doable. So, along with with the ability to create 301 redirects in bulk by making a redirect with a number of sources, you may as well simply handle (add or modify) a whole lot of 301 redirects, all of which have totally different sources and locations in a matter of minutes. 

Right here’s precisely learn how to get began: 

  1. Export Your Present Redirect(s) to a CSV

    To take action, navigate to Rank Math > Redirections after which deciding on Import/Export – as proven beneath:

    After all, on this situation, we need to export the redirects first, this may be finished by clicking the Export tab & then the Export CSV button:

  2. Open the CSV file in Google Sheets (or Excel)

    Now that you’ve your CSV file, it’s time to open it up in Google Sheets (if you wish to collaborate along with your workforce) or Microsoft Excel.

  3. Edit the CSV file to replace redirects, create new ones

    Edit the CSV file to replace the present redirects, create new ones, or take away redirects that you just not want to have in your web site.

  4. Import the CSV file utilizing Rank Math’s Redirections Module

    And when you’re prepared to use your adjustments, merely navigate again to the Import tab in Rank Math’s Redirections Supervisor & add your CSV file:

Word: Please proceed with warning as adjustments can’t be reversed. If you need the choice to undo all of the adjustments made to redirects, we suggest taking a backup of your WordPress web site earlier than re-importing the CSV. 

Possibility #3 – Utilizing Regex (Superior)

Regex – brief for normal expression – is a string of textual content/syntax that means that you can create expressions that match sure textual content (i.e. ones that adhere to particular patterns). Within the context of 301 redirects, that is extremely helpful because it means which you can create redirects in bulk just by matching all URLs that match right into a sure sample. 

For instance, if should you change your WordPress web site’s permalink construction from Day and Identify to a advisable construction corresponding to /%postname%/ – you could possibly add 301 redirects in bulk through the use of Excel & Google Sheets formulation together with Rank Math’s import/export choices. 

Or, you could possibly alternatively use a easy common expression. For instance, listed below are among the most typical common expression characters.

Character Interpretation Instance
* Zero or extra occurrences of the previous aspect.  ab*cd matches “acd”, “abcd”, “abbcd”, “abbbcd”, and so forth.
? Zero or one prevalence of the previous aspect. abc? matches “abc” and “ab”
+ A number of occurrences of the previous aspect.  ab+cd matches “abcd”, “abbcd”, “abbbcd”, and so forth, however not “acd”.

The necessary factor to notice right here is that Rank Math helps Regex proper out of the field. Nevertheless, we extremely advise you to proceed with warning particularly in case you are inexperienced with common expressions and adjustments that may break your web site. So earlier than making adjustments, the very least you could possibly do is take a look at a sample and finetune it to make sure it matches solely what you need it to utilizing Regex101

An important use-case of a Regex redirect is if you used AMP in your web site beforehand however need to disable it. When doing this you’ll have to redirect all AMP URLs again to the unique, regular URLs. This could simply be finished with common expressions including the next as supply & vacation spot URLs in Rank Math:

Regex Supply URL: /(.*)/amp
Vacation spot URL: /$1

Methodology #2 – Various, Single-Use Third-Get together Plugins

Now, should you don’t want to use Rank Math’s Constructed-in Redirections Supervisor – there are after all a complete vary of single-use plugins (i.e. ones targeted on solely a single function) which might be options that we are able to suggest.

Listed here are some various redirection plugins value testing: 

  1. Redirection
  2. 301 Redirects
  3. PrettyLinks
  4. Secure Redirect Supervisor

All the above plugins make it extremely simple to create 301 redirects much like how Rank Math’s built-in Redirections module works: 

And, the Redirections plugin (which is free) specifically additionally has the power to import & export your redirects to create bulk 301 redirects – as proven beneath: 

Methodology #3 – Creating 301 Redirects in Bulk By Modifying Your .htaccess File

A .htaccess file is a file that sits within the root listing of a web site that controls Apache (an internet server stack) which your net host could use – permitting you to simply allow or disable sure performance, together with creating redirects. For this technique to work, you will want to have the ability to make adjustments to your web site’s .htaccess file and your net host’s server configuration should assist the usage of .htaccess configuration recordsdata. 

Right here’s what the code so as to add a .htaccess redirect seems like:

“redirect 301 /outdated https://rankmath.com/new

The start “redirect 301” merely signifies to Apache that the knowledge that follows is a redirect (specifically a 301 redirect) to ahead one URL to a different. And, within the case above “/outdated” is the unique location (i.e. redirect supply) of the web page. And the “https://rankmath.com/new” URL is the vacation spot for this redirect.

Please observe: this a part of the code requires the total URL to be entered in its entirety together with “http://” or “https://”, for a .htaccess server-level redirect.

In case you already use WordPress, after all, Rank Math makes this very simple because it even affords the power to sync redirects to your .htaccess file in order that they’re carried out on the server stage. 

However, even when your web site isn’t powered by WordPress, you’ll be able to nonetheless profit from utilizing Rank Math to handle your redirects since all redirects created can simply be exported to .htaccess recordsdata or NGINX config recordsdata. 

That means which you can create and modify redirects in bulk utilizing Rank Math’s Export to CSV possibility after which re-import the redirects right into a WordPress set up so that you could export them to a .htaccess file and add the redirect guidelines on to your web site’s .htaccess file.

Word: Redirectly is a great tool that helps take the guesswork out of producing extra difficult redirect guidelines. 

Methodology #4 – Creating 301 Redirects in Bulk By Modifying Your NGINX .conf File

Relying in your hosting setting, it’s possible you’ll not have the ability to create 301 redirects by modifying your .htaccess file – wherein case, another could be to make use of the NGINX config (.conf) file to take action as a substitute… 

Just like how the .htaccess file features, you’ll be able to create a 301 everlasting redirect in NGINX by including the next line:

“rewrite ^/outdated$ https://rankmath.com/new everlasting;”

The “rewrite” matches common expression patterns in parenthesis.

The “/outdated” gives the unique location of the web page

The “https://rankmath.com/new” is the brand new URL of the web page and is the place the server ought to redirect guests to.

The “everlasting” tells NGINX that this can be a everlasting redirect so it’ll use the 301 (moved completely) response code. 

As soon as full, you will want to restart/reload NGINX for newly created redirects to begin working as anticipated. As talked about above, for .htaccess recordsdata – even when your web site isn’t powered by WordPress – you’ll be able to nonetheless handle your redirects with Rank Math as all redirects created can simply be exported to .htaccess recordsdata or, on this case, NGINX config recordsdata

That means that every one you’ll want to do is: 

  1. Export the CSV redirects utilizing Rank Math
  2. Modify the file to create, edit and delete redirects as you see match
  3. Re-import the CSV utilizing Rank Math
  4. Export your redirects to your NGINX config file
  5. Add the foundations to your server (particularly to this net functions) NGINX .conf file. 
  6. Restart NGINX to make sure that the adjustments made take impact. 

5 After Motion Report – Take a look at Your Redirects

Now that precisely learn how to arrange & deploy 301 redirects in bulk – it’s necessary to notice that it’s best to totally take a look at your redirects as you implement them – particularly should you used one of many superior implementations or selected to make use of common expressions. Take a look at edge circumstances, variations of your area (i.e. www and non-www) to make sure that the redirects do actually work as supposed. 

An important easy software for this which makes it tremendous easy to bulk take a look at URL HTTP standing codes, response headers, and redirect chains is HTTPstatus.io

If in case you have completely any questions or need to be part of the dialog – Tweet @rankmathseo! 💬



Please enter your comment!
Please enter your name here