Created
December 23, 2021 13:17
-
-
Save hamidrezayazdani/96fe5c3a0f380876b0ebda0207cdaa48 to your computer and use it in GitHub Desktop.
جلوگیری از ریدایرکت توسط وردپرس
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 | |
/** | |
* Prevent wordpress from redirect deleted posts | |
*/ | |
remove_action( 'template_redirect', 'wp_old_slug_redirect' ); | |
remove_action( 'post_updated', 'wp_check_for_changed_slugs', 12, 3 ); | |
add_filter( 'redirect_canonical', '__return_false' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment