On this page
What this issue is
og:url is one of the Open Graph tags in the <head> of your page. Open Graph is the markup Facebook, LinkedIn, WhatsApp and many other apps read to build a link preview. The og:url tag says which address is the permanent, canonical one for that page.
The issue appears when that value is wrong. Common cases: it still holds a staging domain such as staging.example.com after a site launch, it says localhost, it uses http when the live site uses https, or every page on the site outputs the homepage URL.
<!-- Wrong: staging domain -->
<meta property="og:url" content="https://staging.example.com/pricing/" />
<!-- Wrong: same URL on every page -->
<meta property="og:url" content="https://example.com/" />
<!-- Right: live, full URL of this page -->
<meta property="og:url" content="https://example.com/pricing/" />Why it costs you leads or sales
Platforms treat og:url as the identity of the page. Likes, shares and comments on Facebook are tied to that address. If it names another page, engagement is counted against the wrong URL, and the scraper may fetch the preview from that other address instead of the one people shared.
A staging address is worse. It may sit behind a login or a noindex rule, so the preview can fail or show an old copy. People who click through can land on a dead or password-protected site instead of your offer. The result is lost clicks from social posts, email shares and messaging apps, and ad or campaign pages that look broken when shared.
- Page sharedVisitor pastes your landing page link
- Scraper reads og:urlTag names staging or another page
- Preview builtShows wrong or empty card
- Click-throughLands on wrong or blocked URL
- Lead or saleNever happens
The break happens in the page head, but the loss shows up later when people click.
How to check if your site has it
View the page source
Open the live page, right-click and choose View page source (or press Ctrl+U / Cmd+Option+U). Search for
og:url.Compare with the address bar
The content value should be the same full URL you see in the browser, on the live domain, with
https.Check several page types
Test the homepage, a blog post, a product or service page and a landing page. Templates often differ.
Compare with the canonical tag
Search the source for
rel="canonical". Both values should point to the same address.Use a platform debugger
Paste the URL into the Facebook Sharing Debugger or the LinkedIn Post Inspector. They show the
og:urlthey read and the URL they treat as canonical.
| What og:url shows | Likely cause |
|---|---|
| staging.example.com or a dev subdomain | Database or settings copied from staging to live |
| localhost or an IP address | Site URL set during local development |
| http instead of https | Site address setting still on http |
| Homepage URL on every page | Hard-coded value in a shared template |
| Another page's URL | Plugin or theme field copied from another page |
| Missing domain (relative path) | Tag outputs /page/ instead of a full URL |
How to fix it
The fix is the same everywhere: output the full live URL of the current page. How you get there depends on where the tag is created.
Fix the site address
Go to Settings > General. Make sure WordPress Address and Site Address both show the live https domain. If they are greyed out, check
WP_HOMEandWP_SITEURLin wp-config.php.Check your SEO plugin
Yoast SEO, Rank Math and similar plugins create og:url automatically. Open the plugin's social settings and the page's own canonical field and clear any custom URL that is wrong.
Search and replace old URLs
If a staging database was copied over, run a search-and-replace for the staging domain (for example with WP-CLI
wp search-replace). Take a backup first.Clear caches
Purge your caching plugin, server cache and CDN so the new head is served.
Check the theme code
Go to Online Store > Themes > Edit code and open
snippets/social-meta-tags.liquid(or the file that holds your og tags). Themes usually usecanonical_urlfor og:url.Use the canonical URL object
Replace any hard-coded address with
{{ canonical_url }}.Check the primary domain
Under Settings > Domains, make sure your live custom domain is the primary one, not the myshopify.com address.
Know the limits
Tag Manager can inject meta tags with a Custom HTML tag, but social scrapers do not run JavaScript, so they will not see them. Fix the tag in the page source instead.
Remove injected duplicates
If a Custom HTML tag adds an og:url, delete or correct it so the page does not output two conflicting values.
Open page settings
In the Designer, open the Pages panel, click the gear icon beside the page and go to the Open Graph settings.
Check the custom code
Look in Page settings > Custom code (head) and Site settings > Custom code for a hard-coded og:url and remove or correct it.
Set the published domain
Under Site settings > Publishing, make sure the live custom domain is the default one, then publish.
Open the funnel or website step
Go to Sites > Funnels (or Websites), open the page and open its Settings.
Check head tracking code
Look in the custom head code for a pasted og:url from a cloned page and remove or correct it.
Check the connected domain
Make sure the page is served on your custom domain, then publish again.
Open social share settings
In the Wix editor, open Pages, choose the page's menu, then SEO basics and Social share.
Check the connected domain
Wix builds the URL from your primary domain. In Settings > Domains, make sure the custom domain is the primary one.
Remove custom head code
Check Settings > Custom code for any hand-added og:url tag.
Check the primary domain
Go to Settings > Domains and make sure your custom domain is set as primary.
Check code injection
Go to Settings > Advanced > Code Injection and remove any hard-coded og:url.
Review per-page settings
Open the page's gear icon > Social Image and SEO to check the values. Squarespace generates og:url itself from the page address.
Build it from the request
Generate og:url from a configured base URL (an environment variable) plus the current path, not from a hard-coded string.
Use different config per environment
Staging gets the staging base URL and live gets the live one, set outside the code so deploys cannot swap them.
Match the canonical
Output the same value in
og:urlandrel=canonical.
<?php
$base = rtrim(getenv('SITE_BASE_URL'), '/'); // e.g. https://example.com
$path = strtok($_SERVER['REQUEST_URI'], '?'); // drop query string
$url = $base . $path;
?>
<meta property="og:url" content="<?= htmlspecialchars($url, ENT_QUOTES) ?>" />
<link rel="canonical" href="<?= htmlspecialchars($url, ENT_QUOTES) ?>" />How to confirm it's fixed
Before
- og:url names staging.example.com
- Shares and likes counted on the wrong address
- Preview may fail or show an old copy
After
- og:url is the live https page address
- Matches the canonical tag
- Preview and click-through use the right page
- View source on the live page and confirm og:url is the live full URL
- Check that og:url equals rel=canonical
- Run the page through the Facebook Sharing Debugger and click Scrape Again
- Run it through the LinkedIn Post Inspector
- Test at least one page of each template type
- Click the shared link and confirm it opens the live page
Platforms cache previews. If an old value still shows after you fixed the tag, re-scrape the page in the debugger tools.
How to prevent it happening again
- Keep the site address in a setting or environment variable, never hard-coded
- After copying a staging site to live, or live to staging, search the database and templates for the old domain
- Add a launch checklist item: view source and check og:url and canonical
- Block staging from indexing and sharing with a password, and never copy its settings over
- Re-check og:url after changing themes, SEO plugins or the primary domain
- Do not clone pages without resetting their social and head settings
How FunnelGuard handles this
FunnelGuard does not check og:url today. It is a possible future check. FunnelGuard is a synthetic monitoring service: a robot visitor runs your real customer journeys, such as lead forms, checkouts and booking buttons, and checks each step, the tracking hits sent to ad and analytics platforms, and whether test leads reach your inbox and CRM.
Nearby, that means a journey that breaks because a page moved or a redirect sends visitors to the wrong place would show up as a failed step. It will not tell you that a meta tag in the page head is wrong.
To watch for this issue yourself, add og:url to your release checklist and view source on key landing pages after every launch or migration. You can also run a crawler such as Screaming Frog, which can extract custom meta tags, and compare og:url with the page address. The free FunnelGuard website audit is read-only and is not a replacement for this check.
Week 1
Site is built on staging with its own domain in settings
Launch day
Staging database is copied to live, domain setting comes with it
Week 2
Shared links show odd previews and open the staging address
Week 3
Someone views source, spots the staging domain and fixes the setting
Questions people ask
Why does my og:url show the staging site?
Usually because the site address setting or a database was copied from staging to live and still holds the staging domain. Fix the site URL setting, search and replace the old domain, clear caches, and re-scrape the page in the Facebook Sharing Debugger.
What is og:url and do I need it?
og:url is an Open Graph meta tag that gives the canonical address of a page for social platforms. It is optional, but if you include it, it must be the correct full live URL. A missing tag is safer than a wrong one.
Should og:url match the canonical URL?
Yes, in almost all cases. Both should be the same full, live, preferred address of the page. If they differ, platforms and search engines may treat different addresses as the main one.
How do I check my og:url tag?
View the page source and search for og:url, then compare it with the address bar and the canonical tag. You can also paste the link into the Facebook Sharing Debugger or LinkedIn Post Inspector to see what they read.
Why do my Facebook likes and shares go to the wrong page?
Facebook ties engagement to the URL it reads from og:url. If the tag names another page, such as the homepage, counts are merged onto that address. Set og:url to each page's own full URL.
Does a wrong og:url hurt my SEO?
Search engines mainly use the rel=canonical tag, not og:url. But a wrong og:url often signals a wider staging or template mistake, so check your canonical tag and indexing settings too.
I fixed og:url but the preview is still wrong. Why?
Social platforms cache link previews. Clear your site and CDN caches, then use the Facebook Sharing Debugger's Scrape Again button or the LinkedIn Post Inspector to refresh what they store.
Does FunnelGuard check og:url?
No. FunnelGuard does not check og:url today, though it is a possible future check. It monitors journeys such as forms and checkouts, tracking hits and lead delivery, so check og:url by viewing source or with a crawler.
Related issues
- SEO-233og:title / og:description missingFix guide
- SEO-234og:image missing, broken or wrong sizeFix guide
- SEO-237Shared links show a cached old image or titleFix guide
- SEO-239Same OG image and title on every pageFix guide
- SEO-240og:locale or og:type wrongFix guide
- SEO-236Twitter card tags missingFix guide