Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
The most flexible way to add a Facebook Like button to WordPress is to generate the button with Meta’s Like Button Configurator and paste the complete code into a WordPress Custom HTML block, HTML widget, template, or code-snippet tool. You can also use a plugin, but choose carefully: the former official Facebook for WordPress plugin is archived, while local like plugins create on-site likes rather than Facebook reactions.
What the Facebook Like button actually likes
Before generating anything, choose the URL that the button represents. A button configured with a post URL sends the Like action to that post’s URL; a homepage URL represents your site’s homepage; a Facebook Page URL represents that Page. It does not automatically mean “like this WordPress website” unless you configure it with the relevant URL.
- Current post: use the individual permalink when each article should have its own Facebook reaction count.
- Homepage: use this when every button is intended to promote one site URL.
- Facebook Page: use the Page URL when the goal is engagement with your Facebook presence.
Method 1: Generate Meta’s button code
- Open Meta’s Like Button Configurator. Enter the URL you selected and adjust the available options, including width, layout and action type.
- Choose the presentation. Preview the selected layout and decide whether to enable the adjacent Share button. Share lets a visitor add a personal message instead of only sending a Like action.
- Click “Get Code.” Copy the complete generated HTML and JavaScript. Do not omit part of the snippet or replace it with only the visible button markup.
- Place the code in WordPress. Use one of the insertion routes below, then save or publish the change.
- Test the result. Check an incognito or logged-out browser window, a desktop viewport and a phone-sized viewport. Confirm that the button points to the intended URL and that it does not overflow its content column.
Where to paste the generated code in WordPress
Custom HTML block in a post or page
In the block editor, open the post or page, select +, add a Custom HTML block, paste the entire snippet, and update the content. This is the simplest option when the button belongs in one specific article or landing page.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Site-wide widget or block area
To show the button in a sidebar, footer or another reusable area, open Appearance → Widgets (or the corresponding block-based widget screen), add a Custom HTML widget or block, paste the code, and save. The same configured URL will then be used wherever that widget appears, so do not use this route for a per-post URL unless your theme or plugin supplies a dynamic value.
#1 Best Overall
Theme template or code-snippet manager
Developers can place the snippet in the relevant theme template or use a code-snippet tool that accepts front-end HTML and JavaScript. A child theme is safer than editing a parent theme directly because parent-theme updates can overwrite changes. Keep a backup and test after theme or WordPress updates.
Method 2: Use a WordPress plugin
A plugin can add buttons automatically to selected post types and locations, which avoids pasting code into every article. Installation normally means opening Plugins → Add New, searching for the chosen plugin, installing it, activating it, and configuring its placement and appearance.
The archived official Facebook for WordPress plugin
The former official Facebook for WordPress repository documented installation from the WordPress.org plugin directory or by uploading plugin files to /wp-content/plugins/ and activating them. Its README also documented the [facebook_like_button] shortcode for post content or use from a theme.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11That repository is archived. Treat it as legacy documentation, not proof of compatibility with current WordPress or PHP releases. If you test it on an existing site, use a staging copy, confirm that it supports your versions, and remove it if it causes errors or leaves unmaintained dependencies.
Facebook Like button versus a WordPress like plugin
These are different systems. Meta’s button sends a Like action to Facebook for the configured URL. A local like plugin records a reaction inside WordPress and may provide its own counts, reports or content-sorting features; it does not turn that reaction into a Facebook Like.
| Question | Meta-generated button | Local WordPress like plugin |
|---|---|---|
| Where the reaction is recorded | Facebook, for the URL configured in the button | Your WordPress site or the plugin’s service |
| Setup | Generate code, then place it where required | Install, activate and configure the plugin |
| Placement control | Direct control over the exact HTML location and settings | Often automatic placement by post type, template or rule |
| Typical purpose | Facebook reach and sharing | On-site engagement, voting or sorting |
| Main dependency | Meta’s generated markup and front-end scripts | Plugin maintenance, its scripts and its data practices |
LikeBtn
LikeBtn’s WordPress listing describes support for posts, pages, comments, WooCommerce, BuddyPress, bbPress and custom post types, along with shortcodes, multiple themes and languages, reports and a free plan after a seven-day trial. The listing states more than 80 parameters, 41 themes and 40 languages. Those figures, plan terms and referral conditions can change, so verify them in the current listing before deployment.
Rank #4
Other plugins
The WordPress.org like-button category includes additional alternatives, including a BestWebSoft plugin whose changelog records version 2.77 on 2025-05-06. Treat version numbers, active installations, tested WordPress versions and feature lists as time-sensitive rather than permanent guarantees.
Plugin checks to perform before activation
- Check the plugin’s tested WordPress version, PHP requirements and most recent update date.
- Read the changelog and support history for unresolved errors affecting your theme or editor.
- Identify external JavaScript, requests, cookies and any collection of IP addresses or usage data.
- Review the plugin’s GDPR or privacy documentation and update your site’s privacy notice when required.
- Test caching, consent banners, mobile layout and logged-out behavior on a staging site first.
Troubleshooting a missing or broken button
Nothing appears
- Confirm that the complete snippet was pasted into a Custom HTML-capable area, not a paragraph block that strips code.
- Clear page, object and CDN caches, then test in a private window.
- Temporarily check whether a security, optimization or consent plugin is delaying or blocking Meta’s script.
The button points to the wrong page
Reopen the generated configuration and verify the URL. A static homepage URL pasted into a reusable widget will not automatically change to the URL of each post.
Best Value
The layout is too wide or clipped
Reduce the configured width, choose a more compact layout, and test at the narrowest content width used by your theme. Avoid placing a fixed-width button inside a column narrower than the value selected in the configurator.
A plugin conflicts with the site
Disable the plugin on staging, inspect browser-console errors and test with a default theme and only the plugin active. If the problem disappears, re-enable components one at a time to identify the conflict. Do not rely on the archived Facebook plugin without confirming current WordPress and PHP support.
Quick Recap
Which method should you choose?
- Use generated Meta code when you need a Facebook reaction for a specific URL and want precise placement without adding a plugin.
- Use a maintained plugin when you need automatic placement across many post types, local analytics or on-site voting features.
- Avoid the archived official plugin for a new production site unless compatibility testing gives you a clear, supportable reason to use legacy code.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

