Is there a way to tweak this to just stop guessing the URL of custom post type
-
I have some custom post type pages (private pages) that I don’t want people to be able to guess the URL of. Is there a way to tweak this plugin to only stop the guessing of those post types?
I tried something like:
function remove_redirect_guess_404_permalink( $redirect_url ) { if ( is_404() && !isset($_GET['p']) && ( 'private' == get_post_type() ) ) return false; return $redirect_url; } add_filter( 'redirect_canonical', 'remove_redirect_guess_404_permalink' );
But it doesn’t seem to work.
Thanks!
Charles
https://www.ads-software.com/plugins/disable-url-autocorrect-guessing/
- The topic ‘Is there a way to tweak this to just stop guessing the URL of custom post type’ is closed to new replies.