> 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/cms/wordpress/helpers-functions-1/weglot_replace_url.md).

# weglot\_replace\_url

This filter allow you to modifiy the replaced url when it is translated.

The filter receives three arguments: the translated URL, the original URL and the target language (a `Weglot\Client\Api\LanguageEntry`). It must return the URL to use.

```php
add_filter( 'weglot_replace_url', 'custom_weglot_replace_url', 10, 3 );
function custom_weglot_replace_url( $replaced_url, $url, $language ) {
    // Return another URL for a given language if needed.
    return $replaced_url;
}
```
