Title: wp_embed_handler_youtube
Published: September 4, 2014
Last modified: February 24, 2026

---

# apply_filters( ‘wp_embed_handler_youtube’, string $embed, array $attr, string $url, array $rawattr )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/wp_embed_handler_youtube/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/hooks/wp_embed_handler_youtube/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_embed_handler_youtube/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_embed_handler_youtube/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_embed_handler_youtube/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_embed_handler_youtube/?output_format=md#changelog)

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

Filters the YouTube embed output.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/wp_embed_handler_youtube/?output_format=md#description)󠁿

### 󠀁[See also](https://developer.wordpress.org/reference/hooks/wp_embed_handler_youtube/?output_format=md#see-also)󠁿

 * [wp_embed_handler_youtube()](https://developer.wordpress.org/reference/functions/wp_embed_handler_youtube/)

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

 `$embed`string

YouTube embed output.

`$attr`array

An array of embed attributes.

`$url`string

The original URL that was matched by the regex.

`$rawattr`array

The original unmodified attributes.

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

    ```php
    return apply_filters( 'wp_embed_handler_youtube', $embed, $attr, $url, $rawattr );
    ```

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

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

| Used by | Description | 
| [wp_embed_handler_youtube()](https://developer.wordpress.org/reference/functions/wp_embed_handler_youtube/)`wp-includes/embed.php` |

YouTube iframe embed handler callback.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/wp_embed_handler_youtube/?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%2Fwp_embed_handler_youtube%2F)
before being able to contribute a note or feedback.