Seoxpert.io
mediumTechnical SEO

`og:image` Is a Relative URL

The `og:image` meta tag uses a relative URL, causing social previews to render without an image.

By Seoxpert Editorial · Published

Why it matters

Social platforms like LinkedIn, Facebook, and Twitter require an absolute URL for `og:image`. If a relative URL is used, their crawlers can't fetch your image, resulting in link previews without images. This significantly reduces engagement and click-through rates for shared links.

Impact

Social shares of your pages will display no image, leading to lower visibility and engagement.

How it's detected

Automated crawlers parse the page and flag any `og:image` meta tag whose content attribute does not start with 'http://' or 'https://'.

Common causes

  • Using relative paths in `og:image`, such as '/images/social.png' or 'upload/logo.jpg'.
  • Lack of awareness that Open Graph requires absolute URLs.
  • Copying image paths from internal usage without updating for social meta tags.
  • Frameworks or CMSes not automatically resolving image URLs to absolute form.

How to fix it

Update every `og:image` meta tag to use an absolute URL, including the full protocol and domain (e.g., 'https://yoursite.com/images/social.png'). In frameworks like Next.js, use full URLs in `metadata.openGraph.images` or set `metadataBase` to your site's base URL. Apply the same fix to `twitter:image` and `og:image:secure_url` tags.

Code examples

Incorrect: Relative URL in og:image

<meta property="og:image" content="/images/social.png">

Correct: Absolute URL in og:image

<meta property="og:image" content="https://yoursite.com/images/social.png">

Next.js: Setting metadataBase for automatic absolutes

export const metadata = {
  metadataBase: new URL('https://yoursite.com'),
  openGraph: {
    images: ['/images/social.png'], // will be resolved to absolute
  },
};

FAQ

Why can't I use a relative URL for `og:image`?

Social media crawlers resolve relative URLs against their own domain, not yours, resulting in broken image links.

Will this affect Twitter and LinkedIn previews?

Yes, both require absolute URLs for images in link previews. Relative URLs will not display images.

Do I need to update `twitter:image` as well?

Yes, `twitter:image` and `og:image:secure_url` also require absolute URLs.

How can I check if my `og:image` is absolute?

Verify that the `content` attribute starts with 'http://' or 'https://' and includes your full domain.

Found this issue on your site?

Run a scan to see if `og:image` Is a Relative URL affects your pages.

Scan my website →