Fix guide · WordPress
How to Add Open Graph Tags in WordPress (2026)
Open Graph tags are the meta tags that control how your pages look when shared on Facebook, LinkedIn, Slack, WhatsApp and other platforms. Without them, those platforms show random text and no image. They also influence how some AI crawlers extract content metadata. This guide shows you how to add them in WordPress.
Why it matters
What this issue costs you
When someone shares your page on LinkedIn or Facebook, Open Graph tags determine the headline, description and image shown in the link preview. A missing og:image often means the platform shows no image at all — shares with strong images generate significantly more clicks.
Step-by-step
How to fix: Missing Open Graph tags
WordPress
- 1
Option A: Yoast SEO (recommended)
Yoast SEO outputs og:title, og:description, og:type and og:image automatically for every page. To enable: Yoast SEO → Social → Facebook → toggle "Add Open Graph metadata" on. For og:image, Yoast uses the post's Featured Image by default. Set your default fallback image at Yoast SEO → Social → Facebook → "Default image URL".
- 2
Option B: Rank Math
Rank Math adds Open Graph tags automatically. Go to Rank Math → General Settings → Links → "Open Graph Markup" → enable. Set featured images per post in the "Social" panel of the Rank Math meta box when editing a post.
- 3
Option C: Manual wp_head snippet
If you prefer not to use a plugin, add this to your functions.php. It outputs the essential Open Graph tags for posts and pages:
functions.phpadd_action( 'wp_head', function() { if ( ! is_singular() ) return; $title = get_the_title(); $desc = has_excerpt() ? get_the_excerpt() : get_bloginfo( 'description' ); $url = get_permalink(); $image = get_the_post_thumbnail_url( null, 'large' ); echo '<meta property="og:type" content="article">' . PHP_EOL; echo '<meta property="og:title" content="' . esc_attr( $title ) . '">' . PHP_EOL; echo '<meta property="og:description" content="' . esc_attr( $desc ) . '">' . PHP_EOL; echo '<meta property="og:url" content="' . esc_url( $url ) . '">' . PHP_EOL; if ( $image ) { echo '<meta property="og:image" content="' . esc_url( $image ) . '">' . PHP_EOL; } } ); - 4
Set featured images on all important pages
Open Graph images should be at least 1200×630px for best display on Facebook and LinkedIn. In the WordPress editor, use the "Featured Image" panel (right sidebar) to set the image for each page or post. Without a featured image, many plugins fall back to your site logo or nothing.
Verify the fix
Run the checker to confirm the issue is resolved
After applying the steps above, paste your URL below. Our checker will re-run every applicable check and show whether missing open graph tags still shows as a failing check.
FAQ
Common questions about missing open graph tags
What's the recommended og:image size?
Facebook and LinkedIn recommend 1200×630px (1.91:1 aspect ratio). Images smaller than 600px wide won't display as a large preview. Use JPEG or PNG.
Do Open Graph tags affect my Google search rankings?
Not directly. But they drive better click-through from social shares, which increases traffic and potentially signals engagement to Google. They also feed into how AI tools extract page metadata.
How do I test my Open Graph tags?
Use the Facebook Sharing Debugger (developers.facebook.com/tools/debug), LinkedIn Post Inspector, or Twitter Card Validator. After updating tags, clear any page caches before testing.
While you're here
Related fix guides for WordPress
Need a full audit?
This checker spots individual issues instantly. deepseoanalysis.com crawls your whole site and tracks changes weekly, from $24/mo.
See all WordPress fix guides, or run a free check now.