Site logo

Archived topic

Blank Space Below iFrame Spotify Embeds

9 replies · Started by Aaron on April 12, 2023

Viewing posts 1–10 of 10

Any ideas how to remove this extra space and only have the height at 100% of what it needs to be? Thanks!

Hi Aaron,

The Embed wrapper has a large bottom padding. It's coming from Autoptimize. Can you try disabling that first so we can see where it's really coming from?

You bet - deactivated.

Do you have the Gutenberg plugin installed? If so, you can disable that. That's not needed for WP Blocks to work.

The issue seems to be coming from that plugin.

Yes, I disabled Gutenberg and refreshed, but the issue is still there.

I went ahead and disabled all of my plugins (even GP Premium), refreshed, and the issue is still there. I then also changed the theme to Wordpress 2023 on top of that, and it's still there.

Tried running this code in functions.php, but still there:

function my_embed_defaults($defaults) {
    $defaults['height'] = '100%';
    return $defaults;
}
add_filter('embed_defaults', 'my_embed_defaults');

I was thinking it might be a problem with spotify's iFrame itself, but the iFrame should only be 152px per the below. So it must be a wordpress setting that's causing this?

<figure class="wp-block-embed is-type-rich is-provider-spotify wp-block-embed-spotify wp-embed-aspect-21-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="Spotify Embed: Behind The Bastards: Trailer" style="border-radius: 12px" width="100%" height="152" frameborder="0" allowfullscreen allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" loading="lazy" src="https://open.spotify.com/embed/episode/0vlDR2VGi9ke9AYBOqTwaQ?si=ei9nhLGsTAObmapM4ukI6w&utm_source=oembed"></iframe>
</div></figure>

Will leave as-is for a bit - this is a strange one, any ideas?

I went ahead and disabled all of my plugins (even GP Premium), refreshed, and the issue is still there. I then also changed the theme to WordPress 2023 on top of that, and it’s still there.

Thanks for doing the test and confirm that this is a not theme issue :)

I was thinking it might be a problem with spotify’s iFrame itself, but the iFrame should only be 152px per the below. So it must be a wordpress setting that’s causing this?

You might want to check with Spotify or WordPress' support team to see if they have heard similar reports and can point you in the right direction.

Will do - can you please do a quick test on your Wordpress test theme by embedding that Spotify link into a test post? I want to see if this is a "me" problem or a global issue you guys are experiencing as well. Much appreciated.

If you did the debugging tests above and the issue still exists then I think it's safe to say that it's a global problem :)

/e - Nevermind, thanks Leo.

No problem :)

This archived topic is closed to new replies.