Created
December 18, 2019 15:26
-
-
Save seredniy/ce854864f89fbde32223732db0714f7b to your computer and use it in GitHub Desktop.
This file contains 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
// canonical для страниц пагинации | |
function change_yoast_canonical( $canonical ) { | |
if ( is_paged() AND is_archive() ) | |
$canonical = preg_replace('/\/page\/.*/', '', $canonical); | |
return $canonical; | |
} | |
add_filter( 'wpseo_canonical', 'change_yoast_canonical', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment