Created
September 5, 2023 15:23
-
-
Save michael-sumner/8962e9081cd1d6d03bcca47ebed3b4a2 to your computer and use it in GitHub Desktop.
Disable WordPress core attempts to redirect old posts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Disable WordPress core attempts to redirect old posts. | |
add_filter( 'old_slug_redirect_post_id', '__return_zero' ); | |
add_filter( 'redirect_canonical', '__return_empty_string' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: There are issues with Redirection plugin which makes this solution not work.
Therefore, use with caution and test redirects from other plugins using the hook, thoroughly.