> For the complete documentation index, see [llms.txt](https://developers.weglot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_href_lang.md).

# weglot\_href\_lang

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

```php
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;
}
```
