Hosting Shared Hosting WordPress Hosting Reseller Hosting
Servers Managed VPS Servers Custom Servers
Other Services Email Archiving Nextcloud Instances SSL Certificates Hacked Website Repair Web Design
Free Tools Mail Tester Email Migration Website Security Scanner
Knowledgebase Blog About Contact
Region 🇿🇦 South Africa (R) 🇬🇧 United Kingdom (£)
Login
🎯 Getting Started Beginner

Understanding Open Graph (OG) Tags and How to Set Them Up

March 23, 2026 10 min read 199 views Go Red Robot

What Are Open Graph Tags?

Open Graph (OG) tags are small snippets of HTML code that control how your website content appears when shared on social media platforms like Facebook, LinkedIn, WhatsApp, Twitter/X, and others. Without them, these platforms will try to guess what image, title, and description to show — and they usually get it wrong.

You have probably seen this yourself: you share a link on WhatsApp or Facebook and it either shows no image, the wrong image, or a generic description that makes no sense. OG tags fix that by telling these platforms exactly what to display.

Why Do OG Tags Matter?

  • Professional appearance: Your shared links look polished and intentional, not broken or generic
  • Higher click-through rates: Posts with proper images and descriptions get significantly more clicks
  • Brand consistency: You control your brand image across every platform
  • SEO benefits: While not a direct ranking factor, better social engagement signals can indirectly help your search visibility

How OG Tags Work

OG tags are placed inside the <head> section of your HTML page. When someone shares your URL on a social platform, that platform sends a request to your page (called "scraping" or "crawling") and reads the OG tags to determine what to display in the link preview.

Here is a visual breakdown of what happens:

  1. Someone copies your URL and pastes it into Facebook, WhatsApp, LinkedIn, etc.
  2. The platform fetches your page and reads the <meta> tags in the <head>
  3. It finds your OG tags and uses them to build the link preview card
  4. The preview shows your chosen image, title, and description

The Essential OG Tags

There are four OG tags that every page should have at minimum:

1. og:title

The title of your page as you want it to appear in the share preview. This does not have to match your page <title> tag — you can make it more engaging for social media.

<meta property="og:title" content="Your Page Title Here" />

Tips: Keep it under 60 characters. Make it compelling — this is your headline on social media.

2. og:description

A brief summary of the page content. This appears below the title in the link preview.

<meta property="og:description" content="A short, engaging description of what this page is about." />

Tips: Keep it between 50-160 characters. Think of it as your elevator pitch for the page.

3. og:image

The image that appears in the link preview. This is the single most important OG tag — a good image dramatically increases engagement.

<meta property="og:image" content="https://www.yoursite.com/images/og-image.jpg" />

Tips:

  • Use a full, absolute URL (starting with https://)
  • Recommended size: 1200 x 630 pixels (this works on all platforms)
  • Minimum size: 600 x 315 pixels
  • Keep file size under 5MB (ideally under 1MB for fast loading)
  • Use JPG or PNG format
  • Avoid too much text on the image — Facebook may reduce reach for text-heavy images

4. og:url

The canonical URL of the page. This tells platforms which URL to associate with the content.

<meta property="og:url" content="https://www.yoursite.com/page" />

Additional Useful OG Tags

Beyond the four essentials, these tags give you more control:

og:type

Tells platforms what type of content this is. Most pages should use website. Blog posts can use article.

<meta property="og:type" content="website" />

og:site_name

The name of your overall website (not the page title).

<meta property="og:site_name" content="Your Company Name" />

og:locale

The language and region of your content.

<meta property="og:locale" content="en_ZA" />

og:image:width and og:image:height

Specifying the image dimensions helps platforms render the preview faster without having to download the full image first.

<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />

Complete Example

Here is a complete, copy-paste example of OG tags for a typical business page. Place these inside the <head> section of your HTML, before the closing </head> tag:

<!-- Open Graph Tags -->
<meta property="og:title" content="Professional Web Hosting in South Africa" />
<meta property="og:description" content="Fast, reliable hosting with local support. Get your website online in minutes." />
<meta property="og:image" content="https://www.example.co.za/images/og-share.jpg" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:url" content="https://www.example.co.za/" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Example Hosting" />
<meta property="og:locale" content="en_ZA" />

<!-- Twitter/X Card Tags (recommended alongside OG tags) -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Professional Web Hosting in South Africa" />
<meta name="twitter:description" content="Fast, reliable hosting with local support." />
<meta name="twitter:image" content="https://www.example.co.za/images/og-share.jpg" />
Note: Twitter/X uses its own card tags (twitter:card, twitter:title, etc.), but will fall back to OG tags if the Twitter-specific ones are not present. Including both ensures your content looks great everywhere.

Setting Up OG Tags in WordPress

If your website runs on WordPress, you do not need to edit HTML manually. Use one of these plugins:

Option 1: Yoast SEO (Recommended)

  1. Install and activate the Yoast SEO plugin from Plugins > Add New
  2. Edit any page or post
  3. Scroll down to the Yoast SEO section
  4. Click the Social tab (the share icon)
  5. Fill in the Facebook/social image, title, and description
  6. For site-wide defaults, go to SEO > Social in the admin menu

Option 2: Rank Math

  1. Install and activate the Rank Math plugin
  2. Edit any page or post
  3. Click the Rank Math icon in the editor
  4. Go to the Social tab
  5. Set your Facebook and Twitter images, titles, and descriptions

Setting Up OG Tags in a Static HTML Site

For static HTML websites, manually add the OG meta tags to the <head> section of each page:

  1. Open your HTML file in a text editor
  2. Find the <head> section (near the top of the file)
  3. Add your OG tags before the closing </head> tag
  4. Save the file and upload it to your hosting

Each page should have its own unique OG tags — do not use the same title, description, and image for every page.

How to Test Your OG Tags

After adding your OG tags, test them to make sure they work correctly:

Facebook Sharing Debugger

  1. Visit developers.facebook.com/tools/debug/
  2. Enter your page URL
  3. Click Debug
  4. Check that the preview shows the correct title, description, and image
  5. If you have updated your tags, click Scrape Again to refresh the cache

Twitter/X Card Validator

  1. Visit cards-dev.twitter.com/validator
  2. Enter your URL and preview how your card will look

LinkedIn Post Inspector

  1. Visit linkedin.com/post-inspector/
  2. Enter your URL to see the LinkedIn preview
Important: Social platforms cache OG data aggressively. If you update your OG tags and the old image/title still appears when sharing, use the platform-specific debug tools above to force a refresh. Simply updating the tags on your site is not enough — the platforms need to re-scrape the page.

Common Mistakes to Avoid

  • Using relative image URLs: Always use full URLs starting with https://. Relative paths like /images/photo.jpg will not work.
  • Image too small: Images under 200x200 pixels are often ignored entirely by social platforms.
  • Missing og:image: Without an image tag, platforms pick a random image from your page (or show nothing at all).
  • Same OG tags on every page: Each page should have unique tags. If every page has the same generic title and image, shared links all look identical.
  • Not testing after changes: Always test with the debug tools after making changes. Cached data can persist for days.
  • HTTP instead of HTTPS: If your site uses HTTPS (which it should), make sure your OG image URLs also use HTTPS.

Quick Reference Cheat Sheet

Tag Required? Best Practice
og:titleYesUnder 60 characters, compelling
og:descriptionYes50-160 characters
og:imageYes1200x630px, absolute HTTPS URL, under 1MB
og:urlYesCanonical URL of the page
og:typeRecommended"website" or "article"
og:site_nameRecommendedYour brand/company name
og:image:widthOptionalSpeeds up preview rendering
og:image:heightOptionalSpeeds up preview rendering
twitter:cardRecommended"summary_large_image" for best results

Need Help?

If you are struggling to get your OG tags working or are not sure how to implement them on your specific website setup, open a support ticket and our team will be happy to assist you.

Was this helpful?