> 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_get_slugs_cache_duration.md).

# weglot\_get\_slugs\_cache\_duration

Translated URL slugs are cached in a transient. By default the duration is `0` (no explicit expiration set on the transient). Use this filter to set a custom cache duration, in seconds.

```php
add_filter( 'weglot_get_slugs_cache_duration', 'custom_weglot_get_slugs_cache_duration' );
function custom_weglot_get_slugs_cache_duration( $duration ) {
    return HOUR_IN_SECONDS;
}
```
