On this page
What this issue is
Every page has two versions. The raw HTML is what the server sends before any script runs. The rendered HTML is what the page looks like after the browser (or Google's renderer) has run the JavaScript. This issue is when the <title>, <meta name="description">, <link rel="canonical"> or <meta name="robots"> differ between the two.
Conflicting
- Raw HTML canonical points to /product/
- JS rewrites canonical to /product/?variant=2
- Title changes from 'Blue Shoes | Shop' to 'Loading...' then to a new text
- Crawlers that skip JS and Google disagree
Consistent
- Canonical, title and description set in the server HTML
- JS does not touch them, or sets the same value
- Only one canonical tag on the page
- Every crawler sees the same signals
Why it costs you leads or sales
- Server sends HTMLCanonical points to the clean URL
- JS runsScript rewrites canonical to a parameter URL
- Google choosesConflicting signals, may index the wrong URL
- Search listingWrong URL or weak snippet shown
The break happens after the server response, so it is easy to miss in a normal browser check.
How to check if your site has it
View the raw HTML
Open the page in Chrome, press Ctrl+U (Cmd+Option+U on Mac) or go to view-source:. Search for
<title,descriptionandcanonical. Note the values.View the rendered HTML
Open DevTools (F12), go to Elements and search the
<head>for the same tags. Note the values and how many canonical tags there are.Use Google's view
In Google Search Console, use URL Inspection, then View crawled page (HTML) or Test live URL, and compare the head with your raw source.
Fetch without JavaScript
Run
curl -s https://example.com/page | grep -iE '<title|canonical|name="description"|name="robots"'and compare it with DevTools.Crawl at scale
Tools such as Screaming Frog (JavaScript rendering mode) can crawl your site and report where the raw and rendered titles, descriptions or canonicals differ.
curl -s -A "Mozilla/5.0" https://example.com/page | grep -iE '<title|rel="canonical"|name="description"|name="robots"'console.log({
title: document.title,
canonicals: [...document.querySelectorAll('link[rel=canonical]')].map(l => l.href),
description: document.querySelector('meta[name=description]')?.content,
robots: document.querySelector('meta[name=robots]')?.content
});How to fix it
Use one SEO source
Run only one of Yoast, Rank Math or similar. Two plugins, or a plugin plus a theme, often output duplicate canonicals.
Remove theme or script overrides
Search the theme and plugins for scripts that edit
document.titleor canonical links, and remove them or make them output the same value.Clear caches
Purge page cache and CDN so the raw HTML reflects the fixed settings.
Find tags that edit the head
In Tags, look for Custom HTML tags that touch title, meta or canonical. Use Preview mode to see which fire on the page.
Remove or align them
Pause the tag or change it so it outputs the same value as the server HTML. Move real SEO tags into the site code, not the tag manager.
Publish and retest
Publish the container and compare raw and rendered HTML again.
Check theme.liquid
Open Online Store, Themes, Edit code, and look at
theme.liquid. Shopify outputs{{ canonical_url }}in the head. Remove any extra canonical or title scripts.Review apps
SEO, A/B testing and translation apps can rewrite tags with JavaScript. Disable them one at a time and retest.
Set tags in SEO settings
Set the title, description and canonical in Page settings so they are in the published HTML.
Check custom code
Review Custom code in site and page settings for scripts that change head tags, and remove or align them.
Render tags on the server
For React, Vue or similar, use server-side rendering or static generation, with a head manager such as Next.js Metadata or Nuxt useHead, so the tags exist in the first response.
Avoid client-only overrides
Do not set the canonical or robots tag only in client code. If JS must update the title on route change, make it the same value the server would send for that URL.
Keep one canonical
Update the existing tag instead of appending a new one.
<head>
<title>Blue Running Shoes | Example Store</title>
<meta name="description" content="Lightweight blue running shoes with free returns.">
<link rel="canonical" href="https://example.com/product/blue-running-shoes/">
</head>How to confirm it's fixed
- Raw HTML (view-source or curl) shows the correct title, description and canonical
- Rendered HTML in DevTools shows the same values
- Only one canonical tag exists in the rendered head
- Search Console URL Inspection shows the right canonical and head
- A crawler with JavaScript rendering reports no raw vs rendered differences
- Page cache and CDN were purged before testing
How to prevent it happening again
- Keep SEO tags in one place: the CMS, plugin or framework head manager
- Do not manage titles or canonicals through a tag manager
- Add a raw vs rendered comparison to your release checklist
- Re-crawl with JavaScript rendering after theme, plugin or app changes
- Review A/B testing tools so they do not change canonicals or robots
- Watch Search Console for 'Duplicate, Google chose different canonical than user' under Page indexing
How FunnelGuard handles this
Questions people ask
Does Google use the canonical from raw HTML or after JavaScript?
Google can use both. It reads the raw HTML first and may read the canonical again after rendering. If they differ, it has to choose, which can result in the wrong URL being indexed. Keep them identical.
Why is my page title different in Google than in my browser?
Google may have used the raw HTML title, or rewritten the title itself because it was vague, too long or changed by JavaScript. Check view-source against DevTools. If they differ, align them.
How do I compare raw HTML and rendered HTML?
Open view-source: for the raw HTML and the DevTools Elements panel for the rendered version, then compare the title, meta description, canonical and robots tags. Search Console URL Inspection also shows what Google saw.
Can JavaScript set a canonical tag?
Yes, Google can process a canonical added by JavaScript, but it is less reliable than one in the raw HTML. Many other crawlers ignore it. Set it on the server whenever you can.
Why do I have two canonical tags on my page?
Usually a plugin, theme, app or script adds one on top of an existing one. Google may ignore both when they conflict. Remove the extra source so only one canonical tag remains.
Do AI crawlers see JavaScript-changed titles?
Many do not run JavaScript, so they only read the raw HTML title and description. If your real title appears only after scripts run, they may quote a placeholder.
Does FunnelGuard detect changed titles or canonicals?
No. FunnelGuard does not check this yet. It monitors journeys, tracking and lead delivery, so use a rendering crawler and Search Console for title and canonical differences.
Related issues
- SEO-136Main content only rendered client-side, empty raw HTMLFix guide
- SEO-139JS errors stop the page rendering for crawlersFix guide
- SEO-145Dynamic rendering serves outdated or different content to botsFix guide
- SEO-146Pre-rendering service expired or brokenFix guide
- SEO-144Hydration mismatch or blank page on slow JSFix guide
- SEO-143SPA routes return 200 for non-existent URLsFix guide