Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

To control the image shown when someone shares a web page, create a 1200 × 630-pixel image, host it at a public HTTPS URL, and set that URL in an og:image tag in the page’s initial HTML <head>. Add the page’s title, description, URL, and type as Open Graph metadata; for a large preview card on X, also set twitter:card to summary_large_image.

What controls a website preview thumbnail?

A link preview is assembled by the service displaying the link. Most website previews use Open Graph metadata in the page head, especially og:image, which identifies the image to show. The Open Graph protocol also defines fields for the page title, description, URL, and type. The Open Graph protocol describes these metadata fields.

The preview image is not necessarily a screenshot of the page. It is usually a separate image made for sharing: for example, a branded card with a page title, a product image, or a photograph. A screenshot can be useful when you specifically want to show the page as it appears in a browser, but it is not a replacement for adding the page’s social metadata.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Facebook and LinkedIn use Open Graph fields; X can use Twitter Card metadata and can fall back to Open Graph. Discord, Slack, and other clients also commonly consume Open Graph fields. Individual services can render, crop, or cache previews differently, so check the live link in each service that matters to you.

Choose the image size and format

Start with a 1200 × 630-pixel canvas, an aspect ratio of about 1.91:1. This is a broadly compatible baseline for link previews and is also the standard format presented by OpenGraph Studio. Designing to this ratio helps reduce unwanted cropping, but does not guarantee every service will display the image identically.

  • Keep the main subject, logo, and any essential words near the center rather than close to the edges. Preview services may crop or scale the image differently.
  • Use clear contrast and a legible title. A link card is viewed at different sizes, so avoid relying on small text to convey essential information.
  • Export a web-optimized JPEG, PNG, or WebP. Check the receiving service’s file-size limit rather than assuming every format or file size is accepted everywhere.
  • Use a stable, publicly reachable HTTPS image URL. The image must be fetchable by the service’s crawler without a login or client-side JavaScript.

OpenGraph Studio can crop and compress JPEG, PNG, and WebP images, generate tags, and preview major platforms. Its capabilities are described at OpenGraph Studio.

Create and publish the preview image

1. Design the artwork for the page

Make the image reflect the specific page being shared, not just the site in general. A page-specific image can pair the page’s subject with a short title and a brand mark. Keep the content readable at small display sizes and leave comfortable margins around important details.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Export and upload the image

Export a web-friendly image and upload it somewhere that serves it at a stable public HTTPS address. Use the final image URL—not a local file path, a URL that requires a logged-in session, or a link that only works after JavaScript runs. If you replace the artwork later, keeping the image URL stable may not make every preview update immediately because services can cache fetched page and image data.

Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

3. Add Open Graph and Twitter Card metadata

Place the tags in the page’s initial HTML head. Replace the example values with information for the page and the publicly accessible image you uploaded:

<head>
  <meta property="og:title" content="Your page title">
  <meta property="og:description" content="A concise description of the page.">
  <meta property="og:image" content="https://example.com/images/preview-1200x630.jpg">
  <meta property="og:image:width" content="1200">
  <meta property="og:image:height" content="630">
  <meta property="og:url" content="https://example.com/page">
  <meta property="og:type" content="website">
  <meta name="twitter:card" content="summary_large_image">
</head>

Use the canonical public URL of the page for og:url and an absolute HTTPS address for og:image. The width and height describe the example image; update them if the actual image dimensions differ. summary_large_image requests a large image card on X. Without that card setting, X may use a smaller layout.

4. Make sure the tags reach the crawler

Metadata should be present in the HTML the server initially returns. If a framework or content-management system inserts tags only after client-side JavaScript executes, a crawler that does not run that JavaScript may not see them. Inspect the page’s returned HTML and confirm that the title, description, image URL, and other tags are there before relying on a browser’s rendered view.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a CMS or ecommerce platform?

Some platforms generate Open Graph tags for you, so you may not need to edit a theme by hand. Shopify documents that its free themes use Open Graph tags and that social-sharing images can be assigned through theme or store settings. Its documentation also cautions that some themes use the theme-level social-media setting, so a page-specific field may not control the preview in every theme. Check the setting your theme actually uses, then inspect the published page’s head rather than assuming a saved setting was emitted.

When a CMS has both a global social-sharing image and page- or theme-specific image fields, check both. A global default may be used when a page has no individual image; a theme may also override or ignore a setting. Shopify points users to Facebook’s Sharing Debugger, X’s Card Validator, and LinkedIn’s Post Inspector for checking previews.

Refresh and verify the live preview

  1. Publish the page and confirm its metadata and image URL in the initial HTML head.
  2. Open the image URL directly in a browser session where you are not logged into the site. Confirm it loads over HTTPS and displays the intended image.
  3. Submit the page URL to the sharing debugger or inspector for the platform you care about. Review the title, description, image, and dimensions the service fetched.
  4. If the page or image changed, ask the platform to scrape the URL again using its debugger or inspector. A preview can continue showing cached information after the site has been updated.
  5. Check the actual share preview on each target service. One service’s successful preview does not establish that all services will crop or display it the same way.

Cached preview data can persist for days, and cache refresh behavior varies by service. Re-scraping is the practical first step when a platform still shows old metadata; changing the image on your site alone may not force an immediate refresh.

Why a preview image is missing, old, or cropped

No image appears

  • Confirm that og:image is in the initial HTML head, not only added by client-side JavaScript.
  • Make sure the value is an absolute HTTPS URL to the image itself, and open that URL to check that it is publicly reachable.
  • Check that the server allows the platform’s crawler to fetch the page and image, without authentication or a block that prevents access.
  • Use the platform’s debugger or inspector to see what metadata it fetched. A browser may show the page correctly even when a crawler cannot retrieve the image.

The old image still appears

Preview services may retain previously fetched page or image data. Re-scrape the page with the service’s sharing debugger or inspector. Allow for cache delays rather than assuming an edit to the HTML or image immediately changes an existing preview.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The image is cropped badly

Use a canvas near 1.91:1, such as 1200 × 630 pixels, and move essential elements away from the edges toward the center. Then inspect the preview on the services where it will be shared; different renderers may crop the same source differently.

X shows a small card

Include <meta name="twitter:card" content="summary_large_image"> in the head if you want to request a large image card. X can also use Open Graph fields, but the card setting is relevant to the card layout.

A CMS setting seems to have no effect

Check whether the theme uses a global social-sharing image or a page-specific image field, and inspect the emitted HTML to see which image URL was actually published. In Shopify, some themes use the theme’s social-media setting, so changing another field may not change the output.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you want a screenshot of a live page as an image rather than a designed Open Graph card, ScreenshotNeo can return a clean screenshot through one GET request. This captures page content; you still need to add the resulting image URL to your page’s metadata if you want a share preview to use it. Here is a cURL example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Cookie banners, newsletter popups, and chat widgets are removed before the shot; each of those steps can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and responses identify the page verdict and billing status. Its MCP server provides screenshot tools for AI agents, including Claude, Cursor, and other MCP clients. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.

Best Value
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

Frequently asked questions

Can I use a screenshot of my page as the preview image?

Yes, if that is the visual you want people to see. A screenshot is image content, not the metadata that tells a service which image to use; publish it at a public HTTPS URL and set that URL in og:image.

Do I need both Open Graph and Twitter Card tags?

Open Graph supplies the main title, description, and image fields used by many preview services. Add the Twitter Card setting when you want to request X’s large image card layout.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Will every service show the same image crop?

No. A 1200 × 630 image is a useful broad-compatibility starting point, but individual services can render and crop previews differently. Inspect the services that matter to your audience.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.