Removing the redirect after changing a page’s slug

This (in your functions.php) will turn it off (but see also the comment I’ve left):

remove_action('template_redirect', 'wp_old_slug_redirect');

It seems odd that your wp_postmeta table wouldn’t have any _wp_old_slug keys – the bit of code that does that is in wp-includes/query.php (wp_old_slug_redirect()) – you could add an exit or debug statement there to check if it’s being called.

Also, remember that if WordPress can’t find a permalink, it looks for posts with a matching beginning, e.g. if you had a post with permalink /foobar, then /foo will redirect to it.

Leave a Comment