How to disable hreflang tags output even for the original domain?
straube opened this issue · 2 comments
straube commented
You may notice that even if you don't set a language for any domain, you still get a default hreflang
tag in your page head. To disable this behavior, you can remove the action that adds that tag. To do so, add the following code to your theme's functions.php
file:
function remove_multipledomain_hreflang()
{
if (!class_exists('MultipleDomain')) {
return;
}
$multipleDomain = MultipleDomain::instance();
remove_action('wp_head', array($multipleDomain, 'addHrefLangHeader'));
}
add_action('init', 'remove_multipledomain_hreflang');
mytran commented
For anyone looking to use this: addHrefLangHeader
got renamed to addHrefLangTags