mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-01 11:52:25 +08:00
https://gist.github.com/amboutwe/2aa7dcc9a38986e11fac68c7306cc091#file-yoast_seo_canonical_change_woocom_shop-php
7 lines
256 B
Text
7 lines
256 B
Text
function yoast_seo_canonical_change_woocom_shop( $canonical ) {
|
|
if ( !is_shop() ) {
|
|
return $canonical;
|
|
}
|
|
return get_permalink( woocommerce_get_page_id( 'shop' ) );
|
|
}
|
|
add_filter( 'wpseo_canonical', 'yoast_seo_canonical_change_woocom_shop', 10, 1 );
|