Socialinstagram.com
Can you embed Instagram in an iframe?
Yes, but only with the official embed code for a public post. Meta documents the Embed button and oEmbed for posts. Meta does not document an iframe URL for a post.
Checked Test again
Live check
What the main page sends
Post pageBlocked
www.instagram.com/p/fA9uwTtkSN- X-Frame-Options
- DENY
- CSP frame-ancestors
- Not sent
- Response
- 200 OK · 179 ms · HTTPS
Embed codeNot checked
www.instagram.com/p/{shortcode}Not checked: needs your own link. Instagram has no public sample we can load.
Test your linkSteps
How to embed Instagram
- Open the public post in a web browser.
- Click…thenEmbed
- To remove the caption, clear Include caption.
- Copy the embed code. Then paste it into the HTML of your page.
Embed code
Paste this into your page
HTML
<blockquote
class="instagram-media"
data-instgrm-captioned
data-instgrm-permalink="https://www.instagram.com/p/{shortcode}/">
<a href="https://www.instagram.com/p/{shortcode}/">{post title}</a>
</blockquote>
<script async src="https://www.instagram.com/embed.js"></script>The embed.js script renders the post in place of the blockquote. Use the full code from the Embed button when you can.
Good to know
- Use a post link (/p/{shortcode}/) or a Reel link (/reel/{shortcode}/) in the embed code.
- The embedded post resizes to fit its container.
- You can embed only public photo, video, Reel and Guide posts.
- Posts from private, inactive and age-restricted accounts do not embed.
- Posts from accounts that turned off embeds do not embed.
- Stories do not embed.
Sources
- Meta for Developers · Embed Buttondevelopers.facebook.com/docs/instagram-platform/embed-button
- Meta for Developers · Embed an Instagram Post (oEmbed)developers.facebook.com/docs/instagram-platform/oembed
- Instagram · embed.jswww.instagram.com/embed.js
- MDN · X-Frame-Optionsdeveloper.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Frame-Options
- iframecheck live check · main page
Profile updated