HTTP/2 301
server: nginx
date: Sat, 27 Dec 2025 16:23:22 GMT
content-type: text/html; charset=UTF-8
x-olaf: ⛄
vary: accept, content-type
x-redirect-by: WordPress
location: https://developer.wordpress.org/reference/hooks/embed_defaults/
x-frame-options: SAMEORIGIN
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
HTTP/2 200
server: nginx
date: Sat, 27 Dec 2025 16:23:22 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-olaf: ⛄
vary: accept, content-type
link:
; rel="https://api.w.org/"
link:
; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
x-frame-options: SAMEORIGIN
content-encoding: gzip
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
embed_defaults – Hook | Developer.WordPress.org
apply_filters( ’embed_defaults’, int[] $size, string $url )
Filters the default array of embed dimensions.
$sizeint[]Indexed array of the embed width and height in pixels.
0 intThe embed width.
1 intThe embed height.
$urlstringThe URL that should be embedded.
- 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.
| Version | Description |
|---|
| 2.9.0 | Introduced. |
Example migrated from Codex:
Modify the default embed dimensions by adding the filter to the
functions.phpfile of a child theme.