Title: embed_defaults
Published: April 25, 2014
Last modified: May 20, 2026

---

# apply_filters( ’embed_defaults’, int[] $size, string $url )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/embed_defaults/?output_format=md#parameters)
 * [More Information](https://developer.wordpress.org/reference/hooks/embed_defaults/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/hooks/embed_defaults/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/embed_defaults/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/embed_defaults/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/embed_defaults/?output_format=md#user-contributed-notes)

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

Filters the default array of embed dimensions.

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

 `$size`int[]

Indexed array of the embed width and height in pixels.

 * `0` int
 * The embed width.
 * `1` int
 * The embed height.

`$url`string

The URL that should be embedded.

## 󠀁[More Information](https://developer.wordpress.org/reference/hooks/embed_defaults/?output_format=md#more-information)󠁿

 * If the theme does not specify a content width, then 500px is used. The default
   height is 1.5 times the width, or 1000px, whichever is smaller.
 * The callback function is expected to return an array of embed width and height
   in pixels.

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

    ```php
    return apply_filters( 'embed_defaults', compact( 'width', 'height' ), $url );
    ```

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

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

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

Creates default array of embed parameters.

  |

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

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

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/embed_defaults/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/embed_defaults/?output_format=md#comment-content-4703)
 2.   [Steven Lin](https://profiles.wordpress.org/stevenlinx/)  [  6 years ago  ](https://developer.wordpress.org/reference/hooks/embed_defaults/#comment-4703)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fembed_defaults%2F%23comment-4703)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fembed_defaults%2F%23comment-4703)
 4. Example migrated from Codex:
 5. Modify the default embed dimensions by adding the filter to the `functions.php`
    file of a child theme.
 6.     ```php
        add_filter( 'embed_defaults', 'modify_embed_defaults' );
    
        function modify_embed_defaults() {
            return array(
                'width'  => 750, 
                'height' => 375
            );
        }
        ```
    
 7.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fembed_defaults%2F%3Freplytocom%3D4703%23feedback-editor-4703)

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