# SvelteKit title tags and meta descriptions

> Set unique SvelteKit titles and descriptions with load data and svelte:head, then verify server-rendered HTML on dynamic routes.

Canonical: https://scaplet.com/seo/sveltekit/title-and-meta

Guide SvelteKit SvelteKit · Metadata

Set unique SvelteKit titles and descriptions with load data and svelte:head, then verify server-rendered HTML on dynamic routes.

4 min

read

5

sources

Oct 24, 2026

updated

Scaplet Editorial Team

author

In one line

Return each route’s title and description from its `load` function, then render them in `<svelte:head>`. SvelteKit uses SSR by default, so the metadata can be in the initial HTML response. Keep the values unique for each route and inspect the deployed response instead of checking only the browser after JavaScript runs.

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fsveltekit%2Ftitle-and-meta%20(%22SvelteKit%20title%20tags%20and%20meta%20descriptions%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fsveltekit%2Ftitle-and-meta%20(%22SvelteKit%20title%20tags%20and%20meta%20descriptions%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fsveltekit%2Ftitle-and-meta%20(%22SvelteKit%20title%20tags%20and%20meta%20descriptions%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fsveltekit%2Ftitle-and-meta%20(%22SvelteKit%20title%20tags%20and%20meta%20descriptions%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 4 parts, 4 minutes.

1. [Return route-specific metadata from load 01](#return-route-specific-metadata-from-load)
2. [Preserve server rendering for public search pages 02](#preserve-server-rendering-for-public-search-pages)
3. [Make the metadata match the canonical route 03](#make-the-metadata-match-the-canonical-route)
4. [Verify what a crawler receives 04](#verify-what-a-crawler-receives)

_01_Check it

## Return route-specific metadata from load

Put page data in the route’s `load` function, then use it in `<svelte:head>`. This keeps a dynamic article’s metadata tied to the same record as its visible heading and body. SvelteKit’s SEO docs say every page should have well-written and unique `<title>` and `<meta name="description">` elements inside `<svelte:head>`, and describe a common pattern: return SEO data from page `load` functions, then use it as `page.data` in a `<svelte:head>` in your root layout. The example below puts the tags in the page instead. Return a real 404 with `error(404, ...)` when the record does not exist.

+page.svelte

```
<script> let { data } = $props() </script> <svelte:head> <title>{data.title}</title> <meta name="description" content={data.description} /> </svelte:head> <h1>{data.article.title}</h1>
```

The example uses a server `load` function so API credentials and server-only access can stay on the server. For public data, a universal `+page.js` load can also supply data. The important check is the rendered document: title and description should describe this route, not the entire site or a generic template.

+page.server.ts

```
import { error } from '@sveltejs/kit' export async function load({ params, fetch }) { const response = await fetch(\`/api/articles/${params.slug}\`) if (!response.ok) error(404, 'Article not found') const article = await response.json() return { title: article.seoTitle ?? article.title, description: article.seoDescription ?? article.summary, article } }
```

_02_Pick rendering based on how the page changes

## Preserve server rendering for public search pages

SvelteKit renders pages on the server by default, and Svelte’s docs say that during [server-side rendering](/glossary/server-side-rendering) `head` content is exposed separately to the main `body` content. SvelteKit’s SEO docs say server-rendered content is indexed more frequently and reliably, and that you should leave SSR on unless you have a good reason not to. A client-only metadata update can make the browser tab look correct while the initial response is missing the page’s title and description.

Page

### Stable public page

Starting point

Prerender it when its content is known at build time.

Metadata check

Built HTML contains the route’s title and description.

Page

### Public page with request-time data

Starting point

Use SSR and load data on the server.

Metadata check

A direct request returns the correct tags and visible content.

Page

### Private account screen

Starting point

Use the [rendering](/glossary/rendering) and access model the app needs.

Metadata check

The route is not accidentally listed as public content.

Page

### Client-only app page

Starting point

Disable SSR only when browser-only behavior requires it.

Metadata check

Do not rely on a post-hydration head update as the only metadata source.

Per SvelteKit’s page options, any two users hitting a prerendered page directly must get the same content, and accessing `url.searchParams` during [prerendering](/glossary/speculation-rules) is forbidden. Child layouts and pages override values set in parent layouts, so you can enable prerendering for the app and disable it for pages that need [dynamic rendering](/glossary/dynamic-rendering). See [SvelteKit page options](https://svelte.dev/docs/kit/page-options).

_03_Checklist

## Make the metadata match the canonical route

First_2_
Use one descriptive title per route. Do not let a shared layout append the site name twice or overwrite a page-specific title.

Write a unique description that summarizes the page’s actual content.

Next_2_
If a route has [query parameters](/glossary/url-parameters) for sorting or filtering, decide which URL is canonical and render that decision consistently.

Add alternate-language links only when equivalent translations exist.

Then_1_
If the CMS record is missing a title or summary, use a meaningful fallback rather than emitting `undefined`, an empty string, or metadata from another record.

By default SvelteKit removes trailing slashes by redirecting: visit `/about/` and it responds with a redirect to `/about`. The `trailingSlash` page option can be `'never'` (the default), `'always'`, or `'ignore'`, and the docs advise against `'ignore'` because `/x` and `/x/` become separate URLs. Make canonicals and [internal links](/glossary/internal-links) match the form your site uses. See [canonical URLs](/glossary/canonical-url) and [meta descriptions](/glossary/meta-description).

_04_How it works

## Verify what a crawler receives

1. 1

### Request a route directly

Open a deep URL in a fresh tab or use `curl -sL https://example.com/articles/example`. A route that works only after navigating from the homepage may have a routing or server-data issue.
2. 2

### Inspect the first response

Search the response HTML for `<title>` and `name="description"`. Confirm they describe the requested article before any client-side navigation.
3. 3

### Test more than one slug

Check two different records, a missing [slug](/glossary/url-slug), and a record with blank SEO fields. This catches static metadata accidentally reused across a dynamic route family.
4. 4

### Check canonical and redirects

Test both trailing-slash forms. Confirm any canonical you render points at the final public URL and the redirect does not loop or add an extra hop.

For Google’s general guidance, see [JavaScript SEO basics](https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics). A successful HTML check confirms output, not indexing; use URL Inspection and Search Console to investigate indexing separately.

Sources · 5

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- svelte.dev
- google.com

1. 01 [SEO | SvelteKit Docs](https://svelte.dev/docs/kit/seo) svelte.dev · checked 2026-10-24
2. 02 [Routing | SvelteKit Docs](https://svelte.dev/docs/kit/routing) svelte.dev · checked 2026-10-24
3. 03 [Page options | SvelteKit Docs](https://svelte.dev/docs/kit/page-options) svelte.dev · checked 2026-10-24
4. 04 [<svelte:head> | Svelte Docs](https://svelte.dev/docs/svelte/svelte-head) svelte.dev · checked 2026-10-24
5. 05 [JavaScript SEO basics | Google Search Central](https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics) developers.google.com · checked 2026-10-24

Questions

## Asked a lot.

4 questions people ask next, answered from the sources on this page.

_01_ Where do I set the title in SvelteKit?

Put a `<title>` inside `<svelte:head>`. For route-specific pages, return the title from `load` and render the returned data so each URL gets its own value.

_02_ Why does my SvelteKit title show in the browser but not in view-source?

The title may be set only after client-side JavaScript runs, or SSR may be disabled for that route. SvelteKit uses SSR by default, so inspect the direct response and render the title through `<svelte:head>` with data from `load`.

_03_ Can SvelteKit use dynamic metadata for CMS pages?

Yes. Load the CMS record from the route parameter and render its SEO fields through `<svelte:head>`. Add a fallback for missing fields, return a 404 for a missing record, and test two different URLs to catch reused metadata.

_04_ Should every SvelteKit route be prerendered?

No. SvelteKit’s docs say a page is prerenderable only if any two users hitting it directly get the same content from the server, and that prerendered content is seen by all users. Pages with actions cannot be prerendered.

## Keep learning

[All platform guides](/seo)

[Learn SvelteKit redirects Frameworks](/seo/sveltekit/redirects) [Related Canonical URL Crawling and indexing](/glossary/canonical-url) [Read next Angular SEO Frameworks](/seo/angular) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in platform guides
[Strapi title and meta](/seo/strapi/title-and-meta) [Webflow SEO](/seo/webflow) [Webflow AI crawlers](/seo/webflow/ai-crawlers)

More in Frameworks
[SvelteKit redirects](/seo/sveltekit/redirects) [SvelteKit title tags and meta descriptions](/seo/sveltekit/title-and-meta)

Terms on this page
[Server-side rendering](/glossary/server-side-rendering) [Rendering](/glossary/rendering) [Speculation rules](/glossary/speculation-rules) [Dynamic rendering](/glossary/dynamic-rendering) [URL parameters](/glossary/url-parameters) [Canonical URL](/glossary/canonical-url) [Meta description](/glossary/meta-description) [Internal links](/glossary/internal-links)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
