Facebook Tips & Strategies

How to Add a Facebook Meta Tag to WordPress

By Spencer Lanoue
November 11, 2025

Ever pasted a link to your WordPress site on Facebook, only to see it show up with a random, blurry image and a messy-looking title? It immediately kills the click-through potential you worked so hard to build. This article shows you exactly how to fix that by adding Facebook meta tags to your WordPress site, ensuring your content looks professional, custom-branded, and irresistible every time it's shared.

What Are Facebook Meta Tags, Anyway?

In simple terms, Facebook meta tags are small snippets of code within your webpage's HTML that tell social networks like Facebook, X (formerly Twitter), and LinkedIn how to display a preview of your content. They control the title, description, and preview image that appear when someone shares your link. These tags are part of a system called the Open Graph protocol, which was created by Facebook to turn any webpage into a rich, graph-like object that fits neatly into its platform.

Think of it like this: without Open Graph tags, Facebook has to guess. It might grab the first image it finds on your page (even if it's a tiny icon from your footer) and the first bit of text it sees (which might be your site's navigation menu). The result is often an ugly, uninformative, and unprofessional-looking link preview.

With Open Graph meta tags, you're not leaving it to chance. You're explicitly telling Facebook:

  • "Use this specific title."
  • "Use this exact compelling description."
  • "Show this beautiful, high-resolution image."

This control is fundamental for social media marketing. A well-crafted social share preview dramatically increases click-through rates, makes your brand look more credible, and encourages more shares because the content looks appealing from the start.

The Core Open Graph Tags You Need to Know

While there are many Open Graph tags, four are essential for creating a great-looking share preview on Facebook. You don't need to be a developer to understand what they do.

  • og:title: This is the headline that appears in the share preview. It can be the same as your blog post title, or you can craft a slightly different version that's more enticing for a social audience.
  • og:description: This is the short summary (usually 2-4 sentences) that appears below the title. It's your chance to hook the reader and explain why they should click.
  • og:image: This is the most critical tag. It specifies the URL of the image you want to show. A bright, attention-grabbing image is the single most important factor in making your shared link stand out in a crowded feed.
  • og:url: This is the permanent link (or "canonical URL") of your content. It ensures that all shares, likes, and comments for that link are associated with a single URL.

Method 1: The Easy Way (Using an SEO Plugin)

For over 99% of WordPress users, the best and safest way to add Facebook meta tags is with an SEO plugin. Chances are you already have one installed, like a popular and powerful tool such as Yoast SEO, All in One SEO (AIOSEO), or Rank Math. These plugins handle the basics automatically and give you an easy-to-use interface to customize the social meta tags for every post and page on your site.

They take the complexity of coding out of the equation and provide simple form fields to fill out.

How to Add Facebook Meta Tags with Yoast SEO

Yoast SEO is one of the most widely used plugins in the WordPress ecosystem. If you have it installed, you're just a few clicks away from having full control over your social shares.

  1. Open a Post or Page Editor: Navigate to the post or page you want to customize. This works for both new content and existing articles you want to update.
  2. Scroll to the Yoast SEO Box: Go down below the main content editor, and you'll find the Yoast SEO settings box.
  3. Click the "Social" Tab: Inside the Yoast box, you'll see several tabs like "SEO," "Readability," and "Schema." Click on "Social."
  4. Customize Your Facebook Settings: This is where you get to craft your share preview. You'll see several fields:
    • Facebook image: Click the "Select image" button to upload a custom image specifically for Facebook. This is your most powerful tool. The recommended size is 1200 x 630 pixels.
    • Facebook title: Write the exact title you want to appear on Facebook. You can leave it blank to use your SEO title, but customizing it can allow you to craft a punchier, more social-friendly headline.
    • Facebook description: Write your compelling summary here. Again, leaving it blank will pull your meta description, but customizing it for a social audience is always a good idea.
  5. Update or Publish Your Post: Once you've filled out the fields, don't forget to save your changes by clicking "Update" or "Publish." That’s it! Yoast will now automatically insert the correct Open Graph meta tags into the page's HTML head section.

The beauty of this method is that you can set a unique social preview for every single piece of content on your site, optimizing each for maximum engagement.

How to Add Facebook Meta Tags with All in One SEO (AIOSEO)

AIOSEO is another fantastic and widely-used plugin that makes managing social meta tags a breeze. The process is very similar to Yoast's.

  1. Open a Post or Page Editor: Find and open the piece of content you wish to configure.
  2. Find the AIOSEO Settings: Look for the AIOSEO settings box, which is typically located either in a sidebar on the right or below the main content editor.
  3. Navigate to the "Social" Tab: Click the "Social" tab within the AIOSEO options.
  4. Fill in the Facebook Details: Here, you can define your link's appearance:
    • Title: AIOSEO shows you a preview of how the title will look. You can overwrite your default SEO title with a social-specific one here.
    • Description: Fill in the custom description you want Facebook viewers to see.
    • Image Source: This is a powerful feature in AIOSEO. You can choose to use your Featured Image, or select "Custom Image" to upload a specially designed one (1200 x 630 pixels).
  5. Update or Publish: Click the "Update" or "Publish" button to save your settings. AIOSEO will now add the necessary HTML code for you behind the scenes.

Using a plugin is the standard, modern practice for handling meta tags in WordPress. It puts the control right where it belongs: in the hands of the content creator, without ever needing to touch a line of code.

Method 2: Manual Adding Code (For Advanced Users Only)

Warning: This method involves editing your website's theme files. It is not recommended for beginners. Making a mistake can break your site's functionality or appearance. Always create a full backup of your website before attempting to edit theme files, and ideally, use a child theme.

If you don't use an SEO plugin and need a manual solution, you can add Open Graph tags directly into your theme's header.php file. This file contains the <,head>, section of your site's HTML, which is where meta tags belong.

Here's a sample of the basic HTML code you would add inside the <,head>, tag of your header.php file:

<,meta property="og:title" content="Your Amazing Blog Post Title Here" />,
<,meta property="og:description" content="A brief but compelling description of your content." />,
<,meta property="og:type" content="article" />,
<,meta property="og:url" content="https://yourwebsite.com/your-full-post-url/" />,
<,meta property="og:image" content="https://yourwebsite.com/images/your-facebook-image.jpg" />,
<,meta property="og:site_name" content="Your Site Name" />,

The problem with this static approach is that every single page and post on your site will have the exact same Open Graph tags. To make them dynamic (so each page populates its own unique title, description, and image), you would need to replace the static content with WordPress PHP functions. This requires programming knowledge and is far more complicated and prone to error than just using a free SEO plugin.

For these reasons, the manual method is rarely the right solution. Stick to plugins and save yourself the headache.

Don't Guess: Test and Troubleshoot with the Facebook Debugger

After you've added your Facebook meta tags - whether through a plugin or manually - how do you know they're working? Facebook often caches (saves) old information about a link, so even after you update your post, sharing it might still show the old, ugly preview.

Enter the Facebook Sharing Debugger. This free tool is indispensable.

It lets you do two things:

  1. See exactly what information Facebook sees when it "scrapes" your URL.
  2. Force Facebook to clear its cache and scrape your page again for the newest information.

Here's how to use it:

  1. Go to the Tool: Open the Facebook Sharing Debugger.
  2. Enter Your URL: Copy the URL of the WordPress post or page you just updated and paste it into the input field. Click "Debug."
  3. Review the Preview: The tool will show you a Link Preview as it currently appears on Facebook. It will also show you all the Open Graph meta tags it found on your page and highlight any warnings or errors (like a missing og:image tag).
  4. Scrape Again: If you just updated your post and are still seeing old information, click the "Scrape Again" button. This tells Facebook to revisit your URL and fetch the fresh data you just added. You may need to click it a couple of times. The Link Preview should update to show your new custom title, description, and image.

If your share preview is still not updating correctly, the debugger tool will likely tell you why. The most common problems are caching (solved with "Scrape Again") or forgetting to set a featured/social image in your plugin's settings.

Final Thoughts

Taking a moment to customize how your WordPress content appears on social media is one of the highest-leverage activities you can do. By using a simple SEO plugin to add Facebook meta tags, you transform generic, easily-ignored links into polished, professional, and click-worthy assets that drive traffic and build your brand's reputation.

Of course, controlling how your links look is just one piece of a strong social media strategy. After you've polished your on-site presentation, the real work of social media management begins. We built Postbase because we were tired of legacy tools that made scheduling, engagement, and reporting feel like obstacles. So after you've set up your perfect preview image, we're here to help you get that content scheduled across all your platforms with a visual calendar that just makes sense, reply to all your comments in one unified inbox, and track what's actually working without needing an enterprise budget.

```

Spencer's spent a decade building products at companies like Buffer, UserTesting, and Bump Health. He's spent years in the weeds of social media management—scheduling posts, analyzing performance, coordinating teams. At Postbase, he's building tools to automate the busywork so you can focus on creating great content.

Other posts you might like

How to Add Social Media Icons to an Email Signature

Enhance your email signature by adding social media icons. Discover step-by-step instructions to turn every email into a powerful marketing tool.

Read more

How to Record Audio for Instagram Reels

Record clear audio for Instagram Reels with this guide. Learn actionable steps to create professional-sounding audio, using just your phone or upgraded gear.

Read more

How to Check Instagram Profile Interactions

Check your Instagram profile interactions to see what your audience loves. Discover where to find these insights and use them to make smarter content decisions.

Read more

How to Request a Username on Instagram

Requesting an Instagram username? Learn strategies from trademark claims to negotiation for securing your ideal handle. Get the steps to boost your brand today!

Read more

How to Attract a Target Audience on Instagram

Attract your ideal audience on Instagram with our guide. Discover steps to define, find, and engage followers who buy and believe in your brand.

Read more

How to Turn On Instagram Insights

Activate Instagram Insights to boost your content strategy. Learn how to turn it on, what to analyze, and use data to grow your account effectively.

Read more

Stop wrestling with outdated social media tools

Wrestling with social media? It doesn’t have to be this hard. Plan your content, schedule posts, respond to comments, and analyze performance — all in one simple, easy-to-use tool.

Schedule your first post
The simplest way to manage your social media
Rating