Title: oembed_ttl
Published: September 4, 2014
Last modified: April 28, 2025

---

# apply_filters( ‘oembed_ttl’, int $time, string $url, array $attr, int $post_id )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/oembed_ttl/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/oembed_ttl/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/oembed_ttl/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/oembed_ttl/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/oembed_ttl/?output_format=md#wp--skip-link--target)

Filters the oEmbed TTL value (time to live).

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/oembed_ttl/?output_format=md#parameters)󠁿

 `$time`int

Time to live (in seconds).

`$url`string

The attempted embed URL.

`$attr`array

An array of shortcode attributes.

`$post_id`int

Post ID.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/oembed_ttl/?output_format=md#source)󠁿

    ```php
    $ttl = apply_filters( 'oembed_ttl', DAY_IN_SECONDS, $url, $attr, $post_id );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-embed.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-embed.php#L249)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-embed.php#L249-L249)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/oembed_ttl/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_Embed::shortcode()](https://developer.wordpress.org/reference/classes/wp_embed/shortcode/)`wp-includes/class-wp-embed.php` |

The [do_shortcode()](https://developer.wordpress.org/reference/functions/do_shortcode/) callback function.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/oembed_ttl/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Foembed_ttl%2F)
before being able to contribute a note or feedback.