# seo Wires `@payloadcms/plugin-seo` (meta fields in collections) and adds a logic layer: title composition, Next.js `Metadata` with canonical and hreflang, auto-fill of empty meta from the document content. ## Dependency Add to `dependencies` (pinned to the payload version): ```json "dependencies": { "@payloadcms/plugin-seo": "3.84.1" } ``` After wiring, run `pnpm payload generate:importmap` — the SEO fields are admin components and do not render without the importMap. ## Config (payload.config.ts) ```ts ipalKit({ seo: { collections: ['pages', 'posts'], // which collections get meta // generateTitle: ({ doc }) => `${doc.title}`, // optional // generateDescription: ({ doc }) => doc.excerpt ?? '', // fields: [...], // extra fields in the SEO group // autoFill: { title: 'title', description: 'excerpt' }, // auto-fill mapping // autoFill: { content: 'blocks', descriptionLength: 155 }, // description from another blocks field // autoFill: false, // turn off auto-fill // descriptionCheck: { settingsSlug: 'site-settings', siteDescriptionField: 'siteDescription' }, // descriptionCheck: false, // no hint under the description // uploadsCollection: 'images', // meta image upload collection (default 'media') }, }) ``` Adds an **SEO** tab to the listed collections: title, description, image, titleOverride. Auto-fill: a `beforeChange` hook fills an empty `meta.title` from a document field (default `title`), and an empty `meta.description` from the `autoFill.description` field (if given), otherwise from the page content (`layout` blocks → the first paragraphs without headings, whole sentences up to ~155 characters). It never overwrites what the editor typed by hand; on a partial save (REST PATCH, `payload.update` with a few fields) it reads the stored description from the document. A script that must save exactly what it sets (data migration, filling fields on production): `payload.update({ …, context: { [SKIP_AUTO_FILL]: true } })` — `SKIP_AUTO_FILL` (`'ipalSkipAutoFill'`) from `@intecion/ipal-kit` turns off meta and `aiSummary` auto-fill for that save (1.12.2). Under the description field in the SEO tab there is a hint (`MetaDescriptionCheck`, `/admin`): the description is empty, the same as `siteDescription` from Site Settings, or the same as in another document of the collection. It only informs — it does not block saving. Length is shown by the plugin-seo counter. The tab is built by `injectSeoTabs`, not by plugin-seo's `tabbedUI` — that one merges tabs by looking at the collection's first field and breaks when there are other fields there already (slug, roles), leaving an empty SEO tab. ## Titles — configured from the panel No code, per site (Site Settings → General): - **Title Order** — `Page first` (O nas | Acme) or `Site first` (Acme | O nas) - **Title Separator** — `|` `–` `-` `·` `/` Per page (SEO tab): - **Title Override** — the typed text goes to the browser tab verbatim, ignoring both settings above. Use it for the home page, where composition would give "Acme | Acme". Default: `Title | Site name`. ### Where the "Title" comes from (source priority) The page title (the part before the site name) comes from, in order: 1. **titleOverride** — if filled, it is the whole title (no composition). 2. **meta.title** — the SEO title typed in the SEO tab. 3. **page.title** — the document name (e.g. "Sprzątanie biur"), when meta.title is empty. Point 3 (fallback to the page name) works in two complementary ways: - **buildAutoFillMetaHook** (on SAVE) — fills an empty `meta.title` from the document field (`title`). If wired into the collections, meta.title is never empty. - **pageTitle in buildMetadata** (on RENDER) — if meta.title is still empty (e.g. auto-fill not wired), it uses `page.title`. A second line of defence. Result: a page without an SEO title still shows its name in the browser tab, not an empty title or just the siteName. > **Note — "Strona Główna" in the title:** if the home page document is named > "Strona Główna" (and auto-fill copied it to meta.title), the title comes out as > "Name – Strona Główna" — useless for SEO. Fix: set **titleOverride** > for the home page (e.g. "Firma X – Usługa Miasto"), or change meta.title to > something with keywords. The page.title fallback does not help, because the problem is > the name itself, not a missing title. ## Front — generatePageMetadata (recommended) From `createContentHelpers` (lib/content) — it shares the request cache with the layout and the page component: **one** SiteSettings read and **one** `resolveRoute` per request, instead of separate queries in metadata and in the page: ```ts // app/(frontend)/[locale]/[[...slug]]/page.tsx import { generatePageMetadata } from '@/lib/content' export async function generateMetadata({ params }): Promise { const { locale, slug } = await params return generatePageMetadata(locale, slug) // paginated archive: (locale, slug, page) } ``` Requires `i18n` in `createContentHelpers`. Under the hood it is `createPageMetadata` with injected cached loaders — everything below applies to it too. ## createPageMetadata (low level) When you do not use `createContentHelpers` or the route has its own conventions. It knows the plugin conventions (pages collection, SiteSettings, System Pages, meta group): ```ts // app/(frontend)/[locale]/[[...slug]]/page.tsx import { createPageMetadata } from '@intecion/ipal-kit' import { i18nConfig } from '@/i18n.config' const pageMetadata = createPageMetadata({ config: i18nConfig, baseUrl: process.env.NEXT_PUBLIC_SERVER_URL, // collection: 'pages', // default // settingsSlug: 'site-settings', // default // siteNameField: 'siteName', // default }) export async function generateMetadata({ params }): Promise { const { locale, slug } = await params return pageMetadata({ payload: await getPayload({ config }), locale, slug }) } ``` The wrapper is required: Next calls `generateMetadata({ params })` without payload, and the plugin never calls `getPayload` itself. The `loaders: { getSettings, resolveRoute }` option lets you pass your own cached functions (that is what `generatePageMetadata` does). Handles: title (order/separator/override from the panel), description, canonical, hreflang for all locales, OG, home collapsed to `/pl` (home slug read from System Pages). Without `NEXT_PUBLIC_SERVER_URL`, canonical and hreflang are relative (`/pl` instead of `https://…/pl`). ## Front — createMetadataGenerator For routes outside the conventions: another collection (blog), custom image logic, another global. The project supplies the resolvers. ```ts import { createMetadataGenerator } from '@intecion/ipal-kit' const generate = createMetadataGenerator({ config: i18nConfig, baseUrl: process.env.NEXT_PUBLIC_SERVER_URL, homeSlug: 'homepage', resolveDocument: async ({ payload, params, locale }) => { const slug = (params.slug as string[])?.join('/') // meta MUST come in a specific locale (strings), and slug as a map // locale→value (hreflang) — these are two different reads. const found = await payload.find({ collection: 'posts', where: { slug: { equals: slug } }, locale, depth: 1, limit: 1, }) const doc = found.docs[0] if (!doc) return null const allLocales = await payload.findByID({ collection: 'posts', id: doc.id, locale: 'all', depth: 0, }) return { ...doc, slug: allLocales.slug } }, resolveSiteName: async ({ payload, locale }) => (await getSiteSettings(payload, { locale })).siteName ?? null, resolveImageUrl: async ({ doc }) => doc.meta?.image?.url ?? null, }) export async function generateMetadata({ params }) { const { locale, slug } = await params return generate({ payload: await getPayload({ config }), params: { slug }, locale }) } ``` **Trap:** a single read with `locale: 'all'` looks tempting, but then **every** localized field is a map — `meta.title` too. Title composition gets an object instead of a string and fails with `pageTitle?.trim is not a function`. Next runs `generateMetadata` and the page component independently — without React `cache()` around these reads, every request queries the database twice. ## Front — buildMetadata directly When you want full control: ```ts import { buildMetadata, getLocalizedSlugs } from '@intecion/ipal-kit' return buildMetadata({ meta: doc.meta, // from plugin-seo siteName: settings.siteName, imageUrl: '/og.png', locale: 'pl', slugs: getLocalizedSlugs({ slugField: docAllLocales.slug, config }), config, baseUrl: 'https://example.com', separator: ' – ', // optional order: 'site-first', // optional homeSlug: 'homepage', }) // → { title, description, openGraph, alternates: { canonical, languages } } ``` ## Helpers ```ts import { composeTitle, buildHreflangAlternates } from '@intecion/ipal-kit' composeTitle({ pageTitle: 'O nas', siteName: 'Acme' }) // 'O nas | Acme' composeTitle({ pageTitle: 'O nas', siteName: 'Acme', separator: ' – ', order: 'site-first' }) // 'Acme – O nas' buildHreflangAlternates({ slugs, config, baseUrl }) // { pl: '...', en: '...' } ``` ## Lower-level helpers `createPageMetadata` is made of smaller, testable pieces — exported in case you build your own metadata generator: ```ts import { readSiteMetaConfig, slugsAcrossLocales } from '@intecion/ipal-kit' // site name, separator (padded), order, homeSlug — from SiteSettings const site = await readSiteMetaConfig({ payload, locale }) // the document slug in all locales — a map for hreflang const slugs = await slugsAcrossLocales({ payload, collection: 'pages', id, config }) ``` `slugsAcrossLocales` makes a separate query with `locale: 'all'` — because that mode turns EVERY localized field into a map, which is good for the slug and bad for the rest (a map in title would break title composition). So it reads only the slug, depth 0. ## Sitemap and robots.txt The plugin builds the sitemap with hreflang per URL — the same builders as the metadata, so it cannot drift from what the pages serve. The handlers are ready in `createContentHelpers`; the project re-exports them in one line. ```ts // src/lib/content.ts export const { /* ... */, sitemap, robots } = createContentHelpers({ config, content: contentConfig, i18n: i18nConfig, // required for sitemap (hreflang) baseUrl: process.env.NEXT_PUBLIC_SERVER_URL, }) ``` ```ts // app/sitemap.ts export { sitemap as default } from '@/lib/content' export const dynamic = 'force-dynamic' // generate at runtime, not at build // app/robots.ts export { robots as default } from '@/lib/content' ``` Next generates `/sitemap.xml` and `/robots.txt` from these. This cannot be hidden entirely in the plugin — Next creates these routes only from files in `app/`; it scans the project directory, not node_modules. But a re-export is the minimum: all the logic is in the plugin. > **Container deploy (Coolify, CI builds) — IMPORTANT:** `export const > dynamic = 'force-dynamic'` in `app/sitemap.ts` is REQUIRED. Without it Next > treats the sitemap as static and prerenders it during `next build` — which > calls Payload → the database. The build container usually has no access to the > deployment network, so the database connection fails (`ENOTFOUND`) and the build crashes. With > `force-dynamic` the sitemap is generated at runtime, when the database is available. > (The plugin also catches the database error and returns an empty sitemap instead of crashing the build > — but `force-dynamic` is the right fix, not relying on the fallback.) > Optionally `export const revalidate = 3600` — cache the sitemap for an hour. > Other hosts: the same applies to any host that builds without database access. What the sitemap contains: - every page and blog post, URL in the default locale - `alternates.languages` → Next renders `` per URL (Google reads this for multiple languages; a plain sitemap does not have it) - `lastModified` from the document's real `updatedAt` - blog posts with the archive prefix (`/pl/artykuly/moj-post`) Skips: drafts (`_status !== 'published'`) and documents with `meta.noindex`. When **Site Settings → Under construction** is on — everything except the pages that stay open (home page + "Pages still available"), because the rest redirects to the notice and a crawler would index that instead of the content. `llms.txt` does the same. Large collections (1.13): documents are read in batches of 500 (`SITEMAP_BATCH_SIZE`), only published ones (`where _status` for a collection with drafts) and only the needed fields (`select`: slug, updatedAt, noindex, meta). A custom `sitemapImages` may read any field, so then the whole document is read (`buildSitemapEntries({ select: true })` forces select). Low level (your own route instead of the factory handler): ```ts import { buildSitemapEntries, buildRobots } from '@intecion/ipal-kit' const entries = await buildSitemapEntries({ payload, config: i18nConfig, baseUrl, content: contentConfig, }) ``` ### Large site — sitemap index, cache, errors (1.13) `sitemapRoute` (`createSitemapRouteHandler`) splits the sitemap by itself when there are more URLs than `maxUrls` (default 10 000 — the protocol allows 50 000 / 50 MB, but hreflang turns each URL into several lines): - `/sitemap.xml` → `` with parts `/sitemap.xml?part=1`, `?part=2`…; each part has `lastmod` = the newest `lastmod` of its URLs. - robots.txt and Search Console keep using the single `/sitemap.xml` address. - A non-existent part → 404. | Option | Default | What it does | |---|---|---| | `maxUrls` | `10000` | URLs in one file; above that — index + parts | | `cacheControl` | `public, max-age=0, s-maxage=3600, stale-while-revalidate=86400` | the CDN keeps it for an hour, the browser checks every time; `false` = no header | | `memoSeconds` | `300` | how many seconds the process keeps the built list (the index and parts do not rebuild it); `0` = off | ```ts createContentHelpers({ …, sitemapOptions: { maxUrls: 5000, memoSeconds: 0 } }) // sitemapRoute createSitemapRouteHandler(sitemap, { maxUrls: 5000, memoSeconds: 0 }) // your own route ``` The project has the last word — `sitemapEntries` receives the plugin's entries and returns the list to publish (add your own routes' addresses, remove entries, set `priority`): ```ts createContentHelpers({ …, sitemapEntries: (entries) => [...entries, { url: `${origin}/kalkulator`, lastModified: new Date() }], }) ``` Turn off the "Under construction" filter in the sitemap and llms.txt with `underConstructionSeo: false`. A database error at runtime → **503 + `Retry-After: 300`** (the crawler comes back), not an empty sitemap with 200 ("the site has no pages"). An empty response and an error are never served from cache. Exception: `next build` (`NEXT_PHASE=phase-production-build`) still gets an empty, valid sitemap, so a build without a database does not fail. `sitemap()` from `createContentHelpers` also throws at runtime (it used to return `[]`). `app/sitemap.ts` (MetadataRoute) does not split — for a large site use `sitemapRoute`. Your own route: `buildSitemapIndexXml([{ url, lastModified }], { cssUrl })` builds just the index. ## Favicon in Google + Organization (branding in search) The favicon and structured data affect how the site looks in Google results. The plugin generates both from the panel — the project only wires them into the root layout. ### Favicon — format: PNG, not SVG (important) **For Google use PNG (≥48×48), not SVG.** Verified: Google reliably supports PNG and ICO, but **SVG in Google results is unreliable** — it often shows a globe even though the favicon renders fine in the browser tab. Google's official documentation does not list SVG. If you care about the favicon in search — upload a PNG. - **PNG ≥48×48** (ideally 96 or 192), square → works in Google ✓ - **SVG** → works in the browser, but a globe in Google (unreliable) ✗ - The favicon field validation WARNS when you upload an SVG (so you know search needs a PNG). ### Favicon — why it did not show Google has hard requirements: `` in ``, square, **≥48×48px**, a stable URL. When projects rendered the favicon "their own way", it was often too small, wrongly tagged or missing from head → Google did not show it. The plugin now does it correctly. ### Wiring the favicon (root layout) The favicon is GLOBAL (the same everywhere) — wire it ONCE in the root layout, not per page: ```tsx // app/(frontend)/[locale]/layout.tsx import type { Metadata } from 'next' import { buildIconsMetadata } from '@intecion/ipal-kit' import { getSettings } from '@/lib/content' // from createContentHelpers export async function generateMetadata({ params }): Promise { const { locale } = await params const settings = await getSettings(locale) return buildIconsMetadata(settings.favicon) // from the favicon field (panel) } ``` `buildIconsMetadata` generates correct `icons` (favicon + apple-touch) from the favicon field. SVG → scales; PNG → should be ≥48×48 (validation warns, see below). ### Enforcing the size (validation) The favicon field in SiteSettings has the `validateFaviconField` validation — it warns the editor on save if the favicon is <48×48 or not square. The editor sees a warning instead of silently uploading a favicon Google will not show. ### Organization JSON-LD (branding) Helps Google link the site to the brand (name, logo) — better display in results, logo in the knowledge panel. ```tsx // root layout — ONCE (Organization is global) import { buildOrganizationJsonLd } from '@intecion/ipal-kit' const jsonLd = buildOrganizationJsonLd({ name: settings.siteName, url: process.env.NEXT_PUBLIC_SERVER_URL!, logo: settings.logo, sameAs: settings.socialLinks, // optional: social profiles }) // in the layout JSX — always through JsonLdGraph (escapes `<`, builds @graph): import { JsonLdGraph } from '@intecion/ipal-kit/rsc' ``` Data from the panel (siteName, logo) — nothing hard-coded. ### After deployment — be patient with Google Google **caches the favicon separately and slowly** (days, sometimes weeks). After correct wiring the favicon will not appear immediately — Googlebot has to revisit the home page. To speed it up: Search Console → request reindexing of the home page. Also check that `/` does not block Googlebot (robots) and that the favicon URL is public (not behind auth). ### Check 1. Open the site → DevTools → Elements → `` → look for `` with the correct URL. 2. Open the favicon URL itself in the browser — the image shows, ≥48×48. 3. Rich Results Test (Google) — paste the page URL, check Organization. 4. Search Console → request reindexing of the home page. ## Manual SEO/PWA extensions (manifest etc.) — from the panel, NOT hard-coded Some SEO/PWA things are so project-specific and one-off that the plugin does not provide them (that would be over-engineering). You do them in the project — BUT correctly: reading from the panel/env, not hard-coding client values. > **Rule:** even when you do something by hand in the project, read the data (name, colours, > description, logo) from the panel (SiteSettings) or env. A hard-coded client name/colour > = anti-pattern (see AGENT.md §2). An "R Custom Cars" manifest with > hard-coded values works for one client only. ### Web App Manifest (PWA) — how to do it RIGHT Main rule: **no data → SKIP the field, do NOT hard-code a value.** Is a manifest valid without `name`? No — but a manifest without a name is better than one with another client's name in a fallback. A fallback with a client name/colour is a hidden hard-code. > **Recommended (current): `createManifestHandler`** — the same without hand-written code, > with try/catch for a missing database at build time: > ```ts > // app/manifest.ts — usually: export { manifest as default } from '@/lib/content' > import { createManifestHandler } from '@intecion/ipal-kit' > import { getCachedPayload } from '@/lib/content' > import { i18nConfig } from '@/i18n.config' > export const dynamic = 'force-dynamic' > export default createManifestHandler({ getCachedPayload, config: i18nConfig }) > ``` > The manual variant below — when the manifest needs fields outside the panel. ```ts // app/manifest.ts import type { MetadataRoute } from 'next' import { getCachedPayload } from '@/lib/content' import { getSiteSettings } from '@intecion/ipal-kit' import { i18nConfig } from '@/i18n.config' import type { SiteSetting } from '@/payload-types' export default async function manifest(): Promise { const payload = await getCachedPayload() const settings = await getSiteSettings(payload, { locale: i18nConfig.defaultLocale as never, }) const siteName = settings?.siteName?.trim() // Icon from the panel (favicon → logo). For PNG give a SPECIFIC size from the media // (not 'any' — 'any' is for SVG only). No icon → skip the icons field. const icon = settings?.favicon ?? settings?.logo const iconEntry = typeof icon === 'object' && icon?.url ? (() => { const isSvg = icon.mimeType === 'image/svg+xml' || icon.url.endsWith('.svg') const size = typeof icon.width === 'number' && typeof icon.height === 'number' ? `${Math.min(icon.width, icon.height)}x${Math.min(icon.width, icon.height)}` : '512x512' return { src: icon.url, type: icon.mimeType ?? 'image/png', sizes: isSvg ? 'any' : size, // 'any' for SVG only } })() : undefined // Build ONLY from what exists. Missing field → it is not in the manifest (instead of // a hard-coded fallback). start_url from the config, not a hard-coded '/pl'. return { ...(siteName ? { name: siteName, short_name: siteName } : {}), start_url: `/${i18nConfig.defaultLocale}`, display: 'standalone', ...(iconEntry ? { icons: [iconEntry] } : {}), // theme_color / background_color / description — ONLY if you add fields in the // panel and read them. Do NOT hard-code '#0e1e24' or a client description. } } ``` **Key differences from a common agent mistake:** - **No fallback with a client name** — `siteName` empty → skip `name`, do not insert "Kancelaria X" hard-coded. Another client's name in a fallback = hard-code. - **PNG gets a specific `sizes`** from the media dimensions (not `sizes: 'any'` — that is the same mistake as with the favicon; `any` for SVG only). - **No `catch` block with hard-coded values** — if you worry about an error, wrap just `getSiteSettings` and on error return a minimal manifest (start_url + display), WITHOUT a hard-coded name/colours. - **start_url from i18nConfig**, not a hard-coded `/pl`. **Contrast — what NOT to do** (real mistakes from projects): ```ts // WRONG — explicit hard-code (rcustomcars) let name = 'R Custom Cars'; short_name: 'RCC' background_color: '#08080a', theme_color: '#d4af37' icons: [{ src: '/logo/rcc-logo.svg' }] // static path // WRONG — hard-code HIDDEN in a fallback (law firm) siteName || 'Kancelaria Adwokacka Adwokat Romuald Kędzierski' // another client's name in || sizes: 'any', type: mimeType // 'any' on PNG = wrong catch { return { name: 'Kancelaria...', theme_color: '#0e1e24' } } // hard-code in catch ``` A `|| 'Client Name'` fallback looks innocent, but it is a hard-code — another project copies it and shows someone else's name when the panel fails. No data → skip the field. If the client needs theme colours / a description in the manifest — **add the fields** `themeColor`, `manifestDescription` in SiteSettings (through the plugin's SiteSettingsFields options) and read them from the panel. Then the editor changes them; they are not hard-coded. ### Other manual extensions — the same rule Whatever you add by hand (extra meta tags, structured data of a specific type, etc.): - data from the panel (SiteSettings / page fields) or env - nothing hard-coded per client (name, colour, address, domain) - if it is universal and repeatable → consider reporting it to the plugin instead of doing it by hand (see AGENT.md §2) ## CRITICAL: metadata in for Google **The biggest SEO trap in Next.js — it affects EVERY project.** For dynamically rendered pages (SSR) Next.js **streams metadata into ``**, not ``, and moves it to head with a JS script. Result: canonical, hreflang, title, favicon land in body in the raw HTML. Crawlers without JS (Screaming Frog, some bots) see them outside head → ignore them → SEO loss. **It is a race condition:** when the database answers quickly, the metadata makes it into head; when slower (or a crawler hits many pages at once, loading the database), Next closes `` and appends the metadata in ``. That is why a single `curl` can show head OK, while a 10-request test shows 5/10 in body. **Test repeatedly.** ### MAIN fix — ISR (revalidate) in pages The most effective: **cache the whole page (ISR)**. The page is generated once with a complete ``, later requests serve the cache — zero database queries while rendering, so the race condition DISAPPEARS (metadata always in head). Bonus: TTFB drops from ~500ms to ~20ms, the occasional 503s (cold start) go away. ```ts // app/(frontend)/[locale]/[[...slug]]/page.tsx export const revalidate = 3600 // cache 1h, regenerate in the background ``` > **NOTE — ISR and content from the panel:** a page cached for `revalidate` seconds does NOT > show editor changes immediately (it waits for revalidation). For rarely changed content > that is OK. If the editor must see changes immediately — use **on-demand > revalidation**: an `afterChange` hook in the collection → `revalidatePath(path)` (see > [hooks.md](./hooks.md)). Or a shorter `revalidate` (e.g. 300 = 5 min). Do NOT combine ISR with > `force-dynamic` — they exclude each other. ### SECOND fix — remove the explicit from the layout A hard-coded `` in an App Router layout forces head to close early — before the page generates its metadata. That pushes metadata into body. Do NOT declare ``: ```tsx // WRONG — an explicit closes head too early {children} // RIGHT — MediaPreconnect in body, React 19 hoists the link to head {children} ``` React 19 moves `` to head by itself. An explicit `` is unnecessary and harmful (it forces an early close). ### THIRD fix — htmlLimitedBots (supplement) You can also force blocking metadata for crawlers (useful when a page for some reason cannot be ISR): ```ts // next.config.ts const nextConfig: NextConfig = { htmlLimitedBots: /Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Yandex|DuckDuckBot|Baiduspider|Screaming Frog|AhrefsBot|SemrushBot/i, } ``` `htmlLimitedBots` turns off streaming for these User-Agents (metadata in head). BUT it is weaker than ISR — the page still renders dynamically (database query → slower, race risk). **ISR removes the cause, htmlLimitedBots eases the symptom.** Best: ISR + no explicit head. htmlLimitedBots as an extra layer. ### Symptoms (that you have this problem) - Screaming Frog: "canonical/hreflang/title outside " (on many pages) - Search Console: "missing canonical", favicon globe - Raw HTML: canonical/title AFTER ``, at the end of body, with an appendChild script - 10-request test: some in head, some in body (race condition) ### Check — TEST REPEATEDLY (not once) A single `curl` can hit "lucky" timing. Test 10 times: ```bash # 10 requests as Googlebot — how many have canonical in for i in $(seq 1 10); do curl -s -A "Googlebot" https://twojadomena.pl/pl/strona | \ python3 -c "import sys; h=sys.stdin.read(); e=h.find(''); c=h.find('rel=\"canonical\"'); print('head' if 0` with an entry per locale + `hreflang="x-default"`. 4. Search Console → International Targeting report (if available) — hreflang errors. ### Common mistakes (do not do this) - No hreflang → Google treats the versions as duplicates (the plugin has it, do not remove it). - A hard-coded path map instead of getLocalizedSlugs → hreflang drifts from the database. - `noindex` on `/pl` by mistake → it drops out of the index. Check the robots meta. - A hard 301 root redirect to one language → you lose negotiation and the other version. Keep negotiation + hreflang. ## Descriptions in Google — data-nosnippet (footer, contact details) Symptom: under the result and the sitelinks Google shows the address, hours and e-mail from the footer instead of the meta description — the same text under every subpage. Cause: Google picks the snippet text itself when it decides it matches the query better than the description. For a brand search the contact block "matches", and the footer is on every page. A good, unique description does not stop this. Fix: put text repeated on every page in `data-nosnippet`. The page is still indexed; Google only does not quote that fragment. It still has the address and hours from the `LocalBusiness` JSON-LD. ```tsx import { NoSnippet } from '@intecion/ipal-kit/rsc' // in a client component: /client
…address, hours, phone, links…
``` - Google honours `data-nosnippet` only on `div`, `section`, `span` — NOT on `footer`, `nav`, `aside`. That is why `NoSnippet` renders a `div` (`as="section"` / `as="span"`), and the `