Skip to content

How to embed a Facebook feed on your website.

Meta's free Page Plugin shows a public Facebook Page's posts on your website. Here are the steps, the settings that change what visitors see, and why the plugin keeps Meta's look.

The Vitraz teamWe build the embed that puts social feeds on websites
Published
Reading time
7 min read
On this page
  1. How do you embed a Facebook Page on your website?
  2. The steps
  3. Settings that matter
  4. Can you restyle it?
  5. Instagram and Facebook

The short answer

  • Meta’s Page Plugin shows a public Facebook Page’s posts on your website. It is free, and it works today.
  • The plugin is a div with data attributes plus Meta’s JavaScript SDK, not an iframe you copy from a button.
  • Width must sit between 180 and 500 pixels. Set data-tabs to timeline for posts, or events for upcoming events.
  • Only public Pages can be embedded. Personal profiles, private Pages and Pages with restrictions will not render.
  • The plugin keeps Meta’s layout. To restyle a feed, a developer has to build on the Graph API instead.

How do you embed a Facebook Page on your website?

Use Meta’s Page Plugin. Give it the full address of a public Facebook Page, set its width, and paste the code it produces into your site. Visitors see the Page’s latest posts inside your page, and Meta keeps them current. The plugin is free and needs no developer account, though it does load Meta’s JavaScript SDK.

The Page Plugin is the official way to show a Facebook Page on a site. According to Meta’s Page Plugin documentation, it lets you “easily embed and promote any public Facebook Page on your website”. Meta’s own documentation is the source for everything on this page, and its settings are the ones described below.

The plugin works for any public Page you do not manage too. You need the Page’s address, not admin access.

What are the steps to add the Facebook feed to your site?

Find the Page’s full address, copy the Page Plugin code with your Page address in place of the placeholder, and paste it where the feed should appear. Choose a width between 180 and 500 pixels. Check the result on a phone as well as a computer.

  1. Find the Page’s address. Open the Page on facebook.com and copy the address from the browser, which looks like https://www.facebook.com/YourPage.
  2. Copy the code below and replace YOUR_PAGE in the data-href line with your Page’s name.
  3. Paste it into your site where the feed should appear. On most builders this is an HTML or custom code block. Our install guides cover each one.
Facebook Page Plugin code
<div id="fb-root"></div>
<script async defer crossorigin="anonymous"
  src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v21.0"></script>
<div class="fb-page"
  data-href="https://www.facebook.com/YOUR_PAGE"
  data-tabs="timeline"
  data-width="340"
  data-height="500"
  data-small-header="true"
  data-adapt-container-width="true"
  data-hide-cover="false"
  data-show-facepile="false"></div>

The first two lines load Meta’s SDK, which reads the fb-page element and draws the feed inside it. The fb-root div is where the SDK places its pop-ups. Keep both on the page, once, however many feeds you add.

Which settings change what visitors see?

data-width sets the feed’s width, which must be between 180 and 500 pixels. data-tabs chooses what appears: timeline for posts, events for upcoming events, or a comma-separated list for more than one. data-height sets the visible height. Settings you omit fall back to Meta’s defaults.

The Page Plugin settings this post uses
SettingWhat it doesAllowed values
data-widthWidth of the feed180 to 500 pixels. Default 340
data-tabsWhich tabs appeartimeline, events, messages, or a comma-separated list
data-heightHeight of the feedA number of pixels
data-adapt-container-widthLets the feed adjust to its columntrue or false

The width limit matters most. A feed in a wide column still tops out at 500 pixels, so plan the column around it, and centre the block if you want it narrower than the page.

Why the feed might not appear

  • The Page is not public, is restricted, or is a personal profile. The plugin only embeds public Pages.
  • The width is outside 180 to 500 pixels, or the SDK script is blocked by a cookie banner or a content blocker.
  • The code was pasted twice, or the SDK line is missing. The fb-root div has to exist before the feed draws.

Can you change how the Facebook feed looks?

Not with the Page Plugin. It keeps Meta’s layout and branding, and you can choose its tabs, width and height but not its colours, type or card design. A feed that matches your site needs a tool or a developer working with Meta’s Graph API, which gives the posts as data.

That is the trade-off. The Page Plugin is quick, free and always current, and visitors recognise it as Facebook. It is not built for a design that has to match a brand’s look. Meta’s documentation describes its settings and nothing beyond them, so any restyling means reading the posts yourself.

For a feed in your own layout, a developer can use the Graph API, which returns a Page’s posts as data for your own code to render. That route needs a Meta developer account and an access token, and it has its own rules about what you may show and store.

Does the same method work for Instagram?

No. Instagram has no equivalent Page Plugin. Its developer documentation provides an embed for a single public post, and it limits that endpoint to websites and apps. A feed of several posts from an Instagram account needs a tool built on Instagram’s API.

The two networks handle embedding differently, so do not reuse Facebook’s code for Instagram. An Instagram embed takes one public post at a time, and Meta’s documentation says that endpoint is only for embedding Instagram content in websites and apps. Stories are not supported. A post that is on a private, inactive or age-restricted account will not embed.

Questions people also ask

Yes. Meta provides it at no charge, and it needs no developer account for a basic embed. It loads Meta’s JavaScript SDK, which means a visitor’s browser fetches Meta’s code when the page opens.

No. The Page Plugin embeds public Facebook Pages only. A personal profile has no Page, so create a Page for your business or brand and embed that instead.

Between 180 and 500 pixels, which is Meta’s limit. The default is 340. Anything wider is capped at 500, so use the width that suits your column and centre the block if needed.

Usually because the Page is not public or is restricted, the width is out of range, or a privacy setting or content blocker stops the SDK loading. Test the code on a plain page first, then add it to your site.

Sources

  1. 1.Page PluginMeta for Developers
  2. 2.Instagram Platform: Embed an Instagram PostMeta for Developers

Keep reading

Put real posts on your site, where Google can read them.

One deferred script, rendered into your page, no cookies. Your first feed is free and needs no card.

Build your first feed