# Check title, description and canonical after rendering

- Check 08.08 · JavaScript and HTML rendering · Critical
- Source: https://checklist-seo-geo.com/en/javascript-html-rendering/check-title-description-canonical-after-rendering
- Check that title, meta description, canonical and meta robots are unique, in the head of the initial HTML and unchanged after JavaScript, on any CMS or framework.
- Updated on 2026-11-25
- Licence: CC BY 4.0. Credit “Checklist SEO & GEO” with a link to https://checklist-seo-geo.com/en/javascript-html-rendering/check-title-description-canonical-after-rendering.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## In short

Every crawler reads the title, meta description, canonical and meta robots in the page's `<head>`. When JavaScript adds, changes or duplicates them, each reader may see a different version: Google after rendering, AI crawlers and social networks before. This check consists of comparing these tags in the initial HTML and in the rendered DOM, template by template, and fixing the templates so that they are produced on the server. Expected result: a single tag of each type, in the `<head>` of the initial HTML, with the same value after rendering.

## Why it matters

What Google's documentation says:

- **Title and description**: JavaScript can set or change them, and Google reads them after rendering.
- **Canonical**: Google does not recommend injecting it with JavaScript. If you do, it must be the only one on the page; multiple or conflicting canonicals can lead to unexpected results. Google also only accepts the canonical in the `<head>`.
- **Robots**: when Google encounters a `noindex`, it may skip rendering and JavaScript execution. A script that removes the `noindex` may therefore never run.

The other readers do not render. Generative engine crawlers, according to published observations, and social network preview bots read the initial HTML: a title set by JavaScript escapes them, and a page whose initial HTML carries the application's generic title is seen under that title by all of them.

Frameworks add a recent trap. Since version 15.2, Next.js can stream the metadata computed by `generateMetadata`: it is then appended at the end of the `<body>` instead of the `<head>`, except for a list of bots that receive a complete `<head>`. This default list includes Bingbot, Applebot and the preview bots of Facebook, LinkedIn or Slack, but not the crawlers of OpenAI, Anthropic or Perplexity.

## What it improves

- **Consistent signals**: Google, Bing, generative engines and social networks read the same canonical and the same title.
- **Duplicate consolidation**: a stable, unique canonical is taken into account as a hint. See [Compare declared and Google-selected canonicals](https://checklist-seo-geo.com/en/indexing-canonicalization/compare-declared-google-selected-canonicals).
- **Snippets and previews**: correct title and description in search results, in AI answers that display sources and in shares.
- **Preventing deindexing**: no more initial `noindex` that JavaScript was supposed to remove.
- **Rankings**: indirect effect, through indexing and canonicalization that match your choices.

## How to check

**1. In the initial HTML**, count and read the tags:

```bash
URL="https://example.com/produits/chaise-oslo"
curl -s -L "$URL" -o initial.html
grep -o -i -E "<title[^>]*>[^<]*</title>" initial.html
grep -o -i -E "<meta[^>]+name=\"(description|robots|googlebot)\"[^>]*>" initial.html
grep -o -i -E "<link[^>]+rel=\"canonical\"[^>]*>" initial.html
```

Also check that they are in the `<head>`:

```bash
sed -n '/<\/head>/,$p' initial.html | grep -c -i -E "rel=\"canonical\"|<title|name=\"description\""
```

A result other than `0` points to tags placed in the `<body>`.

**2. In the rendered DOM**, open the browser console on the same page, in a private window:

```js
({
  title: document.title,
  titles: document.querySelectorAll('head title').length,
  descriptions: [...document.querySelectorAll('meta[name="description"]')].map((m) => m.content),
  canonicals: [...document.querySelectorAll('link[rel="canonical"]')].map((l) => l.href),
  robots: [...document.querySelectorAll('meta[name="robots"], meta[name="googlebot"]')].map((m) => m.content),
  horsHead: document.querySelectorAll('body link[rel="canonical"], body meta[name="description"]').length,
})
```

Expected result: a single title, a single description, a single canonical identical to the one in the initial HTML, no `noindex` directive on a page meant to be indexed, `horsHead` at `0`.

**3. For Google**, [URL Inspection](https://search.google.com/search-console?action=inspect) shows the “User-declared canonical” and, in the HTML of the live test, the tags after rendering. See [Test rendering in Search Console](https://checklist-seo-geo.com/en/javascript-html-rendering/test-rendering-search-console).

**4. Across the whole site**, Screaming Frog in JavaScript rendering mode offers filters in the “JavaScript” tab such as “Page Title Updated by JavaScript” and “Canonical Mismatch”. To compare two complete files, use the script from [Compare initial HTML and rendered DOM](https://checklist-seo-geo.com/en/javascript-html-rendering/compare-initial-html-rendered-dom).

## How to implement

### Before you start

The rules apply to every environment:

| Tag | Rule |
| --- | --- |
| `<title>` | only one, in the `<head>` of the initial HTML, specific to the page |
| `<meta name="description">` | only one, in the initial HTML |
| `<link rel="canonical">` | only one, absolute URL, in the `<head>` of the initial HTML, never changed by JavaScript |
| `<meta name="robots">` | absent or without `noindex` in the initial HTML of a page meant to be indexed; never a `noindex` added then removed by a script |

In a single-page application, client-side navigation must also update the title, description and canonical on every route change, with the same values the server would return for that URL.

Writing them is covered by other guides: [Write a unique title for each important page](https://checklist-seo-geo.com/en/page-seo-metadata/write-unique-title-each-important-page) and [Use self-referencing canonicals where relevant](https://checklist-seo-geo.com/en/indexing-canonicalization/use-self-referencing-canonicals-where-relevant).

### WordPress

Versions: WordPress 6.4 and later (checked up to 7.1), Yoast SEO and Rank Math in their November 2026 versions.

WordPress produces these tags in PHP, on the server. Problems come from duplicates:

- the theme must declare `add_theme_support( 'title-tag' );` and must not hard-code a `<title>` in `header.php`;
- only one active SEO plugin (Yoast SEO, Rank Math…) should produce the description and the canonical; two plugins produce two sets of tags;
- a translation plugin, a pagination plugin or a page builder can add its own canonical: count them with the `grep` command from the previous section.

For “headless” WordPress, fetch the plugin's SEO fields through the API and render them on the server in the front-end framework (Next.js or Nuxt sections).

### Shopify

Versions: Shopify, all plans, Online Store 2.0 themes, November 2026.

The `<head>` must contain these tags rendered in Liquid, either directly in `layout/theme.liquid` (Dawn) or in the snippet that this file includes (`snippets/meta-tags.liquid` in Horizon):

```liquid
<title>
  {{ page_title }}
  {%- if current_tags %} – {{ current_tags | join: ', ' }}{% endif -%}
  {%- if current_page != 1 %} – Page {{ current_page }}{% endif -%}
  {%- unless page_title contains shop.name %} – {{ shop.name }}{% endunless -%}
</title>
{% if page_description %}
  <meta name="description" content="{{ page_description | escape }}">
{% endif %}
<link rel="canonical" href="{{ canonical_url }}">
```

Recent themes already include them. Check that no SEO or translation app adds a second version through a script: compare the initial HTML and the rendered DOM.

### Wix

Versions: Wix Editor and Wix Studio, all plans, Velo `wix-seo-frontend` API, November 2026.

Title, description and canonical are set in each page's SEO settings, and in dynamic pages for collections; Wix places them in the server-rendered HTML. With Velo code, the SEO API (`wix-seo-frontend`) lets you set them, and Wix's documentation asks you to do so in `$w.onReady()` so that search engines read them. A value set later, after an interaction, is not in the served page.

### Laravel

Versions: Laravel 11 to 13; Inertia 2 and 3.

With Blade, the layout produces the tags from sections defined by each view:

```blade
{{-- resources/views/layouts/app.blade.php --}}
<head>
    <meta charset="utf-8">
    <title>@yield('title', config('app.name'))</title>
    <meta name="description" content="@yield('description')">
    <link rel="canonical" href="@yield('canonical', url()->current())">
</head>
```

```blade
{{-- resources/views/produits/show.blade.php --}}
@extends('layouts.app')

@section('title', "{$produit->nom} – Oak furniture")
@section('description', $produit->resume)
@section('canonical', route('produits.show', $produit))
```

`url()->current()` returns the URL without the query string, which works as a default canonical; set it explicitly for paginated or filtered pages.

With Inertia, the `<Head>` component manages the title and meta tags on the client; give the description a `head-key` to avoid duplicates between the layout and the page. These tags only appear in the initial HTML if Inertia's server-side rendering is on: without it, the root Blade view only provides default values.

```vue
<Head>
  <title>{{ produit.nom }} – Oak furniture</title>
  <meta head-key="description" name="description" :content="produit.resume" />
  <link head-key="canonical" rel="canonical" :href="produit.url" />
</Head>
```

### Next.js

Versions: Next.js 15 and 16, App Router and Pages Router; streaming metadata and `htmlLimitedBots` since Next.js 15.2.

In both routers, never set these tags through `document.title` or in a `useEffect`.

#### App Router

Declare the metadata in `layout.tsx` or `page.tsx`:

```tsx
// app/layout.tsx
import type { Metadata } from 'next';

export const metadata: Metadata = {
  metadataBase: new URL('https://example.com'),
  title: { default: 'Oak furniture', template: '%s – Oak furniture' },
};
```

```tsx
// app/produits/[slug]/page.tsx
import type { Metadata } from 'next';

export async function generateMetadata(
  { params }: { params: Promise<{ slug: string }> }
): Promise<Metadata> {
  const { slug } = await params;
  const produit = await fetch(`https://api.example.com/produits/${slug}`).then((r) => r.json());

  return {
    title: produit.nom,
    description: produit.resume,
    alternates: { canonical: `/produits/${slug}` },
  };
}
```

`metadataBase` turns the relative canonical into an absolute URL. `metadata` and `generateMetadata` only work in server components.

**Streaming metadata.** If the page is rendered on demand, Next.js can send the tags from `generateMetadata` at the end of the `<body>`, except to the bots in its `htmlLimitedBots` list. For generative engine crawlers to receive a complete `<head>`, extend this list. The value replaces the default list: copy that list as it appears in the Next.js source code for your version, and add the AI crawlers:

```js
// next.config.js
module.exports = {
  htmlLimitedBots: /[\w-]-Google|Google-[\w-]|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight|GPTBot|OAI-SearchBot|ChatGPT-User|ClaudeBot|Claude-SearchBot|Claude-User|PerplexityBot|Perplexity-User/i,
};
```

To turn off metadata streaming entirely, the documentation gives `htmlLimitedBots: /.*/`, at the cost of a longer TTFB. Check the result with curl by sending an AI crawler's user agent.

#### Pages Router

Put the tags in `next/head`, in a page rendered by `getStaticProps` or `getServerSideProps`: they appear in the `<head>` of the initial HTML, without streaming.

```tsx
// pages/produits/[slug].tsx
import Head from 'next/head';

export default function Page({ produit }: { produit: { nom: string; resume: string; slug: string } }) {
  return (
    <>
      <Head>
        <title>{`${produit.nom} – Oak furniture`}</title>
        <meta name="description" content={produit.resume} key="description" />
        <link rel="canonical" href={`https://example.com/produits/${produit.slug}`} key="canonical" />
      </Head>
      <h1>{produit.nom}</h1>
    </>
  );
}
```

The `key` attribute prevents duplicates when `_app.tsx` also declares a description or a canonical.

### Nuxt

Versions: Nuxt 3.x and 4.

`useSeoMeta` and `useHead` run during server-side rendering: the tags are in the initial HTML.

```vue
<script setup lang="ts">
const route = useRoute()
const { data: produit } = await useFetch(`/api/produits/${route.params.slug}`)

useSeoMeta({
  title: () => produit.value?.nom,
  description: () => produit.value?.resume,
  ogTitle: () => produit.value?.nom,
})

useHead({
  link: [{ rel: 'canonical', href: `https://example.com/produits/${route.params.slug}` }],
})
</script>
```

With `ssr: false`, these tags are only set in the browser.

### Astro

Versions: Astro 5 to 7.

Write the tags in the layout, from the page's props, and set `site` in `astro.config.mjs` to build absolute URLs:

```astro
---
// src/layouts/Base.astro
const { title, description } = Astro.props;
const canonical = new URL(Astro.url.pathname, Astro.site);
---
<head>
  <meta charset="utf-8" />
  <title>{title}</title>
  <meta name="description" content={description} />
  <link rel="canonical" href={canonical} />
</head>
```

### React, Vue and Angular

- **React 19**: the `<title>`, `<meta>` and `<link>` components can be rendered anywhere, and React places them in the `<head>`. They only appear in the initial HTML with server-side rendering or pre-rendering; in pure client-side rendering, they are set by JavaScript.
- **Vue**: without Nuxt, `<head>` management (for example with Unhead) only reaches the initial HTML with server-side rendering.
- **Angular**: the `Title` and `Meta` services from `@angular/platform-browser` also work during server-side rendering. Add the canonical through the injected document, then turn on SSR or pre-rendering for public routes:

```ts
import { Injectable, inject } from '@angular/core';
import { DOCUMENT } from '@angular/common';
import { Meta, Title } from '@angular/platform-browser';

@Injectable({ providedIn: 'root' })
export class SeoService {
  private readonly title = inject(Title);
  private readonly meta = inject(Meta);
  private readonly document = inject(DOCUMENT);

  update(titre: string, description: string, url: string): void {
    this.title.setTitle(titre);
    this.meta.updateTag({ name: 'description', content: description });

    let canonical = this.document.querySelector<HTMLLinkElement>('link[rel="canonical"]');

    if (!canonical) {
      canonical = this.document.createElement('link');
      canonical.setAttribute('rel', 'canonical');
      this.document.head.appendChild(canonical);
    }

    canonical.setAttribute('href', url);
  }
}
```

Without server-side rendering, see [Prefer SSR or SSG for critical content](https://checklist-seo-geo.com/en/javascript-html-rendering/prefer-ssr-ssg-critical-content-if-relevant).

## Common mistakes

- **Generic title in the initial HTML**: the application sends “My App” on every URL and replaces it with JavaScript. AI crawlers and share previews keep the generic one.
- **Two canonicals**: the theme's and a plugin's, or the server's and one added by a script. Conflicting signals leave the choice to Google.
- **Canonical rewritten by JavaScript**: Google advises against it, and other readers only see the initial version.
- **`noindex` set by default then removed by a script**: Google may never run the script and leave the page out of the index.
- **Tags in the `<body>`**: Google does not accept a canonical outside the `<head>`. Watch out for metadata streamed by frameworks.
- **Relative canonical or canonical pointing to a staging URL**: use an absolute URL, built from configuration specific to each environment.
- **Metadata not updated during client-side navigation**: analytics and shares made from within the application record the previous page's title.

## Frequently asked questions

### Does Google take into account a title changed by JavaScript?

Yes, Google states that JavaScript can set or change the title and the meta description, and it reads them after the page has been rendered. Generative engine crawlers and social network bots, on the other hand, read the initial HTML without running scripts. For everyone to see the same title, produce it on the server in the head and do not change it afterwards.

### Can the canonical be added with JavaScript?

Google does not recommend it. It is possible, provided the injected canonical is the only one on the page and does not contradict a canonical in the initial HTML; multiple or conflicting tags can lead to unexpected results. Crawlers that do not run JavaScript do not see it. Put the canonical in the head of the server template, with an absolute URL.

### Why doesn't a noindex removed by JavaScript work?

When Google finds a noindex in the initial HTML, it may skip rendering and never run the script that was meant to remove it: the page stays excluded from the index. Google therefore asks you not to put a noindex in the original code of a page you want indexed. Decide on indexing on the server, in the HTML or in the X-Robots-Tag header.

### Does Next.js put metadata in the body?

Yes, since version 15.2, Next.js can stream the metadata from generateMetadata and append it to the body for pages rendered on demand. The bots in the htmlLimitedBots list, including Bingbot and social preview bots, receive a complete head. The crawlers of OpenAI, Anthropic and Perplexity are not in it by default: add them to this option in next.config.js.

## Resources

- [Google Search Central: Understand the JavaScript SEO basics](https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics)
- [Google Search Central: How to specify a canonical URL](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls)
- [Next.js: generateMetadata and streaming metadata](https://nextjs.org/docs/app/api-reference/functions/generate-metadata)
- [Next.js: htmlLimitedBots option](https://nextjs.org/docs/app/api-reference/config/next-config-js/htmlLimitedBots)
- [Nuxt: useSeoMeta](https://nuxt.com/docs/4.x/api/composables/use-seo-meta)
- [Inertia: Title and meta](https://inertiajs.com/title-and-meta)
- [Shopify: canonical_url object](https://shopify.dev/docs/api/liquid/objects/canonical_url)
- [React: title component](https://react.dev/reference/react-dom/components/title)

Next steps: [Check rendered structured data](https://checklist-seo-geo.com/en/javascript-html-rendering/check-rendered-structured-data), [Check meta robots and X-Robots-Tag](https://checklist-seo-geo.com/en/indexing-canonicalization/check-meta-robots-x-robots-tag) and [Check metadata parity](https://checklist-seo-geo.com/en/mobile-first-responsive-design/check-metadata-parity).
