Og url mismatch
Moderate effortSet a unique, page-specific og:url meta tag on every page that exactly matches that page's canonical URL.
What it is
The `og:url` tag is a small piece of HTML in your page's `<head>` that tells social networks, messaging apps, and AI systems the "true" address of a page when someone shares it. When this tag is missing or set to a site-wide default (for example, always pointing to your homepage), every single page on your site tells the world it lives at the wrong address. A correct `og:url` should always equal the canonical URL of the exact page it appears on — never a template value, never your homepage, never an alternate URL.
Why it matters
When `og:url` mismatches the canonical URL, shares on Facebook, LinkedIn, Slack, WhatsApp, and other platforms create links that point to the wrong page — sending potential customers somewhere they didn't expect, or even to a 404. AI tools that cite your content (ChatGPT, Perplexity, Bing Copilot) read Open Graph data to form citations; a wrong `og:url` means citations and backlinks generated from shared content point to the incorrect URL, splitting your link equity and diluting your rankings. For ecommerce specifically, a product link shared by a happy customer that resolves to the homepage instead of that product costs you direct conversions. Search engines also use Open Graph data as a consistency signal; persistent mismatches can reduce crawl trust in your canonical declarations.
How to fix it
- Identify every page template on your site (homepage, product pages, category pages, blog posts, landing pages) that outputs an og:url tag.
- Check whether your theme, plugin, or platform is injecting a static/global og:url (e.g. always your homepage domain) rather than the dynamic current-page URL.
- Replace the static value with a dynamic variable that outputs the canonical URL of the current page — this is the same URL you use in your <link rel='canonical'> tag.
- Ensure the og:url value uses the preferred protocol (https), preferred subdomain (www or non-www), and no trailing-slash variation that differs from your canonical — they must be byte-for-byte identical.
- After deploying, use the Facebook Sharing Debugger (developers.facebook.com/tools/debug/) and LinkedIn Post Inspector to confirm each page type shows its own correct URL in the og:url field.
- Audit a sample of page types (homepage, a product, a category, a blog post) to verify the fix is consistent across all templates, not just the one you edited.
Fix it on your platform
Pick your platform for the exact steps.
How to fix og url mismatch on Shopify
- In your Shopify Admin, go to Online Store → Themes → click 'Edit code' on your active theme.
- Open 'snippets/' and look for a file named 'social-meta-tags.liquid', 'meta-tags.liquid', or similar (theme names vary; search for 'og:url' across all files using the search box in the code editor).
- Find the og:url meta tag line. If it reads something like content='{{ shop.url }}', replace it with the correct dynamic value per page type (see code snippets below).
- If your theme uses 'theme.liquid', locate the og:url line in the <head> section and apply the same fix.
- Save the file, then preview a product page and a collection page and use 'View Source' to confirm the og:url matches each page's actual URL.
- If you use a third-party SEO app (e.g. Yoast for Shopify, SEO King, Plug In SEO), check the app's settings — it may override theme og:url output and have its own field for this.
How to fix og url mismatch on WooCommerce
- Install or open the Yoast SEO or Rank Math plugin (both handle og:url automatically on a per-page basis — this is the recommended fix path for WooCommerce).
- In Yoast SEO: go to WordPress Admin → SEO → Social → Facebook tab and ensure 'Add Open Graph meta data' is enabled. Yoast will then output the correct og:url automatically on every page.
- In Rank Math: go to WordPress Admin → Rank Math → General Settings → Social Meta and ensure 'Open Graph Meta' is ON.
- If you are NOT using an SEO plugin and og:url is hardcoded in your theme's header.php or functions.php, locate the echo or printf statement outputting og:url and replace the static value with the dynamic <?php echo esc_url(get_permalink()); ?> (see code snippets).
- After saving, use 'View Source' on a product, a category, and a post to confirm each shows its own URL.
- Clear any caching plugin (WP Super Cache, W3 Total Cache, WP Rocket) after making changes.
How to fix og url mismatch on BigCommerce
- In BigCommerce Admin, go to Storefront → My Themes → click 'Edit Theme Files' (Advanced mode) on your active theme.
- Open 'templates/layout/base.html' (Stencil themes) and search for 'og:url'.
- Replace any hardcoded or incorrect value with the Stencil context variable: content='{{og.url}}' — BigCommerce's Stencil framework populates this automatically with the canonical URL when used correctly.
- If 'og.url' is absent from your template, add <meta property='og:url' content='{{og.url}}'> inside the <head> block.
- Save and apply the theme, then verify by viewing source on a product page, a category page, and the homepage.
- If you use a third-party SEO app from the BigCommerce App Marketplace (e.g. SEO Manager), check that app's Open Graph settings and disable duplicate og:url output from the theme to avoid conflicts.
How to fix og url mismatch on Wix
- In the Wix Editor, click on the page you want to update in the Pages panel.
- Go to Pages → (hover the page) → Settings → SEO tab → scroll down to 'Social share preview / Open Graph'. Wix automatically sets og:url to the page's canonical URL from this panel.
- If pages are showing a wrong og:url, check whether you have a Wix app or custom code widget injecting a conflicting tag: go to Add Apps → Manage Apps and review any SEO or social-meta apps.
- For Wix stores, go to the relevant product/collection page, open its SEO settings, and verify the Social Preview section shows the correct page URL.
- Use Wix's built-in SEO Wiz or the Google tag manager integration if you need more granular control, but for most cases the per-page Social Preview settings are sufficient.
- After saving, use the Facebook Sharing Debugger to scrape a product and a static page to confirm og:url is correct.
How to fix og url mismatch on Squarespace
- In Squarespace, go to Pages → click the gear icon (⚙) next to any page → SEO tab → scroll to 'SEO Description'. Squarespace automatically sets og:url to the page's canonical URL — you cannot manually override it per-page without custom code.
- If your og:url is wrong site-wide, the most common cause is a custom code injection: go to Settings → Advanced → Code Injection and look for any hardcoded og:url tags in the Header section. Remove or correct them.
- For per-page code injection overrides, go to Pages → gear icon → Advanced → Page Header Code Injection and remove any conflicting og:url lines.
- Squarespace Business/Commerce plans allow Header code injection; if a developer has added a static og:url here, it will override Squarespace's automatic value — that line must be removed or made dynamic.
- After removing any conflicting injection, use the Facebook Sharing Debugger to verify the og:url for multiple page types.
How to fix og url mismatch on Webflow
- In Webflow Designer, open the Page Settings for a given page (click the Pages panel → gear icon next to a page).
- Scroll to the 'Open Graph Settings' section. In the 'Open Graph URL' field, ensure it is blank or set to the correct page URL — if it contains a hardcoded URL (e.g. the homepage), clear it. Webflow uses the published page URL by default when this field is empty.
- For Collection (CMS) pages (e.g. blog posts, product detail pages), open the Collection Template page settings, go to Open Graph Settings, and bind the OG URL field to the CMS item's slug/URL field using the '+' dynamic binding icon so each item gets its own URL.
- If you've added a global og:url via a custom code embed in the <head> (Site Settings → Custom Code → Head Code), locate and remove or fix that hardcoded tag.
- Publish your site, then use 'View Source' on a CMS item page and a static page to verify the og:url is unique and matches the canonical URL on each.
- Use the Facebook Sharing Debugger to force a re-scrape and confirm the corrected values.
How to fix og url mismatch on Adobe Commerce (Magento)
- In Adobe Commerce / Magento 2 Admin, go to Stores → Configuration → Catalog → Catalog → Product Fields Auto-Generation and review any OG-related settings.
- The primary location for og:url in a Luma-based theme is in app/design/frontend/<Vendor>/<Theme>/Magento_Theme/templates/html/head/. Look for a file that outputs og meta tags (often a custom template or a third-party SEO extension).
- If you use an SEO extension (e.g. Mageworx SEO Suite, Amasty SEO Toolkit), go to that extension's configuration in the Admin and find the Open Graph section — enable 'Use canonical as og:url' or a similar option.
- If og:url is hardcoded in a layout XML or PHTML template, replace the static value with the PHP call to get the current page's canonical URL: $block->getUrl('//*', ['_current' => true, '_use_rewrite' => true]) or retrieve it from the page's canonical helper.
- Run bin/magento cache:flush after making template changes.
- Verify by viewing source on a product page, a category page, and the CMS home page that each og:url is unique and matches its <link rel='canonical'>.
How to fix og url mismatch on WordPress.org
- Install Yoast SEO or Rank Math if not already present (both output a correct per-page og:url automatically).
- In Yoast SEO: WordPress Admin → SEO → Social → Facebook → enable 'Add Open Graph meta data' and save. No further action needed — Yoast handles og:url dynamically.
- In Rank Math: WordPress Admin → Rank Math → General Settings → Social Meta → enable 'Open Graph Meta' and save.
- If you are managing og:url manually in your theme's header.php or functions.php, find the line echoing og:url and replace it with: <meta property='og:url' content='<?php echo esc_url(get_permalink()); ?>' />
- If two sources are outputting og:url (e.g. your theme AND an SEO plugin), you will have duplicate tags — disable the theme's output to let the plugin take control (theme documentation will describe a filter hook to disable its social meta).
- Clear caching plugins and verify with 'View Source' on several page types.
How to fix og url mismatch on Headless / Custom (I build in code)
- In your head-rendering component (e.g. Next.js: app/layout.tsx or pages/_app.tsx using next/head; Nuxt.js: nuxt.config.ts useHead or app.vue; Astro: src/layouts/Base.astro), locate where og:url is set.
- Replace any static/hardcoded URL with the current page's canonical URL derived from the request context — e.g. in Next.js: use `useRouter().asPath` combined with your base URL, or pass the canonical URL as a prop from getStaticProps/getServerSideProps.
- Ensure the value is absolute (includes https:// and domain), matches the <link rel='canonical'> output exactly, and does not include query strings or fragment identifiers unless they are part of the canonical.
- For static site generators (Hugo, Jekyll, Eleventy), use the built-in page URL variable (Hugo: {{ .Permalink }}, Jekyll: {{ page.url | absolute_url }}, Eleventy: {{ page.url | absoluteUrl(site.url) }}) in your base layout.
- Build and deploy, then use 'View Source' on multiple page types to verify uniqueness.
- Optionally add an automated test to your CI pipeline that checks og:url === canonical for a set of representative URLs.
Does your site have this issue?
Run a free SEOLZ scan to find og url mismatch — and every other issue — across your whole site in minutes.
Scan my site freeFrequently asked questions
What is Og url mismatch?
The `og:url` tag is a small piece of HTML in your page's `<head>` that tells social networks, messaging apps, and AI systems the "true" address of a page when someone shares it. When this tag is missing or set to a site-wide default (for example, always pointing to your homepage), every single page on your site tells the world it lives at the wrong address. A correct `og:url` should always equal the canonical URL of the exact page it appears on — never a template value, never your homepage, never an alternate URL.
Why does og url mismatch matter?
When `og:url` mismatches the canonical URL, shares on Facebook, LinkedIn, Slack, WhatsApp, and other platforms create links that point to the wrong page — sending potential customers somewhere they didn't expect, or even to a 404. AI tools that cite your content (ChatGPT, Perplexity, Bing Copilot) read Open Graph data to form citations; a wrong `og:url` means citations and backlinks generated from shared content point to the incorrect URL, splitting your link equity and diluting your rankings. For ecommerce specifically, a product link shared by a happy customer that resolves to the homepage instead of that product costs you direct conversions. Search engines also use Open Graph data as a consistency signal; persistent mismatches can reduce crawl trust in your canonical declarations.
How do I fix og url mismatch?
Set a unique, page-specific og:url meta tag on every page that exactly matches that page's canonical URL.
Authoritative references
- Consolidate duplicate URLs (canonical) — Google Search Central
- SEO Starter Guide — Google Search Central