Back to the blog
Best Practices

How to Fix Magento Social Media Previews with Open Graph Images

Learn how to use the Mosaicora Open Graph module to add reliable social preview metadata to Magento product, category, CMS, and home pages.

12 min readUpdated July 21, 2026

You will learn

  • Configure a store-view-safe metadata baseline without editing storefront templates
  • Upload dedicated Open Graph images without replacing storefront product or content images
  • Use the module's cache controls and metadata APIs to verify the storefront contract
Magento product page metadata flowing through optimized social image generation into a share preview card

The direct answer

The Mosaicora Open Graph module lets Magento, Mage-OS, and Adobe Commerce teams upload dedicated images for product, category, and CMS page link previews without changing the images shoppers see on the storefront. It also resolves sensible metadata fallbacks, can create cached 1200 by 630 share images from local media, and optionally mirrors the result into Twitter Card tags.

What the module covers on a Magento storefront

A share preview should describe the page a shopper will reach, not a generic storefront. The module adds Open Graph metadata during layout generation for product pages, category pages, CMS pages, and the home page. That gives marketing and development teams one place to control the social contract across the page types that customers most often share.

  • Product pages resolve metadata from the active product.
  • Category pages resolve metadata from the active category.
  • CMS pages resolve metadata from the page rendered by Magento.
  • The home page uses the active CMS home page when one exists, then falls back to the configured site name and default image.

Open source and available on GitHub

The module is open source under the GPL-3.0-or-later license. Review the source, release notes, and contribution guidance in its public repository.

Install and enable it in the normal Magento workflow

The package supports Magento 2, Mage-OS, and Adobe Commerce storefronts running PHP 8.1 through 8.5. Install it from the Magento project root, then run your usual upgrade and cache process. Keep Composer dependencies at the project level rather than creating a nested vendor directory inside a mounted module.

Install the Open Graph module
composer require mosaicora/module-opengraph

bin/magento module:enable Mosaicora_OpenGraph
bin/magento setup:upgrade
bin/magento cache:flush config layout block_html eav full_page config_webservice

Set a store-view baseline before creating exceptions

Configuration lives under Stores, Configuration, Mosaicora, Open Graph. Where Magento allows it, settings are store-scoped. This is useful when store views have different site names, languages, default images, catalog attributes, or creative requirements. Start with a dependable baseline, then reserve page-level overrides for campaigns and genuinely exceptional pages.

Baseline settings to decide with marketing and development

  • Enable Open Graph tags and set the social site name for each store view.
  • Choose a default image that still represents the brand when a page has no suitable local media.
  • Enable Twitter Card tags when the storefront should emit the equivalent twitter-prefixed fields.
  • Choose a Twitter Card type that matches the intended image treatment.
  • Leave competing-tag removal off until you have identified every theme or extension that also publishes social metadata.
Configure the module per store view, including the default image, Twitter Card output, duplicate-tag handling, image optimization, and the fallback attributes used for product, category, and CMS metadata.

Use dedicated share images without replacing storefront media

A storefront product image and a share image often have different jobs. The module adds an Open Graph Image role to Magento product images. Upload an image to that role when a campaign or seasonal share card needs its own visual, without replacing the catalog image shoppers see. Categories and CMS pages can also use their own uploaded Open Graph image. When no dedicated image is set, the module follows practical Magento fallbacks.

Enable Open Graph Image for the upload that should represent this product when its page is shared. It is a separate role from the storefront image roles.

Default resolution

A dependable catalog-wide starting point

Use existing SEO and catalog attributes to cover the long tail of products and categories without manual duplication.

Dedicated OG image

A share-only creative asset

Upload an Open Graph-specific image when a campaign, editorial page, or flagship product needs a different share treatment without changing its storefront media.

Make local catalog images dependable share images

A sharp product image is not always already sized for a social card. Image optimization is enabled by default and turns local Magento media into cached share images at 1200 by 630, the widely used Open Graph card ratio. You can control the width, height, resize mode, and background color. External image URLs are intentionally left unchanged.

  • Use the default 1200 by 630 output when one landscape format fits the campaign and platform mix.
  • Review the resize mode and background color against transparent-packshot and portrait product imagery.
  • Expect only normalized local Magento media paths to be transformed and cached.
  • Use the admin cache action after a deliberate image correction when generated Open Graph images need to be cleared.

Choose one authority for overlapping social tags

A Magento theme or another extension may already write Open Graph or Twitter Card tags. The cleanest setup is to disable the other output so each metadata key has one owner. If that is not possible, the module can remove competing Open Graph, product, and enabled Twitter Card tags for keys it generates. The setting is off by default to preserve compatibility.

A safe duplicate-tag rollout

  • Inspect initial storefront HTML for existing og, product, and twitter meta tags.
  • Disable duplicate output at the theme or extension when that option exists.
  • Enable Remove Competing Social Tags only when the remaining source cannot be disabled.
  • Recheck product, category, CMS, and home pages for one intentional value per key.

Use resolved metadata in custom frontends

The module exposes the same normalized metadata through anonymous, read-only REST endpoints for product, category, CMS, and home pages. Its GraphQL fields appear on Magento's native storefront types, including ProductInterface, CategoryInterface, CmsPage, and StoreConfig. Both surfaces return the resolved tag list, so a headless storefront, mobile application, or other custom frontend can use the same metadata as the Magento storefront.

Query resolved product metadata through GraphQL
query ProductOpenGraph($sku: String!) {
  products(filter: { sku: { eq: $sku } }) {
    items {
      sku
      open_graph {
        enabled
        tags {
          name
          content
        }
      }
    }
  }
}

Launch with a small, repeatable quality check

Before a campaign or catalog release

  • Open a representative product, category, CMS, and home page for every important store view.
  • Confirm the canonical URL, title, description, image, width, and height values are accurate.
  • Check product price, currency, and availability metadata when product previews use those fields.
  • Confirm Twitter Card tags appear only when the setting is enabled and match the resolved Open Graph values.
  • Use a public inspector to validate the live HTML before a social post or paid campaign goes out.

Check live example pages

Open a ready-made checker result to see the metadata the demo store publishes for each page type.

This workflow keeps the technical metadata and the marketing message aligned. Developers get a predictable resolution path and inspectable output. Marketers get accurate, page-specific previews without needing a separate set of storefront templates for every campaign.

Inspect a public Magento page before you share it

Check the title, description, image, and metadata that a crawler can read from a product, category, CMS, or home page.

Open the free checker

Use the next guide to implement, validate, or scale what you learned here.