Fix Old WordPress URL Redirecting to New URL

This is a little problem I ran into today and so of course I thought I would share it with you! I had a blog post which I renamed and changed the slug because I had a better article which I wanted the slug for.

Google loves short URLs and I had a 4,000+ word post that I needed the slug for.

Normally I don’t recommend changing slugs, but the original post was only live for a few days so there weren’t any backlinks against it or even indexed yet. The problem I ran into though was that my old post suddenly was redirecting to my new URL.

If you have having issues with WordPress URLs redirecting when they shouldn’t you first want to check your .htaccess file to make sure you don’t have any manual 301 redirects. If you have a 301 plugin running, check to make sure it isn’t also in there. Then check your categories, and trash because they might be stealing the slug (URL). So I checked all those really quick and still my post was redirecting.

So here is what happened. WordPress has this convenient feature of remembering the old URL and redirecting to the new URL so that your links aren’t broken. While this is cool and dandy, it also can cause frustration because there is no way to see this from the WordPress dashboard. And no it doesn’t show up under custom fields. The only way to remove this old entry is from your database directly.

Fix Old WordPress URL Redirecting

Step 1

Login to your database via phpMyAdmin. If you don’t know how, I recommend stopping now and forwarding my post to your web host with a description of what is happening and let them do it for you. Or at least backup your database first.

phpMyAdmin

Step 2

So in my case the URL that was redirecting wrong was domain.com/ulcerative-colitis. This is on a gluten-free website that I run. So the slug is “ulcerative-colitis.” In phpMyAdmin click into your database and into the “Search” tab. Then select all the tables and run the search for your slug.

database search

This is what my results were.

wordpress database results

Step 3

Click on “Browse” next to the wp_postmeta table.

Step 4

There will be a meta_key entry for _wp_old_slug. Select that and delete it. You can see below that the meta_value is my slug “ulcerative-colitis.”

wp old slug

Press “OK” on the confirmation.

delete wp old slug

Note: I was able to confirm the post_id of 378 by going into my WordPress dashboard, hovering over “edit” on the post and looking in my browser at the post ID.

edit this item wordpress

post id wordpress

And that’s it! After deleting that entry your post should no longer redirect! If this post on how to fix your old WordPress URL from redirecting to the new URL was helpful let me know below.

GET MORE STUFF LIKE THIS

Marketing, WordPress, Blogging Tips, SEO and Reviews, once a week.

Thank you for subscribing.

Something went wrong.

121 Shares
Tweet
Share
Share
Buffer