Embed blocks: Full-width in the block editor, content-fit on the live site
Description
The Soundcloud embed displays wide in the block editor but has a fixed width of 500px while browsing the live site. The same thing happens with the Kindle embed block.
Step-by-step reproduction instructions
- Open FSE;
- Insert Soundcloud or Kindle embed block;
- Save the page.
Verify that it's inconsistent between the block editor and the live site.
Screenshots, screen recording, code snippet
| Editor | Live site |
|---|---|
![]() |
![]() |
![]() |
![]() |
Environment info
- WordPress 5.8.2;
- Gutenberg 12.1.0.
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Is there some kind of workaround / easy fix for this?
@aleksblendwerk
you can add a style to override it
figure.is-provider-soundcloud.wp-block-embed-soundcloud iframe { width: 100%; }
Confirmed this is still present in testing in WP 6.3
I've been digging into this one and would love to work on it. I wanted to share what I found and check the direction before opening a PR.
I can still reproduce it on trunk (WP 7.1, Twenty Twenty-Five). The SoundCloud player is 600px wide in the editor and 500px on the front end, and neither fills the block. Kindle does the same thing.
From what I can tell, the root cause is in core rather than in the embed block itself. The editor preview and the front end ask the provider for different widths:
- Front end:
WP_Embeduseswp_embed_defaults(), which is$content_widthor 500px. - Editor: the block calls
/oembed/1.0/proxywith just the URL, and that route forcesmaxwidthtooembed_default_width(600px).
Most video providers hide this because the responsive aspect-ratio classes stretch them to fill the block anyway. Providers whose ratio doesn't match one of the known ratios keep the fixed width they were given, so they show the mismatch. That's SoundCloud (500×400), Kindle (500×550) and Scribd (500×750). Spotify and Mixcloud return width="100%", so they're fine.
Interestingly, WP_oEmbed::fetch() already falls back to wp_embed_defaults() when no width is passed. It's only the proxy route's default that overrides it. So I see two possible directions:
- Fix it in core (my preference): when the proxy request doesn't include a
maxwidth, default towp_embed_defaults( $url )['width']instead of 600. The editor and front end would then always request the same size, for every provider. It's a small change inWP_oEmbed_Controller, which would mean a Trac ticket and a wordpress-develop PR. - Handle it in Gutenberg: add CSS so iframes from these specific providers fill the block, in both the editor sandbox and on the front end. I have this working locally, but it needs a hardcoded provider list. Provider slugs also drift (Kindle now reports itself as
amazon, notamazon-kindle), so it feels more like a patch than a fix.



