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.
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

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.
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_webserviceSet 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.
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.
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.
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 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