Stop unwanted WP redirection to new url

WordPress uses a function called wp_old_slug_redirect() to find out if you’re looking for a post whose slug was recently changed and redirect you to its new home.

If you want to prevent this behaviour for this specific post, delete the _wp_old_slug post meta entry from the database for that post.

If you want to prevent this behaviour for all posts, prevent the function from being used at all:

remove_action( 'template_redirect', 'wp_old_slug_redirect' );

Leave a Comment