SEO
Open Graph Tags: Complete Guide to OG Meta Tags for Social Sharing
Open Graph tags control how your pages appear when shared on Facebook, LinkedIn, Twitter, Slack, and other social platforms. This guide covers all required and optional OG tags, image specifications, Twitter Card tags, and how to debug and test your OG implementation.
OG Image Specifications: Size, Format, and Best Practices
The recommended og:image size is 1200x630 pixels (1.91:1 aspect ratio). This is the size that renders without cropping on Facebook, LinkedIn, Twitter summary_large_image cards, and most other platforms. Images smaller than 600x315 pixels may not display at all on some platforms. Images with a different aspect ratio get cropped, often in ways that cut off important content.
Use JPEG for photographs and images with many colors — it produces smaller file sizes at acceptable quality. Use PNG for images with text, logos, flat colors, or areas that need crisp edges. Maximum file size is typically 8 MB (Facebook) or 5 MB (Twitter), but aim for under 1 MB for fast loading. WebP is increasingly supported but may still fall back to JPEG/PNG on some platforms, so stick to JPEG or PNG for maximum compatibility.
Design OG images with the most important content centered, because some platforms apply rounded corners or additional cropping. Include your brand name or logo for recognition. Use high-contrast text that is readable at thumbnail size — the card may be as small as 80px wide on mobile. Avoid including the URL in the image, as platforms display it separately. Tools like Canva, Figma, and image generation APIs (Cloudinary, Vercel OG) can automate OG image creation.
Platform-Specific Open Graph Behavior
Facebook uses OG tags as the authoritative source for link preview content. It caches previews aggressively and re-crawls infrequently. Use the Sharing Debugger to force a re-crawl after changes. Facebook requires the OG image to be at least 200x200 pixels and recommends 1200x630. Facebook also respects og:type article and shows article metadata for properly tagged blog posts.
LinkedIn follows OG tags with a few quirks. It shows the site name from og:site_name below the link. It requires a minimum image resolution of 1200x627 pixels for large image cards and falls back to a small thumbnail if the image is too small. LinkedIn caches are notoriously persistent — even after updating OG tags and scraping with Post Inspector, some users may see the old preview for hours.
Slack and Discord both display OG link previews in messages. Slack respects og:title, og:description, and og:image, with a preference for images in the 700x400 range. Discord uses a similar implementation. Both allow users to dismiss link previews, and both re-fetch after a short cache period (minutes to hours rather than days) so updates propagate relatively quickly.
Testing Your Open Graph Implementation
The fastest way to test OG tags is to view the page source and search for og: to find all OG meta tags. Verify that og:image contains an absolute URL (not a relative path), that og:title is set, and that og:description is present. Load the image URL directly in a browser to confirm it is accessible and returns the correct image.
Use the Open Graph generator tool on this site to build your OG tags and then copy the HTML directly into your page head. After implementing, use the Facebook Sharing Debugger, LinkedIn Post Inspector, and the Twitter Card Validator to test how each platform renders the preview. Take a screenshot for each platform to have a before-and-after record.
For large sites with many pages, automate OG tag testing by fetching a sample of URLs with curl (using curl -s URL | grep og:) or writing a sitemap crawler that checks for required OG tags and reports missing or malformed ones. Include OG tag presence in your site audit checklist and CI pipeline if your site has dynamic OG generation.
FAQ
What are Open Graph tags?
Open Graph tags are HTML meta elements in the head section of a webpage that control how the page appears when shared on social media platforms and messaging apps. They define the title, description, image, and URL that appear in link preview cards on Facebook, LinkedIn, Twitter, Slack, Discord, and other platforms. The tags use the property attribute with og: prefix (e.g., og:title, og:image).
What is the correct og:image size?
The recommended og:image size is 1200x630 pixels at a 1.91:1 aspect ratio. This size renders without cropping on Facebook, LinkedIn, and Twitter. Minimum size to avoid being ignored is 600x315 pixels. Use JPEG for photos (smaller file size) and PNG for images with text or flat colors. Keep file size under 1 MB for fast loading. Always use absolute URLs including https:// in the og:image value.
Do Open Graph tags affect Google search rankings?
Open Graph tags are not a direct ranking factor for Google. Google primarily reads the HTML title tag, meta description, and structured data markup (schema.org) for search results. OG tags indirectly affect SEO by improving click-through rates on shared links, driving traffic, and potentially influencing Google Discover recommendations. Google sometimes falls back to og:title and og:description when HTML meta tags are absent.
What is the difference between og:title and the HTML title tag?
The HTML <title> tag is what browsers display in tabs and bookmarks and what search engines use for title in search results. og:title is what social platforms use for link preview cards. The two can and sometimes should differ — the HTML title might include your brand name (Great Post Title | Site Name) while the og:title might be just the post title for cleaner social cards. Platforms that do not find an og:title fall back to the HTML title tag.
How do I fix the old image still showing when I share a link?
Social platforms cache link previews. After updating OG tags, use the Facebook Sharing Debugger (Scrape Again button), LinkedIn Post Inspector, or Twitter Card Validator to force the platform to re-fetch the page and clear its cached preview. Facebook cache clears quickly with the debugger. LinkedIn cache can take longer. For platforms without a debugger tool, the cache usually expires within a few hours to a day.
Should I use Twitter Card tags or just Open Graph tags?
Use both. Twitter falls back to OG tags if Twitter Card tags are absent, so a page with only OG tags will display on Twitter. However, adding twitter:card (set to summary_large_image), twitter:site, and twitter:creator adds context specific to Twitter that OG does not cover. Total addition is about 4 lines of HTML. The twitter:card tag is the most important — without it, Twitter uses the summary card (small image) rather than the large image format.
How do I add Open Graph tags to a Next.js app?
In Next.js App Router, export a metadata object or generateMetadata function from your page.tsx file with an openGraph property. In Next.js Pages Router, use the next/head component to add meta tags with property="og:title" etc. inside the Head component on each page. For static pages, hard-code the values. For dynamic pages (blog posts, product pages), fetch the page data in getStaticProps or as an async call in generateMetadata and pass the dynamic values.
What is og:type and what values can it have?
og:type defines the type of content the page represents. The most common values: website (for homepages and general pages), article (for blog posts and news articles — enables additional article: tags like published_time and author), product (for e-commerce product pages), video.movie and video.episode (for video content), profile (for people pages). Use website as the default when none of the specific types apply. The og:type value affects which additional OG properties are available for the page.
Why is my og:image not showing on LinkedIn?
The most common reasons: the image is too small (LinkedIn requires at least 1200x627 pixels for the large image format), the image URL is relative rather than absolute (must include https://), the server returns a non-200 response when LinkedIn fetches the image URL, the image URL requires authentication, or LinkedIn is serving a cached preview from a previous scrape. Use the LinkedIn Post Inspector to force a re-scrape and check the error details it provides.
Can I have different OG images for different social platforms?
Not with OG tags alone — og:image applies to all platforms. You can use twitter:image to specify a different image specifically for Twitter, which overrides og:image on Twitter. For Facebook and LinkedIn, you must use the same og:image. If you need truly platform-specific previews, some workarounds involve redirecting the platform crawler to a different URL, but this is complex and fragile. The practical solution is to design a single OG image that works well at 1200x630 on all platforms.
Related free tools
If you want to turn this topic into action, use one of ShortIQ's free tools for campaign planning, UTM structure, or QR distribution.
Continue Reading
Explore related guides, examples, and practical workflows.
- How to Stop UTM-Tagged URLs from Creating Duplicate Pages in Google
- How to Write Meta Descriptions That Get More Clicks
- How JWT Authentication Works: A Complete Developer Guide
- Regex Cheat Sheet: Regular Expressions Reference for Developers
- ShortIQ Homepage
- UTM Builder Tool
- Bitly Alternative for SaaS Teams
- ShortIQ pricing overview
- ShortIQ Blog Home
Free newsletter
Get new guides in your inbox
We publish practical guides on dev tooling, prompt engineering, marketing workflows, and deployment. No fluff — straight to the point.
No spam. Unsubscribe any time.
Was this article helpful?
Tell us if this guide solved the problem or what was still missing. We use this to improve the blog and only follow up if you explicitly allow it.