Skip to content

How to stop WordPress old url redirecting to new url

You can disable this WordPress feature if it isn’t something that you want.

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.

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.

If you’re reluctant to jump into the database you might prefer to use the Remove Old Slugs plugin.