How to stop WordPress old url redirecting to new url

In WordPress, when you make a page or post you give it a title and a url (slug). If you decide to change the url later, WordPress has this convenient feature of remembering the old one and redirecting to the new url so that your links aren’t broken.

There may be situations where you don’t want this behaviour, where you want WordPress to forget. Maybe you made a typo in the URL, or want to improve SEO of the url. Maybe you want to free up the url for use with another post. This is how to stop the redirecting. The old urls are stored in the wp_postmeta table and associated with the ids of their respective posts. You can see your old urls with this SQL query.

SELECT *
FROM `wp_postmeta`
WHERE `meta_key` = '_wp_old_slug'

If you are using a visual tool, such as PHPMyAdmin, it’s much easier to find and delete as needed.

*UPDATE*

If you’re reluctant to jump into the database you might prefer the use of this plugin. http://wordpress.org/plugins/remove-old-slugspermalinks/

2 thoughts on “How to stop WordPress old url redirecting to new url

  1. Hi! I’m having this problem with my blog at the moment, but I’m not tech-savvy at all, so I have no idea how to do your solution. Would you please be able to tell me where I need to enter these things?

Leave a Reply

Your email address will not be published. Required fields are marked *


*