Displaying a Facebook newsfeed/timeline on a website

Displaying a Facebook newsfeed/timeline on a website

  1. Blog
  2. 15 November 2026
  3. 4 min read

Stefan Bogdanescu

Founder & Senior Architect

Displaying a Facebook News Feed on Your Website: The Reality of Scraping and Plugins

If your client wants to display their organization's Facebook timeline or news feed directly on their website, the immediate answer is that you cannot simply scrape the page like a standard HTML document. Facebook has long enforced an X-Robots-Tag: noindex, nofollow header on their graph API endpoints and public feeds to prevent automated extraction of data. Attempting to bypass this via headless browsers or simple HTTP requests often leads to immediate IP bans, CAPTCHAs, or legal scrutiny regarding the Terms of Service.

The industry standard solution, which has remained consistent for years despite updates to Facebook's platform, is the Facebook Page Plugin. Specifically, the page_plugin allows you to embed a live feed directly into your site without needing to build a custom scraper. This approach respects Facebook's content delivery network (CDN) and authentication layers, ensuring that the data displayed is always fresh and that the organization remains compliant with platform policies.

How the Page Plugin Works

The page_plugin is designed specifically for this use case. It renders a widget that pulls posts from a Facebook Page, typically limited to the most recent entries based on the items_per_page parameter. You do not need to handle user authentication or manage OAuth tokens for each visitor; the plugin handles the session management on the client side within your iframe.

To implement this, you include the JavaScript SDK in your layout file. Once loaded, you initialize the plugin with your Page ID and configure the desired settings:

<div id="fb-page">
  <iframe src="//www.facebook.com/plugins/page.php?href=https://www.facebook.com/YOUR_PAGE_ID&tabs=timeline&width=470&height=600&small_header=false&adapt_container_width=true&hide_cover=false&show_facepile=true&appId"
          width="100%" height="600" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
</div>

You can also initialize it via JavaScript for more dynamic control:

FB.init({
  appId      : 'YOUR_APP_ID',
  version    : 'v18.0'
});

FB.ui({
  method: 'getPageFeed',
  href   : 'https://www.facebook.com/YOUR_PAGE_ID',
  width  : 470,
  height : 600
});

The Activity Feed Limitation

It is crucial to distinguish between the page_plugin and the Activity Feed Plugin. As noted in recent discussions, the Activity Feed Plugin is often misinterpreted as a tool for displaying a company's own posts. In reality, it tracks interactions between users and your site. If you build an app where users can "like" a post or comment on a wall, the Activity Feed shows those specific user-generated events. It does not automatically aggregate the public history of the Page itself in the way a timeline does.

If your requirement is strictly to show the organization's own updates (posts, photos, videos), the page_plugin with the timeline tab is the correct choice.

Server-Side Caching and Performance

While the plugin solves the scraping ban issue, it introduces performance considerations. The Facebook SDK loads content asynchronously, which can sometimes delay the rendering of your page if not managed correctly. For high-traffic sites, relying entirely on real-time fetching from Facebook's CDN might be inefficient.

A common architectural pattern involves server-side caching. You could fetch the feed data using the Facebook Graph API (which requires an App ID and Access Token) and store it in a cache layer like Redis or your application's database for a set duration (e.g., 15 minutes). Your Laravel application, for instance, could render these cached posts alongside your native HTML content. This approach reduces the load on your server and minimizes the risk of the Facebook plugin failing to load due to network latency or browser restrictions.

Trade-offs and Compliance

The primary trade-off with the page_plugin is control. You are displaying Facebook's interface, which includes their branding, font stack, and layout constraints. If you need the feed to match your site's design system perfectly (e.g., custom fonts, specific spacing), a native scrape might seem appealing, but it remains technically prohibited and fragile.

Furthermore, Facebook changes its API frequently. Features that were available yesterday might be deprecated tomorrow. Relying on the official plugin ensures you are using supported endpoints, whereas scraping operates in a grey area that can change overnight with a single platform update.

If your client requires a highly customized layout or needs to export data for archival purposes rather than live display, they may need to consider alternative social platforms or accept the limitations of the current Facebook ecosystem. However, for a standard "news feed" requirement on a company website, the page_plugin remains the most robust and compliant solution available today.

Our network