Skip to content
FunnelGuard

Fix guide by FunnelsGuard

og:url pointing to staging or the wrong page: how to fix it

SEO-235Medium impactOther toolBy FunnelGuardPublished Updated
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 vs right og:urlhtml
<!-- 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.

How a wrong og:url loses visitors
  1. Page sharedVisitor pastes your landing page link
  2. Scraper reads og:urlTag names staging or another page
  3. Preview builtShows wrong or empty card
  4. Click-throughLands on wrong or blocked URL
  5. 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

Check the og:url on a page
  1. 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.

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

  3. Check several page types

    Test the homepage, a blog post, a product or service page and a landing page. Templates often differ.

  4. Compare with the canonical tag

    Search the source for rel="canonical". Both values should point to the same address.

  5. Use a platform debugger

    Paste the URL into the Facebook Sharing Debugger or the LinkedIn Post Inspector. They show the og:url they read and the URL they treat as canonical.

What you may see and what it usually means
What og:url showsLikely cause
staging.example.com or a dev subdomainDatabase or settings copied from staging to live
localhost or an IP addressSite URL set during local development
http instead of httpsSite address setting still on http
Homepage URL on every pageHard-coded value in a shared template
Another page's URLPlugin 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 og:url by platform
  1. 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_HOME and WP_SITEURL in wp-config.php.

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

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

  4. Clear caches

    Purge your caching plugin, server cache and CDN so the new head is served.

Example: build og:url from a base URL (custom PHP)php
<?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

og:url before and after

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
Confirm the fix
  • 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

Prevention habits
  • 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.

How a staging og:url slips through
  1. Week 1

    Site is built on staging with its own domain in settings

  2. Launch day

    Staging database is copied to live, domain setting comes with it

  3. Week 2

    Shared links show odd previews and open the staging address

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

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.