Setup & site building · Guide
How to Add Facebook to WordPress (Icons, Page Feed, Embeds and Pixel)

Short answer
To add Facebook to WordPress, use the Social Icons block to link to your Page, or paste Meta's Page plugin code into a Custom HTML block to show your feed. For single posts, use Facebook's Embed code, since WordPress stopped auto-embedding Facebook links in version 5.5.2.
Key takeaways
- The Social Icons block adds a Facebook link without any plugin.
- Meta's Page plugin code shows your feed in a Custom HTML block.
- Pasted Facebook links no longer auto-embed since WordPress 5.5.2.
- The Meta Pixel tracks ad conversions and needs consent in some regions.
- Open Graph tags control how your links look when shared.
What does “adding Facebook to WordPress” mean?
People use the phrase for several different jobs. The most common are linking to your Facebook Page, showing a Page feed in a sidebar, embedding a single post or video, adding share buttons and installing the Meta Pixel.
Each job uses a different tool, so decide what you need before installing anything. Many sites only need the first one, a simple icon that links to the Page.
This guide covers all of them with the built-in block editor first, then the plugin or code options where WordPress has no native tool.
Before you start, make sure your Facebook Page is public. Most embeds and the Page feed will show nothing if the Page has age or country restrictions.
It also helps to copy your Page address before you begin. Open your Page on Facebook and copy the full URL from the browser bar, including https, so every method below links to the right place.
Method 1: Add a Facebook icon with the Social Icons block
The quickest way to connect your site to Facebook is a link icon. The block editor includes a Social Icons block for this.
Open the page, header or footer where you want the icon. In the Site Editor, footers live under Appearance > Editor > Patterns or the template parts list.
Click the plus icon, search for Social Icons and add the block. Click the plus inside it, choose Facebook and paste your Page address.
In the block settings you can change the icon size, colour and style, and turn on “Open links in new tab” if you prefer visitors to stay on your site.
Classic themes without block support usually have a social links setting in the Customizer, or a widget area that accepts the same block. Our guide on whether WordPress is mobile friendly explains why icons should stay large enough to tap on phones.
Method 2: Show your Facebook Page feed with the Page plugin
If you want visitors to see your latest Facebook posts on your site, use Meta's official Page plugin. It shows your Page cover, a follow button and a scrolling timeline.
Open the Page plugin configurator, paste your Page URL and set the width, height and tabs. Choose “timeline” to show recent posts, and add “events” or “messages” if you need them.
Click Get Code. Meta gives you two snippets, a JavaScript SDK snippet and a small piece of HTML for the feed itself.
In WordPress, add a Custom HTML block where you want the feed, such as a sidebar or the bottom of a page. Paste both snippets into it and preview the result.
The Page plugin has a minimum and maximum width, so set the block width to suit your layout. If the feed looks squashed on phones, turn on the option that adapts it to the container width.
Method 3: Embed a single Facebook post or video
WordPress used to turn a pasted Facebook link into an embed automatically. That stopped in WordPress 5.5.2, when core removed Facebook and Instagram as oEmbed providers, as recorded in Trac ticket #50861.
Meta had switched those embeds to an authenticated API, so a plain link now shows only as text. You have two ways around this.
The no-plugin option is Meta's own embed code. Open the public post or video on Facebook, click the three dots menu and choose Embed. Copy the code and paste it into a Custom HTML block.
The plugin option is a tool such as oEmbed Plus, which restores link embeds once you add your own Meta app ID and secret. This suits sites that embed posts often.
Embeds load extra scripts from Meta, which can slow a page. Our tips on speeding up YouTube embeds apply to Facebook too, such as lazy loading and limiting embeds per page.
Method 4: Add Facebook share buttons
Share buttons let readers post your article to their own timeline. Meta still offers a Share button plugin with a code generator.
You can paste that code into a Custom HTML block at the end of each post. On a block theme, add it to the single post template once so it appears everywhere.
Most sites, though, use a social sharing plugin. These add buttons for Facebook and other networks at the same time, and many offer lightweight icons without loading Meta's scripts.
A plain link works too. A share link to Facebook's sharer address with your page URL attached opens a share dialog without any script at all, which is the fastest option.
Method 5: Install the Meta Pixel for ads and tracking
If you run Facebook or Instagram ads, the Meta Pixel records visits and conversions so Meta can measure and target your campaigns.
Create the pixel in Meta Events Manager first. You then have two install routes: an official integration plugin, or pasting the base code into your site header.
For manual installation, use a header and footer code plugin or your theme's header settings rather than editing theme files. Edits to a parent theme are lost when it updates.
If you sell with WooCommerce, the official integration also syncs your catalogue. Our guide on connecting WooCommerce to Facebook and Instagram Shop covers that setup.
Tracking scripts collect personal data, so check whether you need a cookie consent banner for visitors in regions with privacy laws.
Method 6: Control how your links look on Facebook
When someone shares your page, Facebook builds a preview card from Open Graph tags. These set the title, description and image shown in the feed.
WordPress does not output Open Graph tags by default. Most SEO plugins add them, along with a field for a custom social image on each post.
Use a share image of at least 1200 by 630 pixels for a sharp preview. If a preview looks wrong, Meta's Sharing Debugger can fetch the page again and clear its cached version.
Good preview cards matter more than most people think. A clear image and title often decide whether someone clicks.
Set a default share image in your SEO plugin as well. Posts without a featured image will then still show a branded picture instead of a random image from the page or no image at all.
Which method should you use?
Pick the method by goal, not by habit. The table below sums up the options.
| Goal | Best method | Plugin needed? |
|---|---|---|
| Link to your Page | Social Icons block | No |
| Show recent Page posts | Meta Page plugin code | No |
| Embed one post or video | Meta embed code or oEmbed Plus | Optional |
| Let readers share posts | Share button or sharing plugin | Optional |
| Track ad conversions | Meta Pixel | Optional |
| Control share previews | Open Graph tags | Usually via SEO plugin |
Most small sites need only icons and good Open Graph tags. Add the feed, embeds or pixel when they serve a clear purpose.
Troubleshooting Facebook embeds that do not show
If a feed or embed is blank, first check that the post or Page is public. Private groups, restricted Pages and personal profiles with limited audiences cannot be embedded.
Next, check for script blockers. Ad blockers and privacy browser settings often hide Facebook widgets, so test in a private window with extensions turned off.
Caching and optimisation plugins can also break embeds by delaying or combining Meta's script. Exclude the Facebook SDK from JavaScript delay settings, then clear your WordPress cache and test again.
If the problem started after installing a new plugin, run a plugin conflict test to find the cause.
Keep Facebook features fast and privacy friendly
Each Facebook widget loads scripts from Meta's servers. On a slow connection, that can add a noticeable delay to page loads.
Load the Page feed only where it adds value, such as a contact or community page, rather than in a sitewide sidebar.
For privacy, some sites show a placeholder that loads the embed only after a visitor clicks. This avoids sending data to Meta before the visitor chooses to see the content.
Frequently asked questions
Why won't my Facebook link embed in WordPress?
WordPress removed Facebook as an automatic embed source in version 5.5.2 after Meta required authenticated requests. Use the Embed code from the post menu in a Custom HTML block, or a plugin that adds your own Meta app credentials.
How do I add a Facebook feed to my WordPress sidebar?
Generate code with Meta's Page plugin configurator, then paste both the SDK snippet and the feed HTML into a Custom HTML block in your sidebar or widget area. Set a width that fits your layout.
Do I need a plugin to add Facebook to WordPress?
No for icons, Page feeds and single embeds, since the block editor and Meta's code cover them. Plugins help with frequent embeds, sharing buttons, the Meta Pixel and catalogue syncing for stores.
How do I add a Facebook like or follow button?
The Page plugin includes a follow button with your Page cover. You can also link to your Page with the Social Icons block, which is lighter and avoids loading Meta's scripts on every page.
Does adding Facebook slow down WordPress?
Feeds, embeds and the pixel load scripts from Meta, which can add delay. Keep them to the pages that need them, lazy load embeds where possible and use simple link icons elsewhere.
Sources
- Social Icons block WordPress.org Documentation
- Page plugin Meta for Developers
- Remove Facebook and Instagram as an oEmbed source (#50861) WordPress Core Trac
- Meta Pixel Meta for Developers
- The Open Graph protocol ogp.me
- oEmbed Plus WordPress.org Plugins
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


