CheckMySchema

Structured data explained

How to Catch a Canonical URL Mismatch in Article JSON-LD

Check the final article URL, HTML canonical and Article page reference, and tell harmless JSON-LD fragments from a stale page URL.

    Laptop and printed reference sheets on a desk used to check article markup.
    Open the delivered article and capture its final address. Keep the exact canonical and graph values in a separate fixture.
    CheckMySchemaCheckMySchema

    At a glance

    Check one public canonical route and resolve the Article page reference against it.

    See a complete Article JSON-LD example

    Start with the page a visitor actually reaches. Save its final URL, read the canonical link from the returned document and follow the Article node's page reference. The values should describe the same preferred page for a normal standalone article. Keep the Article's own graph identifier in a separate column so that a useful fragment does not masquerade as a mismatch. The worksheet below gives you a record you can check again after a fix.

    Capture the public response

    Choose an ordinary URL from the article archive or sitemap. Use a public tab without an editor session, a preview cookie or a staging login. Record both the address you requested and the one you landed on. In a browser, the location bar gives you the address after navigation. In the Network panel, a document request lets you see which response led to it. Compare the main document rather than a request for an image, script or API route. Save the status of each document response if you find a redirect. This lets you distinguish a bad canonical from an unexpected destination before touching the markup.

    A normal test might begin with the old link someone put in a navigation menu and end at the new article. If the old link has a permanent redirect to the current guide, the old URL still belongs in the worksheet. It helps identify where the visitor started and gives you another place to check for stale template references. Once you reach the current guide, read the canonical and JSON-LD from that guide's response. A redirect alone does not tell you which canonical or graph relationships the destination emits.

    Test the ordinary shared address and one variant if you know the site actually emits both. A no-slash request and a trailing-slash request are worth testing when both have appeared in past links. Avoid turning that into an instruction to add or remove slashes. One convention already belongs to each published route. The job is to identify the route the site uses and to confirm that its visible article, canonical and sitemap agree with it. If both forms return 200, note that fact and inspect both responses before deciding whether one is an intended duplicate.

    The requested URL redirects to the final page, which agrees with the canonical and JSON-LD page URL.
    The requested URL redirects to the final page, which agrees with the canonical and JSON-LD page URL.

    Place the page reference in a fuller example of the article markup. See a complete Article JSON-LD example.

    Sources: Google Search Central · Schema.org

    Read the canonical in context

    In the delivered HTML, find the canonical link in the head and copy its href. If the page declares a root-relative href, resolve it against the delivered page URL before comparing it. On an article at example.com/journal/rain-gauge/, the href /journal/rain-gauge/ resolves to that full address. By contrast, //archive.example.com/journal/rain-gauge/ retains the current scheme and points to a different host. These strings may look related in a quick glance at the code, yet the resulting addresses are different. Put both the literal href and the resolved address in the worksheet.

    Count the declarations as well as reading their values. If a site-wide plugin and an article template both write a canonical, capture each resolved href and its origin in the document when you can. A duplicate pair pointing to the same URL is a different repair from a pair pointing to different locations. Identify which mechanism should own that field. Keep the evidence in the outgoing HTML and avoid relying only on an admin field labeled Canonical URL. The field can be correctly configured while another integration still emits a conflicting declaration.

    On archives and separate editions, first ask whether the current route is intended to be independently searchable. A printer view or duplicate with tracking parameters may intentionally name a clean parent URL. A standalone translation or a substantively different edition needs a separate editorial decision. Preserve that existing decision during the markup repair. A quick string comparison cannot decide whether two pages deserve one canonical, and an identical title is insufficient evidence. For this guide's main worksheet, pick a regular article that the site intends to include under its own URL.

    The Article reference points to a WebPage identifier. The node has its own url property.
    The Article reference points to a WebPage identifier. The node has its own url property.

    An identifier and an address

    Article @id

    Names the Article node. Preserve a stable entity identifier, including a deliberate fragment.

    WebPage url

    Names the actual preferred public page. Follow a WebPage reference in the graph and compare its URL with the final route.

    Redirects, link annotations and sitemap entries are signals. Align them and remember search engines may choose another canonical. Structured data should describe the delivered canonical page. How to specify a canonical URL.

    Sources: Google Search Central · Schema.org

    Follow the graph to the page it names

    Find the Article, BlogPosting or more specific editorial entity describing the visible piece. Some sites put it in a single script, while others put it among several nodes inside an @graph array. Open the script in structured-data tooling and inspect the actual node fields. Compare its headline and byline with the page when there are several similar nodes. Do this before searching the source for the first occurrence of the article slug. The same string can appear in breadcrumbs, navigation, publisher metadata or the image caption without being the Article's page pointer.

    Read mainEntityOfPage on the Article node when it is present. It may name a URL directly or refer to a WebPage node. If it refers to an identifier such as example.com/journal/rain-gauge/#webpage, look for that exact identifier elsewhere in the graph. Then read that WebPage node's url when the node supplies one. Copy the pointer and the resulting page URL into separate cells. This avoids interpreting the reference as if every property on the pointed-to node used the same form. If the reference names a WebPage node you cannot find in the delivered graph, note the missing link and check where the helper intended to define it.

    Keep the Article's own @id separate from mainEntityOfPage. A site can use example.com/journal/rain-gauge/#article as the stable identifier for the article entity and still refer to a WebPage describing the public address without the fragment. That arrangement can be internally coherent. A stale WebPage url or a pointer to the wrong page is a defect you can demonstrate. A lone entity fragment does not establish a defect. Keep these findings separate in your issue so someone fixing the template knows which field to change.

    Sources: Google Search Central · Schema.org

    Work through a passing and failing fixture

    Use a fictional address such as example.com/journal/rain-gauge/. In the passing fixture, a request to the same path without the slash redirects to that address. The HTML canonical also resolves there. The Article identifier ends in #article. Its mainEntityOfPage points at a WebPage identifier ending in #webpage. The referenced WebPage node supplies the clean, slash-terminated article address as its url. One case now exercises the redirect, the canonical and the graph lookup. The two identifiers remain unique while the WebPage's URL ties the markup to the delivered page.

    Build the failing fixture by changing only the WebPage url to example.com/journal/old-rain-gauge/. Leave the syntax, the headline, the Article identifier and the pointer to the WebPage node alone. In this case the href still describes the intended article, and the field that names the page inside the graph describes the old one. The fixture makes the fault obvious because there is exactly one changed input. The comparison table records all fields, so another reviewer can identify the defect without having to infer which field a screenshot highlighted.

    A second failure can use a canonical pointing to /journal/rain-gauge and a served article that keeps its slash. If the earlier no-slash address returns a redirect, this case points the canonical at an address a visitor will immediately leave. If both URLs return 200, the same strings conceal a different issue: the site may expose two copies. Record the result of a request to both addresses before classifying it. In each case, the string difference earns a check. The actual response determines whether you are fixing a stale helper or deciding how duplicates should behave.

    Three levels of identity in an illustrative graph
    Read this fieldExample valueMeaning
    Canonical link/journal/rain-gauge/Preferred page address
    WebPage url/journal/rain-gauge/Page address described by the graph
    Article @id/journal/rain-gauge/#articleIdentifier for the Article node
    When the canonical includes a slash and the stale page URL lacks it, use the shared route helper.
    When the canonical includes a slash and the stale page URL lacks it, use the shared route helper.

    Sources: Google Search Central · Schema.org

    Handle the cases that look like mismatches

    Query strings can change the comparison without changing the article. Open the clean address first. Then test a tracking variant you have verified belongs to the same content. A page may intentionally name its clean URL as the canonical on both responses. Now compare the linked page identity with that intended preferred URL. Do not automatically remove all query keys in a test helper, since some sites use a query key to distinguish a real resource. Document why the variant is a duplicate and use the canonical choice that the site already makes for it.

    Proxies and alternate hosts can generate a surprisingly neat-looking failure. For example, a page's canonical might point to the public host while all Article references use a preview hostname. Check where the value came from. A runtime may be using the current request host for schema while the template uses a configured public site origin. A stale exporter may also have written a preview URL into the stored article. Use the same worksheet on the real public URL and report the exact difference. Keep configuration and stored content fixes separate if they require different owners to review the change.

    Watch how a locale or nested directory is resolved. A bare relative href such as ../rain-gauge/ depends on the delivered URL and the relevant document base. If your site uses a base element, capture it and resolve the link as the document does. This can explain a mismatch that survives a text search in which both fields contain the same slug. Include the whole path in the comparison, including locale and directory. A similarly named English and German page can have matching headlines and distinct intended URLs.

    Sources: Google Search Central · Schema.org

    Fix the template input that differs

    List the owner of each value before editing. The route typically comes from the content system or router. A canonical may come from the shared layout, while a page identity in structured data may come from a separate schema helper. For each of the three values, record the actual input field and any transformation that adds the host, locale or slash. Compare one affected article with another article that renders correctly. This identifies whether the issue is a single stale content record or a branch of the template that treats an entire category differently.

    Where the page should be self-canonical, give the layout and the schema helper the same reviewed public route value. Preserve the existing published path and author and keep the Article identifier stable unless you are repairing that identifier itself. Fix the page reference instead of doing a blind search-and-replace for every URL in the graph. Publisher pages, image URLs, organization IDs and breadcrumbs describe separate things. Replacing all host or route strings can fix one field while damaging the rest of the graph. Use the good and bad fixture values to test the one behavior you intend to change.

    If fixing a deployed redirect is genuinely part of the change, write down the destination first and test direct access to it. Follow the old link in a fresh request and check that it reaches the intended article without an intermediary or an unrelated record. Keep the published contents and indexable metadata only on the preferred route where site policy expects them. Name the template or deploy component that owns this decision so future migrations have a clear place to check. Capture the corrected URL in the worksheet before proceeding to the remaining checks.

    Sources: Google Search Central · Schema.org

    When the graph names the correct page but the byline date differs, use the UTC midnight byline check to compare the publication instant before editing the template.

    Verify the output you actually shipped

    Take a fresh public response after deployment and reproduce the comparison for the exact same starting URL. For a self-canonical article, verify that the final response is indexable as intended, that the URL is in the site sitemap, and that the visible headline matches the Article entity in markup. Check the canonical in the head, resolve the mainEntityOfPage reference and repeat the independent structured-data validation. Syntax and reference alignment are separate checks. A clean syntax result cannot tell you that a valid WebPage url describes the wrong edition.

    Keep the reading steps explicit in the ticket. Someone should be able to rerun them with the exact public link, a captured final address, the canonical and the graph's WebPage URL. Attach the expected pass and fail fixture values when the change touched a shared template. Recheck another normal article with the same structure, and an alternate host or trailing-slash variant only when your site supports one. Inspect the resulting links as well: a stale sitemap or an internal link to the old route can present a different inconsistency even after the schema has been repaired.

    An issue can be closed when the delivered page shows the expected values and the related site-owned routing agrees. The result demonstrates the publisher-controlled signals at the time you tested them. If you're investigating search behavior separately, use the provider's inspection report for its current selected canonical and recrawl state. Save that observation with a date. A clean local fixture provides proof about markup and navigation, while search inspection answers a different question about what an engine has processed.

    Before you finish

    • Open the final public URL after redirects.
    • Confirm there is one intended canonical link.
    • Resolve mainEntityOfPage to the relevant node.
    • Verify the page URL and preserve its preferred path.
    Printed comparison sheets with tabs marking corresponding rows.
    Review the canonical and the graph's page reference side by side after resolving any internal references.

    Inspect the public page after deploying the canonical fix. Check the delivered page markup.

    Sources: Google Search Central · Schema.org

    Keep a recheckable record

    Copy the addresses into a small table rather than pasting an entire HTML file into a ticket. Include one row each for the requested address, the final address, the literal canonical href, the resolved canonical, the Article identifier, the page reference, and the referenced WebPage URL. A missing field should be recorded as missing. Use the comparison column to distinguish a missing reference, a planned duplicate, and a wrong path. Keep an evidence link to the public page and the date the result was observed.

    For the next template change, save one ordinary article as a known good example and retain a deliberately failing fixture in the site's tests. A passing example should resolve the WebPage reference even when the Article uses a fragment. A failing example should keep the graph parseable and name the wrong page, so a validator cannot pass just because the JSON loads. Testing both cases gives you a useful signal before rendering the rest of a large article archive. For a shared routing utility, keep a case for any slash or locale conventions the site already uses.

    Close the loop by assigning a person to recheck the failed evidence after the next template release. The record should identify which settings owned the public route and which rendered fields depended on it. If you only know the page returned 200 last Tuesday, say exactly that. If you also retained its embedded graph and verified the page reference, say so. Being precise about which part you checked makes the issue easier to transfer between the developer who owns routing and the editor who owns the article.

    Sources: Google Search Central · Schema.org

    Compare a second URL before promoting the fix

    Pick a second case that passes today and differs in a meaningful way from the affected article. If the first uses an archive path and a redirect, use a normal current article that has never changed paths. Open it directly and walk the declarations again. Record which fields are expected to remain distinct, which should name the current page, and what relationships should still point to the site or organization. Verify the article's image path in the same response so a change that accidentally rewrites every URL in the graph is easier to catch.

    For a multilingual template, choose one article per version of the layout if both languages use different route-building logic. In the worksheet, put the English and translated URL on separate rows. The headline and author can be identical even though the site intends each translation to keep its own address. Inspect the canonical and linked WebPage within each response. Keep any language relationship separate from the site’s choice of canonical, so the test does not accidentally accept a translation that now points its canonical at a different language edition.

    Decide upfront what must stop a deployment. A preview link in emitted markup or a missing reference on every article using one layout deserves a stop and a template fix. A planned duplicate may need only a note once you confirm the route, canonical and editorial purpose. A validator showing an optional field as missing can prompt a separate content decision. It does not invalidate an otherwise correct page identity. Write these cases into the acceptance criteria so the next person can make the same call.

    Sources: Google Search Central · Schema.org

    Keep deploy preview URLs out of production metadata

    A deployment preview is useful for checking markup and browser layout, but its hostname is usually different from the public one. Before validating the preview, write down the intended production location for the article under review. Use that value for the expected canonical and WebPage URL when your preview is supposed to emit production metadata. Some staging systems are configured to use a staging canonical instead. Record that difference and repeat the check after promotion. The result from a preview describes that build and environment at the time of the test.

    If a schema helper sets URL values from the incoming request, compare the behavior on the intended public hostname and a known preview or alternate host. Identify which host the published layout is allowed to use and confirm that local debugging cannot change the primary URL after promotion. Put this condition in the test that owns the template. An explicit expected location is easier to maintain than a rule which replaces all hostnames or removes all fragments without knowing what they describe.

    Treat the signed-off fixture as a narrow check for page identity. It should verify the resolved canonical, the pointer from the Article and the URL of the named WebPage in the same response. Another check can confirm that the article is in the live sitemap and that the indexable production page displays its expected headline. Keep these results alongside the deployment revision. If you need to rerun the check after a redirect, reuse the original starting address and log any change in the chain before comparing the final response again.

    Sources: Google Search Central · Schema.org

    Frequently asked questions

    Should the Article @id exactly match the canonical?

    An Article node can use an identifier with a fragment. Follow its page reference and check the page URL separate from the node identifier.

    Can valid JSON-LD still point to the wrong page?

    Yes. Parsing can succeed while an old hostname or a different article remains in the content. Compare the delivered HTML with the final URL.

    Which root-relative canonical should I compare?

    Resolve it against the final document URL, then compare complete URLs. For an HTTP result that was redirected, inspect the final document head.

    What if two canonical links disagree?

    Trace each declaration back to its source. Fix the template or plugin so the delivered document expresses one intended page identity.

    CheckMySchemaCheckMySchema

    See a complete Article JSON-LD example

    Check one public canonical route and resolve the Article page reference against it.

    See a complete Article JSON-LD example

    Continue with these guides

    References