Use a fully qualified absolute URL in og:image whenever you can: include both the scheme and host, such as https://example.com/images/share.jpg. A relative path like /images/share.jpg depends on the service fetching your page to infer the base URL. The Open Graph Protocol documents an image URL and illustrates the property with an absolute value; it does not define uniform relative-URL handling for every consumer.
If your application stores image paths as relative strings, resolve them against the canonical site origin while generating the HTML. Then inspect the rendered <head>, confirm the image is reachable, and add the optional image metadata that describes the asset.
What “relative” and “absolute” mean in og:image
A relative URL omits some or all of the address needed to locate a resource. Typical examples are /images/share.jpg (root-relative) and images/share.jpg (document-relative). An absolute, fully qualified URL includes the scheme and host: https://example.com/images/share.jpg.
The Open Graph Protocol describes og:image as “An image URL which should represent your object within the graph.” It is one of the protocol’s four required basic properties, and its example places a complete URL in the content attribute. That makes an absolute URL the conservative choice for production metadata.
#1 Best Overall
Why a relative path is less dependable
Browsers normally resolve relative resources against the document URL or a declared base URL. Link-preview crawlers, messaging clients and social-network fetchers are separate implementations. The protocol does not specify one common rule that all of them must use to resolve a relative og:image value. Some may resolve it successfully; others may ignore it or fetch the wrong location.
This is an interoperability concern, not proof that every crawler rejects relative URLs. If you want the metadata value itself to identify the resource without relying on consumer context, emit the scheme and host directly.
Minimal markup that works reliably
Put the image tag in the document’s <head> and make the value absolute:
<meta property='og:image' content='https://example.com/images/share.jpg'>
<meta property='og:image:alt' content='A description of the shared page image'>
Use the final, public URL that a crawler should request. Do not leave a template variable, an internal hostname or a filesystem path in the rendered output.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Resolving a stored path at render time
If your database or CMS stores /images/share.jpg, combine it with the canonical origin before writing the tag. In JavaScript, the standard URL constructor handles root-relative and document-relative paths:
const siteOrigin = 'https://example.com';
const storedPath = '/images/share.jpg';
const imageUrl = new URL(storedPath, siteOrigin).href;
const tag = `<meta property='og:image' content='${imageUrl}'>`;
console.log(tag);
The output should contain https://example.com/images/share.jpg, not the original relative path. Keep the origin configurable for each deployment so staging and production do not leak one another’s hostnames.
When the page and image use different hosts
An image can live on a CDN or asset host. In that case, emit the CDN’s complete HTTPS URL, for example https://cdn.example.com/social/share.jpg. The important requirement is that the value itself identifies a reachable scheme and host; it does not have to share the page’s hostname.
Optional Open Graph image properties
The protocol defines structured properties that add information about the image. They are not substitutes for the main og:image property.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #3
| Property | Purpose | Example |
|---|---|---|
og:image:url |
Identical to og:image. |
https://example.com/images/share.jpg |
og:image:secure_url |
An alternate URL for HTTPS pages. | https://cdn.example.com/images/share.jpg |
og:image:type |
The image MIME type. | image/jpeg |
og:image:width |
Image width in pixels. | 1200 |
og:image:height |
Image height in pixels. | 630 |
og:image:alt |
A description of what is shown in the image. | A product dashboard on a laptop |
The protocol says a page specifying og:image should also specify og:image:alt. Write the alt value as a description of the visual content, not as a marketing caption or a duplicate of the page title.
Absolute-URL edge cases to handle in your generator
Canonical origin and reverse proxies
Applications behind a proxy may see an internal request host while the public page uses another hostname. Configure the public canonical origin explicitly instead of blindly trusting an incoming host header. Otherwise, your metadata can contain an internal name, the wrong port or a staging domain.
HTTPS and ports
Include the scheme that the public crawler should use. If your site is served on a non-default port, include it in the URL. Avoid protocol-relative values such as //cdn.example.com/share.jpg; they still require the consumer to choose a scheme.
Paths, queries and fragments
Encode spaces and other reserved characters correctly. Query parameters are part of the image URL and may affect cache keys. A fragment (the portion after #) is not sent in an HTTP request, so it cannot select a different server-side image. Prefer a clean, stable asset URL.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #4
- 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
Localized pages and tenants
Generate the image URL from the same locale or tenant context as the page when the artwork differs by language or brand. If the image is shared globally, a single absolute CDN URL is simpler and less likely to produce inconsistent previews.
How to check the value that crawlers will see
- Open the rendered source. Use “View Page Source” or your framework’s server-rendered HTML output. A client-side component that inserts the tag after load may not be visible to a simple metadata fetcher.
- Search for
property='og:image'. Confirm there is one intended value, the content starts withhttps://(or the scheme you deliberately publish), and no template token remains. - Copy the image URL into a new tab. It should return the image itself, not an HTML error page, login form or redirect loop. Check the response for the correct content type and a successful status.
- Inspect deployment variants. Check production, localized routes and pages behind a reverse proxy. A correct local result does not guarantee that the public origin is being generated.
- Recheck after changing the asset. Preview services may cache metadata or images. Use a versioned filename or query string when you intentionally publish a new asset, while keeping the URL stable when you want cache continuity.
Common failures and precise fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| The preview has no image. | The value is relative, empty or missing from the server-rendered head. | Resolve the path against the public origin and emit an absolute og:image before the HTML is sent. |
| The preview shows an old image. | A crawler or intermediary cached the previous URL or response. | Verify the new asset at the exact URL, then publish a versioned URL if the old resource is intentionally being replaced. |
| The image works in a browser but not in a preview. | The image requires cookies, authentication or a browser-only redirect. | Use a publicly fetchable asset URL and remove access requirements from the social image endpoint. |
| The wrong hostname appears in source. | The app built the URL from an internal host, proxy host or staging configuration. | Set a deployment-specific canonical origin and use it when joining the stored path. |
| The image is cropped or visually poor. | The selected artwork is generic, extremely wide or tall, or too low-resolution. | Choose a relevant representative image and export a sufficiently high-resolution asset. Google Search Central recommends avoiding generic imagery and extreme aspect ratios; those are selection guidelines, not a universal social-platform size rule. |
| The image URL returns a redirect loop. | HTTP-to-HTTPS or CDN redirects conflict with host or scheme rules. | Publish the final HTTPS destination directly in og:image and test it from outside your application’s authenticated session. |
Choosing the image itself
URL correctness only makes the asset fetchable. The image still needs to represent the page. Google Search Central recommends a relevant, representative image, discourages generic imagery and extreme aspect ratios, and advises using high resolution when possible. Those recommendations help search presentation, but the cited guidance does not establish one universal width-and-height requirement for every social network or messaging client.
Keep the visual understandable at a small preview size, leave important text away from edges that may be cropped, and ensure the file is served in a format your public endpoint supports. Declare og:image:type, width and height when you know them; they give consumers useful metadata without changing the underlying URL.
Using a screenshot to inspect the final page
A screenshot is useful for checking whether a consent banner, popup or other overlay obscures the page you are documenting, but it does not replace correct Open Graph metadata. For automated visual checks without maintaining a local browser, ScreenshotNeo can capture a URL through one request and return PNG, JPEG, WebP or PDF. Its API is also useful when you want to compare the rendered page after changing your metadata.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsOr skip the browser setup
Call ScreenshotNeo’s endpoint with your public page URL. The API accepts a URL and returns the requested screenshot format; the documentation is at screenshotneo.com/docs/.
Best Value
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
- Cookie and consent banners, newsletter popups and chat widgets are removed before the shot.
- Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed; response headers identify the page verdict and billing result.
- An MCP server provides
take_screenshot,get_page_infoandcapture_pdftools for Claude, Cursor and other MCP clients. - The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 screenshots; yearly billing gives two months free, and every feature is available on every plan.
Sign up for the free ScreenshotNeo plan to inspect your rendered pages without installing a browser.
Frequently Asked Questions
Does the Open Graph specification explicitly ban every relative image URL?
No. It defines og:image as an image URL and shows an absolute example, but it does not specify uniform relative-URL resolution across all consumers. An absolute value avoids making that assumption.
What should og:image:alt say?
Describe what the image contains. The protocol distinguishes this description from a caption, headline or promotional message.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Is there one mandatory Open Graph image size?
The cited guidance does not establish a universal dimension for every platform. Choose a relevant, high-resolution image and avoid extreme aspect ratios, then verify how your important destinations display it.
Quick Recap
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.




