Open Graph Tags Explained: Control How Your Links Look When Shared
By SEOAnalytics Lab · Updated · 5 min read
Have you ever shared a link and seen a plain web address, the wrong picture or a title you never chose? That preview is controlled by small pieces of code called Open Graph tags. When they are set up well, your link appears as a clean card with a title, a short description and an image.
In this guide you will learn what Open Graph tags are, which ones matter, the right image size, how to add them to your page and how to fix a preview that will not update.
The best Open Graph image size
The most common recommendation is an image of 1200 by 630 pixels, a ratio of about 1.91 to 1. This size fills the card on Facebook, LinkedIn and most other platforms without being badly cropped. Most platforms ask for at least 600 by 315 pixels, and rules change from time to time, so check the current guide for each one.
Keep important text and faces in the centre of the image, because some apps crop the edges. Use JPG or PNG, and avoid tiny text that cannot be read on a phone.
How to fix a preview that will not update
- The old preview is cached. Platforms save previews for a while. After you change your tags, use the platform's debugging tool, such as the Facebook Sharing Debugger or the LinkedIn Post Inspector, to fetch the page again.
- The image does not show. Check that the image address is a full link, opens in a browser without a login and is not blocked by robots.txt.
- The title or text is wrong. Make sure the page has only one set of Open Graph tags. Duplicates can confuse the platform.
- The tags are added by a script. Platforms read the page source and many do not run scripts. Place the tags in the HTML your server sends.
Common Open Graph mistakes
- Relative image paths. An address such as /image.png does not work. Use the full address, starting with https.
- Images that are too small. Small images may be shown as a tiny thumbnail or skipped. Use 1200 by 630 pixels.
- The same tags on every page. Each page should have its own title, description and, ideally, its own image.
- A missing og:url. Without it, the same page can be counted under several addresses.
Frequently asked questions
What are Open Graph tags used for?
They control the title, description and image shown when your link is shared on social media and messaging apps.
Where do I put Open Graph tags?
Inside the head section of the page. Each page should have its own set of tags.
Do Open Graph tags affect SEO?
Not directly. They do not raise your rankings by themselves, but a better preview can bring more clicks and shares.
Why is my old image still showing?
Platforms cache previews. Fetch the page again in a debugging tool, such as the Facebook Sharing Debugger.