How to Get an Instagram Embed Code
Instagram removed the embed button from the web interface, but the embed itself still works. Here is how to build the code from a post URL, in both forms.

blockquote carrying the post's permalink plus one script tag, or an iframe pointing at the post's /embed/ path. The embed still works; the button that used to generate it is no longer in Instagram's web interface, so the code has to be built from the post URL.What the Instagram embed code looks like
<blockquote class="instagram-media"
data-instgrm-permalink="https://www.instagram.com/p/SHORTCODE/"
data-instgrm-version="14"></blockquote>
<script async src="https://www.instagram.com/embed.js"></script>SHORTCODE is the segment after /p/ in the post URL. Reels use /reel/ in the permalink and everything else is identical.<iframe src="https://www.instagram.com/p/SHORTCODE/embed/"
width="540" height="760" frameborder="0" scrolling="no"
loading="lazy" title="Instagram post"></iframe>Getting the shortcode out of a messy URL
https://www.instagram.com/p/Cxyz1234567/?igshid=MzRlODBiNWFlZA%3D%3D? onwards is a per-share tracking identifier. Leave it in an embed and it is baked into every page view of your article, telling Instagram who forwarded the link to you. Take Cxyz1234567 and discard the rest — social media links covers what each platform appends and why. If the link you were given is a pin.it-style redirect rather than a direct URL, expand it first.Sizing the embed so it does not break your layout
max-width and let it size itself while it sits at the bottom of an article, where a shift costs nothing. Or use the iframe, which takes an explicit height and therefore never moves: 760 pixels at 540 wide fits a square post with its caption, and a Reel wants closer to 1.4 times its width.max-width: 100% on the container. Instagram's own stylesheet assumes a desktop column, and a 540-pixel embed inside a 390-pixel phone viewport is a horizontal scrollbar on your article.Turning the caption off
data-instgrm-captioned="false" renders the media without the caption and comment thread. It is worth knowing about for two reasons: the captioned version is substantially taller, and on a long caption the embed can dominate an article it was meant to illustrate.When an Instagram embed shows an empty box
<a href="https://www.instagram.com/p/SHORTCODE/" rel="noopener">
View this post on Instagram
</a>Do I need permission to embed someone's Instagram post?
Why did Instagram remove the embed button?
Can I embed a Story?
Does the embed count as a view or an impression for the creator?
Put it to work
Tools for the job you just read about
Free to run, most of them without an account.
Social Media Embed Code Generator
Official embed code for a post from any platform, from its URL alone.
Google SERP Snippet Preview
See your title and description as a Google result — on a desktop and a phone.
Social Media URL Cleaner
Strip the tracking off a link — and see what each parameter was telling somebody.
Instagram Money Calculator
What to charge for a post — priced the way a brand actually prices it.
Username Availability Checker
One handle, checked against every network’s rules at once.
YouTube Metadata Viewer
Every field a YouTube video declares about itself, in one table.
Keep reading
More from the blog

How to Embed a Social Media Post on Your Website
Every platform publishes embed code and most hide it. Here is where each one keeps it, when to use an iframe instead of a script, and what to do about consent.

How to Get the RSS Feed for a YouTube Channel
Every YouTube channel and playlist publishes an RSS feed. Here is the URL format, how to find the ID it needs, and what the feed does and does not include.

YouTube Embed Code: Responsive and Privacy-Friendly
The default YouTube embed code is fixed-width and sets cookies before anyone presses play. Here is the version that is responsive, lazy and privacy-enhanced.