Skip to content

Page Plugin

Updated: Jun 30, 2026

The Page plugin lets you easily embed and promote any public Facebook Page on your website. Just like on Facebook, your visitors can like and share the Page without leaving your site. You can use the Page plugin for any Page that is not restricted, for example, by country or age.

Facebook Page plugin showing the Facebook Page cover photo, like count, and Like Page and Share buttons

Related Topics: Social Plugins FAQs | Other Social Plugins

href

tabs

width

height

small_header

adapt_container_width

hide_cover

show_facepile

Get Code

Settings

In addition to the settings above, you can also change the following:

SettingHTML5 AttributeDescriptionDefault
hrefdata-hrefThe URL of the Facebook PageNone
widthdata-widthThe pixel width of the plugin. Min. is 180 & Max. is 500340
heightdata-heightThe pixel height of the plugin. Min. is 70500
tabsdata-tabsTabs to render i.e. timeline, events, messages. Use a comma-separated list to add multiple tabs, i.e. timeline, events.timeline
hide_coverdata-hide-coverHide cover photo in the headerfalse
show_facepiledata-show-facepileShow profile photos when friends like thistrue
hide_ctadata-hide-ctaHide the custom call to action button (if available)false
small_headerdata-small-headerUse the small header insteadfalse
adapt_container_widthdata-adapt-container-widthTry to fit inside the container widthtrue
lazydata-lazytrue means use the browser's lazy-loading mechanism by setting the loading="lazy" iframe attribute. The effect is that the browser does not render the plugin if it's not close to the viewport and might never be seen. Can be one of true or false (default).false

Deprecated Attributes

  • The attribute data-show-posts is deprecated. Please use the attribute tabs/data-tabs and use the value timeline to show posts from the Page's timeline.

Adding the Page Plugin to a Website

The standard configuration of the Page plugin includes only the header and a cover photo. This size is ideal for promoting your Page in a small space, such as the top of a sidebar.

Standard Page plugin configuration with only the header and cover photo, ideal for a small space like a sidebar

<div class="fb-page"
data-href="https://www.facebook.com/facebook"
data-width="380"
data-hide-cover="false"
data-show-facepile="false"></div>

Call to Action

If your page has a custom call to action button, it will be shown instead of the default call to action which is a Share button.

If the width of the plugin is less than 280px, the default Share button will be shown to prevent design misalignment in different translations.

Page Tabs: Timeline, Events & Messages

You can now have timeline, events and messages tabs on the plugin:

  • Timeline Tab: Will show the most recent posts of your Facebook Page timeline.
  • Events Tab: People can follow your page events and subscribe to events from the plugin.
  • Messages Tab: People can message your page directly from your website. People need to be logged in to use this feature.

Enabling Messaging on your Page

To enable messaging on your Facebook page go to your Page Settings. In the row Messages check Allow people to contact my Page privately by showing the Message button (Direct Link: https://www.facebook.com/{your-page-name}/settings/?tab=settings&section=messages&view).

Adding Multiple Tabs

Use a comma-separated list within the data-tabs attribute to add multiple tabs:

<div class="fb-page"
data-tabs="timeline,events,messages"
data-href="https://www.facebook.com/YoloBookStore"
data-width="380"
data-hide-cover="false"></div>

Page plugin with the Timeline tab showing recent posts and the Events tab showing an event to subscribe to

Page plugin Messages tab showing the compose message box and the confirmation screen after a message is sent

Single Tab

You can also just add a single tab showing either the timeline, events or messages:

<div class="fb-page"
data-tabs="events"
data-href="https://www.facebook.com/YoloBookStore"
data-width="380"></div>

Page plugin with a single Events tab showing an upcoming event to subscribe to

Adaptive Width

Page plugin sizing itself to fit its parent container width, marked by dashed container-width boundaries

The plugin will by default adapt to the width of its parent container on page load (min. 180px / max. 500px), useful for changing layout:

<div style="width: 190px;">
<!-- Page plugin's width will be 190px -->
<div class="fb-page" data-href="{url}" data-width="420"></div>
</div>

If the width of the parent element is bigger than the Page plugin's width it will maintain the value defined in data-width:

<div style="width: 600px;">
<!-- Page plugin's width will be 500px -->
<div class="fb-page" data-href="{url}" data-width="500"></div>
</div>

The plugin will never be smaller than 180px:

<div style="width: 100px;">
<!-- Page plugin's width will be 180px -->
<div class="fb-page" data-href="{url}" data-width="320"></div>
</div>

Adaptive width can be switched off by unchecking Adapt to plugin container width and the plugin will rendered at the specified width irrespective of the parent container.

No Dynamic Resizing

The Page plugin works with responsive, fluid and static layouts. You can use media queries or other methods to set the width of the parent element, yet:

  • The plugin will determine its width on page load
  • It will not react changes to the box model⁠ after page load.

If you want to adjust the plugin's width on window resize, you manually need to rerender the plugin.

Show Friend's Faces

Show who likes your Page with real people's profile images rather than just a number. People visting your Page will see a count of friends that like the Page as well as their profile photos.

This option can be activated by checking Show Friend's Faces in the configurator.

Page plugin with Show Friend's Faces enabled, displaying friends' profile photos below the like count

<div class="fb-page"
data-href="https://www.facebook.com/imdb"
data-width="340"
data-hide-cover="false"
data-show-facepile="true"></div>

Privacy Restricted Pages

Facebook Pages with privacy restrictions cannot be embedded.

Changing the Language

You can change the language of the Page plugin plugin by loading a localized version of the Facebook JavaScript SDK. When you load the SDK, change the value of js.src to use your locale. Replace en_US with your locale, e.g., ru_RU for Russian (Russia):

Page plugin localized to Russian, with the like count and buttons displayed in Russian text

Example

js.src = "https://connect.facebook.net/ru_RU/sdk.js#xfbml=1&version=v2.5";

Supported locales are referenced in the Facebook Locales XML file⁠. You may need to adjust the width of a Social Plugin to accommodate different languages. You may find more information on our Localization & Translation page.

Unofficial mirror for reference/search purposes. All content originates from developers.facebook.com — see the source link at the top of each page. Machine-readable indexes: llms.txt · llms-full.txt · About