When someone shares your page on a social network or a messaging app, a card usually appears with a picture, a title and a short description. That card is often the first impression people have of your content, and a good one can be the difference between a click and a scroll. These cards are controlled by a few lines of HTML called Open Graph tags. This guide explains how they work and how to create a preview image that looks great everywhere.
What Is Open Graph?
Open Graph is a protocol originally introduced by Facebook that lets a web page declare how it should be represented when shared. Many other platforms and apps, including messaging apps, professional networks and collaboration tools, read the same tags. If no tags are provided, the platform guesses from the page, and the guess is often a poor one, such as a tiny logo or a random image.
The Essential Tags
Place these in the head section of the page:
<meta property="og:title" content="Your page title">
<meta property="og:description" content="A short, enticing summary of the page">
<meta property="og:image" content="https://example.com/images/preview.jpg">
<meta property="og:url" content="https://example.com/page">
<meta property="og:type" content="website">
<meta property="og:site_name" content="Your site name">
Notes:
- Use absolute URLs, including the https:// part, for the image and the page address.
og:typeis "website" for general pages and "article" for blog posts.- The title and description can differ from your search title and meta description, so you can tune them for social sharing.
Twitter and X Cards
X uses its own tags, although it falls back to Open Graph when they are missing. A common setup is:
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Your page title">
<meta name="twitter:description" content="Short summary">
<meta name="twitter:image" content="https://example.com/images/preview.jpg">
The value summary_large_image displays a large banner image, while summary shows a small square thumbnail.
The Best Image Size
A widely used size is 1200 by 630 pixels, which has an aspect ratio of about 1.91 to 1. It displays well as a large card on most platforms. Some guidelines to follow:
- Use at least 1200 pixels wide when possible, so the image looks sharp on high-density screens.
- Keep a safe margin around important content, because some platforms crop the edges or show the image in different shapes. Placing key text and faces near the center is the safest approach.
- Keep the file size reasonable. Under about 1 megabyte is a sensible target, since some platforms reject or delay very large images.
- Use JPG or PNG for maximum compatibility. Some platforms do not handle newer formats in previews.
- Provide an
og:image:alttag to describe the picture for accessibility.
Platforms update their recommendations from time to time, so check their current documentation before a big campaign.
Designing a Preview Image That Gets Clicks
- Keep the message short. Aim for a headline of a few words in large type that can be read on a phone-sized card.
- Use strong contrast between text and background.
- Include your logo or site name, small and consistent, for recognition.
- Avoid clutter. One idea per image works best.
- Use a consistent template across posts so that your content feels like a series.
- Avoid placing text too close to the bottom or the edges.
- Do not mislead. The image should reflect the real content of the page.
Create a Default Image and Custom Ones
Every site should have a default preview image that works for any page, such as a branded banner with the tagline. Then, for important pages and articles, create specific images. If you run a site with many tool pages, a consistent template with the tool name and icon is an efficient way to give each page its own preview.
Testing and Debugging
After you add tags, check how they look. Most major platforms provide a free debugger or validator where you can paste a URL and see the preview. These tools also let you clear the platform's cached copy.
Common problems:
- The preview shows an old image after you changed it. Platforms cache previews, so use the platform's debug tool to refresh it, or change the image's file name.
- No image appears. Check that the URL is absolute, public and not blocked by
robots.txtor by a login requirement. - The image is cropped awkwardly. Re-export with important elements centered.
- The page is behind a cookie wall or redirect that hides the tags from the crawler. Make sure the tags are present in the initial HTML.
- The title or description is truncated. Keep titles to around 60 characters and descriptions to about 100 to 160 characters.
Do Open Graph Tags Affect SEO?
Open Graph tags are not a direct ranking factor in search engines. However, a more attractive preview can increase clicks and shares, which brings more visitors, and that is a real benefit for any website.
Resize Your Images Quickly
To make a 1200 by 630 preview image, you can crop and resize your artwork with our free Image Resizer and Cropper, which includes presets for common social media sizes and works privately in your browser.
Final Thoughts
A shared link is a tiny advertisement for your page. Add the Open Graph and Twitter Card tags, use a clear 1200 by 630 image with room around the edges, test with the platform debuggers and keep a consistent visual style. Ten minutes of setup can improve every future share.