It’s explained in this video.
If you’re like me, you may have just upgraded your Yoast SEO plugin without checking first to see what the changes were.
Further, if you were like me, it might not have occurred to you that the developers of Yoast SEO would think it reasonable to remove well-established functionality from the free plugin.
Goodbye Yoast SEO 301 Redirect
Well, I got that wrong. It turns out they’ve removed the ability to add new
or edit existing 301 redirects. The ones that used to be conveniently situated on every page or post.
Don’t panic as the redirects you set up with the plugin won’t stop working. However you can’t add any more,
nor can you edit the ones you have.
It looks as if the Yoast SEO team have capitulated and quietly added (in V2.3.2), the edit box back in on pages where a redirect already exists, LOL. I didn’t spend ages looking but I didn’t see it in their changelog notes. . You’ll still need a new solution, but it looks like they realised what they did was wrong.
But there is still no list of all the redirects anywhere. So carrying on from where we left off ….
What the Yoast team did in removing the 301 redirect function was a bit inconvenient. But we should probably have been saving 301s in .htaccess anyway.
We Can Suggest Two Solutions
The good news is we have two solutions. One is something that’ll work for all WordPress themes, and the other is one for Genesis themes.
Quick Solution For All Themes
Here is the solution to the problem if you have upgraded already, or if you haven’t upgraded yet. As long as your WordPress database retains the information about any redirects you’ve already set up, this should work for you.
- Check The Prefix Used On Your WordPress Tables
- In your WordPress database your tables will have prefixes. Most people will have wp_ as the table prefix. But you must check. Mine for example were xy_ when I checked.
- Edit The Following SQL
Replace the wp_ in two places in this SQL code below, with your own table prefix.
So say your prefix is rj_, In this case you would replace wp_postmeta with rj_postmeta and wp_posts with rj_posts
- Alternatively, if you’re running the site in a blog sub-folder and your permalink structure is /%post_id%/%postname%/ then the SQL should look like this:
- Apply The SQL
Next you run the SQL you just figured out using the examples we’ve given above, on your database and it will spit out the lines of redirections that you can then paste into your .htaccess file.
For example, the above code generated this sort of thing for me. The number of lines you get will depend on how many pages or posts you used Yoast’s redirect feature on.
You then take the lines your SQL generates and paste them into your .htaccess file.
- But Won’t The Redirects Now Be In Twice??
By placing them in your .htaccess file you address the fact the redirects have now become invisible to you via Yoast SEO.
Because they will now be in the .htaccess file, you can change your mind about where they redirect to in the future and you can see them all in one place.
Further, you can do this without having to worry about how to access the hidden ones in the database left behind by the Yoast SEO plugin. The .htaccess file contents are applied long before anything in the WordPress database.
I can see why that once the Yoast team decided they wanted to remove the functionality, they had to leave existing redirects in the database, or all hell would have broken loose.
But you could also argue that it is wrong to leave people without a method to manipulate what was left behind by a functionality backtrack.
If you’d like to do a cleaner job, you can remove the records from the database by issuing the following SQL statement. Once again replace wp_ with your table prefix.
- What Next?
- You are now free to carry on using .htaccess exclusively for your redirects, or to start using some other redirection plugin.
The following assumes that you are running the site in the root directory (not a subfolder) and are using /%postname%/ as the permalink structure. You will need to modify the SQL to reflect your permalink structure
Easy Solution For Genesis Themes
If your site runs on the Genesis Framework, don’t worry. You can avoid doing any of the SQL database stuff outlined above.
The result will be that:
- The Yoast SEO redirects are copied from your database
- They’re set up as redirects in the Genesis Club plugin (either our premium or the free version)
- The original Yoast SEO redirects are removed from your WordPress database altogether
- The Genesis Club plugin gives you the ability to place redirects on a page or post basis, as was possible on Yoast SEO before the update, and
- the ability to extract them out and put them into .htaccess whenever you want, and
- the ability to see them in a list in the plugin’s dashboard so you can tell what’s going on with your redirects at any time. (The Yoast plugin never did that)
In other words, you’ll get slightly more than you had before.
All you’ll have to do is install either the Pro or the Free version of the Genesis Club plugin. See this blog post for details.