How to stop wordpress from redirecting from the post’s old slug after changing title and slug?
You need to provide a higher priority number than the default when removing hooks. If you leave it default there’s a chance that your remove_action is executed prior to the add_action( ‘template_redirect’, ‘wp_old_slug_redirect’ ) So, instead: remove_action( ‘template_redirect’, ‘wp_old_slug_redirect’, 20 ); You also need to prevent WP from saving the old slugs which can be … Read more