How do I embed an Instagram feed on my website using HTML code?

By Zyff

Short answer

There is no official Instagram snippet for a whole feed — Instagram only publishes embed code for individual posts. To show a feed in plain HTML you use a widget that gives you two lines: a <div> marking where the feed goes, and a <script> tag that fills it.

That is deliberately not a plugin, which is why it works identically in WordPress, Shopify, Squarespace, Webflow and a hand-written page — anywhere that accepts HTML accepts this.

Why there is no official feed snippet

Instagram's own embed feature covers a single post, reel or profile card, and nothing more. Everything else goes through the Instagram Graph API, which requires a Meta developer account, a business or creator account connected to a Facebook Page, an app review, and an access token you must keep refreshed.

That is the reason third-party widgets exist. They absorb the API work — or read the public posts directly — and hand you plain HTML instead.

What the snippet looks like

Two lines, one of which is a container you place exactly where the feed should appear. The script can go beside it, or once at the end of the page if you have several widgets; it finds its containers itself.

Because the container is your element, its width is whatever your layout gives it, and the feed lays itself out inside that. There is no fixed-width iframe to fight with, which is the main practical difference from Instagram's own post embed.

The expiring-image trap

This is the failure that catches hand-rolled implementations. Instagram's image URLs are signed and expire after a few days. Code that fetches a post's image URL once and hardcodes it into your page will look perfect on the day you build it and be a wall of broken tiles the following week.

Any widget worth using re-serves the images from its own domain rather than linking Instagram's signed URLs directly. It is worth checking before you commit to one — build the feed, then look at it again a fortnight later.

What cannot be embedded

A private account. Instagram does not make its posts public, so no widget, plugin or API can display them, and any tool claiming otherwise is either wrong or asking for your password. Switch the account to public, or use a different one.

Also worth knowing before you build a hashtag or location feed: those show public posts by other people. Republishing someone else's photographs on a commercial site is a decision you are making about their work, so make it deliberately.

Instagram Feed Widget

Show posts, reels and hashtags from Instagram on your site.

Open the tool

Also asked

  • Is there an Instagram feed HTML code?
  • How do I add Instagram to my website without a plugin?

All of these have the same answer, so they share this page rather than each getting a near-identical one of their own.