# Critical metadata only in client-side JavaScript (useEffect, onMount or onMounted)

> Critical SEO metadata, page title, meta description, og:image, or canonical URL, is being set inside a useEffect hook (React), onMount (Svelte) or...

Source: https://seocode.io/checks/geo-ssr-hydration

[All checks](https://seocode.io/checks) / AI search (GEO)

A critical-level ai search (geo) check, run on every pull request and every CLI run.

Critical `geo-ssr-hydration`

In SEOCode's checks since 13 Sep 2026

- [Add to GitHub](https://github.com/apps/seocode-pr-check/installations/new)

- [Read the docs](https://seocode.io/docs)

## Why this matters.

Critical SEO metadata, page title, meta description, og:image, or canonical URL, is being set inside a useEffect hook (React), onMount (Svelte) or onMounted (Vue), or inside Nuxt's `<ClientOnly>`, meaning it only exists after JavaScript executes on the client. AI crawlers (and Googlebot's first pass) process the server-rendered HTML before executing JavaScript. Metadata that only appears post-hydration is invisible to these crawlers, resulting in missing or incorrect data in AI-generated summaries and search previews. This is a silent failure, the page renders correctly for human visitors but the metadata AI engines need for citation is never seen.

Runs on `.jsx` `.tsx` `.svelte` `.vue` · Critical checks fail the pull request status, so the change cannot merge until it is fixed.

## How to resolve it.

Move critical metadata out of useEffect and into server-rendered output. In `Next.js` App Router, use the Metadata API (export const metadata = { title: '...', description: '...' } or export async function generateMetadata()). In `Next.js` Pages Router, use next/head at the top level of the component, not inside useEffect. In Remix, use the meta() export. In SvelteKit, put the tags in <`svelte`:head> in +`page.svelte` or +`layout.svelte`, not in onMount. In Nuxt, call useHead() or useSeoMeta() at the top of `<script setup>`, not in onMounted or inside `<ClientOnly>`. In Astro, set metadata in the Astro component frontmatter inside `<head>`. Never set document.title or append `<meta>` tags inside useEffect or onMount for content that search engines or AI crawlers need to read.

**SEOCode writes this fix for you**

On a pull request the fix arrives as a suggestion you can commit in one click, when the change is unambiguous on the line.

## Where this comes from.

- [01 · Metadatanextjs.org](https://nextjs.org/docs/app/building-your-application/optimizing/metadata)

- [02 · Javascript Seo Basicsdevelopers.google.com](https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics)

- [03 · Ai Optimization Guidedevelopers.google.com](https://developers.google.com/search/docs/fundamentals/ai-optimization-guide)

- [04 · Seosvelte.dev](https://svelte.dev/docs/kit/seo)

- [05 · Seo Metanuxt.com](https://nuxt.com/docs/getting-started/seo-meta)

Using a framework? [Next.js](https://seocode.io/nextjs-seo) · [SvelteKit](https://seocode.io/sveltekit-seo) · [Nuxt](https://seocode.io/nuxt-seo)

## Related checks.

What decides whether ChatGPT, Perplexity and AI Overviews can read and cite a page.

- [01 · robots.txt blocks AI search crawlers Critical robots.txt is blocking one or more AI crawlers: GPTBot (OpenAI's training crawler), PerplexityBot (Perplexity), ClaudeBot (Anthropic) or Google-Extended (Google Gemini; AI Overviews use Googlebot).](https://seocode.io/checks/geo-robots-ai-agents)

- [02 · JSON-LD entity missing @id anchor (flat graph) Critical An Organization, Person, Product, Place, or LocalBusiness entity in JSON-LD is missing an @id property.](https://seocode.io/checks/schema-nested-graph)

- [03 · Organization or Person schema missing sameAs links Warning An Organization or Person entity in JSON-LD is missing a sameAs array linking to authoritative external sources.](https://seocode.io/checks/schema-entity-sameas)

- [04 · FAQPage schema present but no matching Q&A HTML structure Warning The page includes FAQPage JSON-LD schema markup but has no visible Q&A structure in the HTML, no question-like headings (h2/h3 ending in '?') and no accordion or FAQ component class names.](https://seocode.io/checks/schema-faqpage-completeness)

- [05 · Heading section opens with narrative preamble (not BLUF) Info A major heading section (h2 or h3) opens with narrative preamble rather than a direct answer.](https://seocode.io/checks/geo-bluf-structure)

- [06 · Heading content not wrapped in semantic container element Info The page has h2 or h3 headings but no content is wrapped in semantic HTML container elements, <article>, <section>, or <aside>.](https://seocode.io/checks/geo-passage-containment)

[All 10 ai search (geo) checks](https://seocode.io/checks#geo)

## Where we wrote about this.

- [New in SEOCode: GEO Rule Suite](https://seocode.io/news/seocode-geo-rule-suite)

## Every check, on every pull request.

SEOCode runs the full ruleset on each change and comments the fixes inline.

- [Add to GitHub](https://github.com/apps/seocode-pr-check/installations/new)

- [Get a website audit](https://seocode.io/audit?from=checks-cta)

Free for public repositories · no credit card
