On this url: https://www.phuket-luxury-villas.us.com/tourist-spots/buddhist-temples-wats/ I have a wrong canonical link:
<link rel="canonical" href="https://www.phuket-luxury-villas.us.com/tourist-spots/buddhist-temples-wats/" />
It used to be the follow canonical link:
<link rel="canonical" href="https://www.luxuryvillasphuketthailand.com/tourist-spots/buddhist-temples-wats/" />
I tried to use this code:
function yoast_seo_canonical_change_woocom_shop( $canonical ) {
if ( is_archive() ) {
echo '';
}
}
add_filter( 'wpseo_canonical', 'yoast_seo_canonical_change_woocom_shop', 10, 1 );
But it seems that is put now too many canonical links on the website...
Any idea what else I can do?
This mentioned url, is an archive (done with Toolset). And we are using WPML. Sadly WPML won't let us to duplicate categories or taxonomies
return
rather than anecho
, so you could try changing the command, but the filter may not accept an empty string at all.