Learn · Technical SEO · Beginner

How to check the title and canonical of a script-built page

Learn to compare what a page’s raw HTML says with what it says once scripts have run, and to see in Search Console what Google received.

Published
Last reviewed
Time
30 minutes to do

Raw HTML and rendered HTML, explained

Some websites send the browser an almost empty page and use JavaScript to fill in the content afterwards. This is called client-side rendering. The title of the page, its canonical link and its content may all be added by that script.

Google can run JavaScript, but it does so in a separate step after it first fetches the page. This guide shows you how to compare the raw HTML (what the server sends) with the rendered HTML (what exists once scripts have run), and how to see in Search Console what Google received.

Why Google’s view of a script-built page matters

Google says unique, descriptive titles help people choose the best result, and that it builds the title link in search results from several sources, including the title element and the main heading. It also says pages are queued for rendering after they are crawled, and that the wait can be longer than a few seconds. For a page that cannot be found, Google says the server should return a 404 status, and it warns that error pages answering 200 can be indexed. See influencing title links and JavaScript SEO basics.

What you need to check a script-built page’s title

  • A web browser such as Chrome, Edge or Firefox
  • Access to Google Search Console with the site added as a property
  • Three or four pages of different types, for example the home page, an article or product page and a list page
  • An address on your site that does not exist, made up for the missing-page check

Check a script-built page’s title, step by step

  1. 1

    Choose your sample pages

    Pick three or four pages of different types and write down each full address, including https://.

    You will know it worked when You have a list of full addresses covering different kinds of page.

  2. 2

    Read the raw HTML

    Open a page, right-click and choose View page source. Search (Ctrl+F) for <title> and for canonical. This shows the code before scripts ran. A page may have no canonical link, which is allowed.

    You will know it worked when For each page you have noted the title in the source and the canonical address, or that there is none.

  3. 3

    Compare it with the finished page

    Look at the title shown in the browser tab once the page has loaded. That is the title after scripts have run. Compare it with the title you found in the source.

    You will know it worked when For each page you know whether the source title and the tab title are the same.

  4. 4

    Compare the titles between pages

    Look at the source titles of your sample pages side by side. Google asks for distinct text that describes the content of each page, and warns against repeated or boilerplate titles. See the title link guidance.

    You will know it worked when Each sample page has its own title in the source. If they are all the same, note it as a fault.

  5. 5

    Inspect the page in Search Console

    Paste the full address into the inspection bar at the top of Search Console. Open View crawled page to see the HTTP response and the HTML Google received. Under Page indexing, read the Google-selected canonical. Google says that field comes only from the indexed data; the live test cannot predict it. See the URL Inspection help.

    You will know it worked when You have seen what Google fetched for the page and which canonical it chose, or that it has not been indexed yet.

  6. 6

    Test an address that does not exist

    Type your made-up address into the browser. If the site shows a not-found message, open the browser’s developer tools, choose the Network tab, reload, and note the status of the first request. Google says a missing page should return 404, not 200. See the status code guidance.

    You will know it worked when You know whether the missing page returns 404, or 200 with a not-found message, which is a soft 404.

Common mistakes when you check a script-built page

  • Checking only the browser tab. It shows the title after scripts have run, not what the server sent.
  • Expecting the live test in URL Inspection to show which canonical Google will choose. Google says the canonical can be found only in the indexed data.
  • Using a script to change the canonical to a different address from the one in the HTML. Google says not to.
  • Leaving more than one canonical tag on a page. Google says conflicting or multiple tags may lead to unexpected results.

Terms used when you check a script-built page

Raw HTML
The page code exactly as the server sends it, before any scripts run.
Rendered HTML
The page code after a browser-like process has run the JavaScript.
Soft 404
A page that tells visitors it does not exist but does not return a proper 404 status.
Title link
The title of a result in Google Search that links to the page. Google builds it from the page’s title element and other sources.

Sources for checking a script-built page’s title

Source and finished page showing different titles?

Tell Dean which pages differ and what the raw HTML and the finished page each say. A reply from Dean is how it starts, not a sales sequence.