I have 8 Instagram URLs in this post out of which 3 are not converted into embed/iframes.
I'm using Gutenberg's Instagram embed blog to add the URL's.
I see the block code in the classic editor which is same as other instagram blocks which render properly but for / it just returns URL.
<!-- wp:core-embed/instagram {"url":"/","type":"rich","providerNameSlug":"instagram","className":""} -->
<figure class="wp-block-embed-instagram wp-block-embed is-type-rich is-provider-instagram">
<div class="wp-block-embed__wrapper">
/
</div>
</figure>
<!-- /wp:core-embed/instagram -->
I tried using shortcode also it's the same result only the below 3 Instagram posts don't render.
[embed]/[/embed]
I need help debugging this weired issue
- /
I have 8 Instagram URLs in this post out of which 3 are not converted into embed/iframes.
I'm using Gutenberg's Instagram embed blog to add the URL's.https://blog.wwf.sg/ocean/2018/11/netflix-documentaries-our-planet-okja-dogs/#
I see the block code in the classic editor which is same as other instagram blocks which render properly but for https://www.instagram/p/BqDzw0CF3pC/ it just returns URL.
<!-- wp:core-embed/instagram {"url":"https://www.instagram/p/BqDzw0CF3pC/","type":"rich","providerNameSlug":"instagram","className":""} -->
<figure class="wp-block-embed-instagram wp-block-embed is-type-rich is-provider-instagram">
<div class="wp-block-embed__wrapper">
https://www.instagram/p/BqDzw0CF3pC/
</div>
</figure>
<!-- /wp:core-embed/instagram -->
I tried using shortcode also it's the same result only the below 3 Instagram posts don't render.
[embed]https://www.instagram/p/BqDzw0CF3pC/[/embed]
I need help debugging this weired issue
- http://www.instagram/p/BMY9o6yA6m1
- http://www.instagram/p/BeqpirDAbol
- https://www.instagram/p/BqDzw0CF3pC/
- Looks like a bug. I'd add a bug report to WP Trac... – Krzysiek Dróżdż Commented Nov 22, 2018 at 8:14
- I tested it in different a different wordpress instance. It works seamlessly. – Manoj H L Commented Nov 22, 2018 at 8:15
- Any conflicts with other plugins/theme? – Krzysiek Dróżdż Commented Nov 22, 2018 at 8:40
- Disabled all plugins and tested with 2017 theme. The issue still persists. – Manoj H L Commented Nov 22, 2018 at 8:59
2 Answers
Reset to default 2Figured it out.
Embed shortcode stores the oemebd data as post meta using md5 hash.
wp-includes/class-wp-embed.php
// Check for a cached result (stored in the post meta)
$key_suffix = md5( $url . serialize( $attr ) );
$cachekey = '_oembed_' . $key_suffix;
$cachekey_time = '_oembed_time_' . $key_suffix;
And has a cache mechanism to fetch new data only after a day.
I deleted the post meta and then it started working.
I had the same problem, for me the solution was to add this code to theme.
if ( !isset( $content_width ) ) $content_width = 550;
More info https://www.wpexplorer/wordpress-oembed/
Hope it helps someone.