// Use zh-HK (Hong Kong Chinese) instead tw (Traditional Chinese)
add_filter( 'weglot_language_code_replace', 'custom_weglot_language_code_replace' );
function custom_weglot_language_code_replace( $replacements ) {
$replacements['tw'] = 'zh-HK';
// Use tw instead of zh-HK on hreflangs (optional)
add_filter( 'weglot_href_lang', 'custom_weglot_href_lang' );
function custom_weglot_href_lang( $render ) {
$render = str_replace("hreflang=\"zh-HK\"", "hreflang=\"tw\"", $render);