For the complete documentation index, see llms.txt. This page is also available as Markdown.

weglot_href_lang

With this filter you can modifiy hreflangs generate by Weglot before we add them.

Lets you alter the hreflang block Weglot outputs in the <head> (for example to swap a language code).

add_filter( 'weglot_href_lang', 'custom_weglot_href_lang' );
function custom_weglot_href_lang( $render ) {
    $render = str_replace( 'hreflang="zh-HK"', 'hreflang="tw"', $render );
    return $render;
}

Last updated