Hydrogen SEO meta tags are set in each route’s meta export. On legacy Hydrogen, where 2026.4 is the newest line, the getSeoMeta helper turns one object into the title, description, canonical, Open Graph and JSON-LD tags. Hydrogen 2026.10 removed that helper, so there you return the tag descriptors yourself. On either line, read the rendered head before you trust it.
The behaviour reported below was observed in Node 24.12 with @shopify/hydrogen 2026.4.9 (the 2026-04 dist-tag on npm on 30 November 2026) and React Router 7.18.7, then with 2026.10.3 and React Router 8.5.1. We called the functions directly and rendered the results through React Router’s <Meta /> in a route stub. None of it ran inside a deployed storefront.
What does getSeoMeta put in the head?
getSeoMeta takes any number of config objects, merges them left to right, and returns the array a React Router meta export expects. One script shows most of what it does:
import {getSeoMeta} from '@shopify/hydrogen';
const root = {
title: 'Northwind Supply',
titleTemplate: '%s | Northwind Supply',
description: 'Workwear and tools, shipped from Leeds.',
};
const product = {
title: 'Canvas Apron',
description: 'A waxed canvas apron with two pockets.',
url: 'https://northwind.example/products/canvas-apron/?variant=123',
media: {
url: 'https://cdn.shopify.com/s/files/1/apron.webp',
width: 1200,
height: 1200,
},
alternates: [
{
language: 'en-GB',
url: 'https://northwind.example/en-gb/products/canvas-apron',
default: true,
},
],
robots: {maxSnippet: 0},
};
console.log(getSeoMeta(root, product));
Rendered through <Meta />, that array came out as:
<title>Canvas Apron | Northwind Supply</title>
<meta property="og:title" content="Canvas Apron | Northwind Supply"/>
<meta property="twitter:title" content="Canvas Apron | Northwind Supply"/>
<meta name="description" content="A waxed canvas apron with two pockets."/>
<meta property="og:description" content="A waxed canvas apron with two pockets."/>
<meta property="twitter:description" content="A waxed canvas apron with two pockets."/>
<link rel="canonical" href="https://northwind.example/products/canvas-apron"/>
<meta property="og:url" content="https://northwind.example/products/canvas-apron"/>
<meta property="og:image:url" content="https://cdn.shopify.com/s/files/1/apron.webp"/>
<meta property="og:image:secure_url" content="https://cdn.shopify.com/s/files/1/apron.webp"/>
<meta property="og:image:type" content="image/jpeg"/>
<meta property="og:image:width" content="1200"/>
<meta property="og:image:height" content="1200"/>
<link rel="alternate" hrefLang="en-GB-default" href="https://northwind.example/en-gb/products/canvas-apron"/>
<meta name="robots" content="index,follow"/>
Four lines in that head are not what the input asked for.
The canonical lost its query string and its trailing slash. Shopify’s SEO guide for legacy Hydrogen covers the first half (“by default Hydrogen removes query parameters from canonical URLs”), and for ?variant= it is what you want. A #fragment is kept.
The WebP image is labelled image/jpeg. The 2026.4.9 source guesses the MIME type from the file extension, recognises svg, png, gif, swf and mp3, and falls back to image/jpeg. The fallback caught .webp, .avif and an .mp4 passed with type: 'video'. A media object also produces og:image:url with no bare og:image; the Open Graph protocol calls the two identical, and we did not test how any scraper treats the difference. Passing media as a string avoids both questions: it emitted one og:image tag and no type.
default: true appended -default to the language. Google’s hreflang documentation accepts a language code, an optional region, or the reserved value x-default, and en-GB-default is none of those. Passing language: 'x-default' with no default flag produced the right tag.
maxSnippet: 0 vanished. The reference says 0 means no snippet, but the helper deletes falsy values, so only index,follow was left. noSnippet: true produced index,follow,nosnippet.
The same source has no branch that emits og:type, og:site_name or twitter:card, whatever you pass. The Open Graph page lists og:type among its four required properties.
What happens when a title or description is too long?
Nothing a visitor or a build would show you. getSeoMeta checks the title against 70 characters and the description against 155, logs Error in SEO input: `title` should not be longer than 70 characters with console.warn, and emits the tag unchanged. The description message says 160, although in 2026.4.9 it fired at 156.
The title is measured before titleTemplate is applied. A 70-character title with the template above produced an 89-character title and no warning. A relative url, or a handle without its @, is warned about in the same way and then emitted as given.
Nothing throws, so the limits reach only whoever reads the console. If length matters, truncate in the loader.
How do nested routes combine their tags?
They do not, unless you write it. React Router’s route module docs say the last matching route’s meta is used and “the entire meta descriptor array is replaced, not merged”. Shopify’s guide answers that by passing every match’s SEO object to getSeoMeta, most specific last:
import {getSeoMeta} from '@shopify/hydrogen';
export const meta = ({matches}) =>
getSeoMeta(...matches.map((match) => match.loaderData?.seo));
This differs from the guide’s match.data.seo in two places. The ?. is there because a matched route with no loader has no data: with a pathless layout route between root and product, the guide’s version threw TypeError: Cannot read properties of undefined (reading 'seo'). And it reads loaderData because React Router 7.15.1 and 7.18.7 passed both data and loaderData to meta, while 8.5.1 passed only loaderData.
The reference compares the merge to Object.assign(), and for robots that is exact: the child’s object replaces the parent’s whole, so a root {noIndex: true} with a child {noArchive: true} produced index,follow,noarchive. Two cases differ. jsonLd accumulates, one script tag per block, as the reference says it will.
The other is in neither the reference nor the guide. A falsy value in a child is deleted before merging, so a product with an empty description inherits the shop’s, and titleTemplate: null cannot switch the root’s template off. The root object alone gave Northwind Supply | Northwind Supply, a child passing null changed nothing, and only titleTemplate: '%s' removed the suffix.
In the stub, a route with no meta export rendered its parent’s tags untouched, canonical included.
How do you write Hydrogen SEO meta tags without getSeoMeta?
Shopify’s migration guide gives it one paragraph: “Hydrogen 2026-10 doesn’t include getSitemap(), getSitemapIndex(), or getSeoMeta()”, and SEO tags should come from React Router’s meta export. The installed 2026.10.3 package has no getSeoMeta anywhere in it, and the current Hydrogen overview lists SEO under what your app owns: “Meta tags, Open Graph tags, and structured data, rendered with your framework’s head or metadata API.” The product route in Shopify’s React Router template, as it stood on 30 November 2026, returned a title and one generic description. Canonical, Open Graph and structured data are yours to add.
About thirty lines cover it, with no Hydrogen import:
import type {MetaDescriptor} from 'react-router';
export type Seo = {
title: string;
description?: string;
url: string;
image?: string;
noIndex?: boolean;
jsonLd?: Record<string, unknown>[];
};
export function seoMeta(seo: Seo, siteName: string): MetaDescriptor[] {
const title =
seo.title === siteName ? siteName : `${seo.title} | ${siteName}`;
const {origin, pathname} = new URL(seo.url);
const canonical = (origin + pathname).replace(/\/$/, '');
const tags: MetaDescriptor[] = [
{title},
{property: 'og:title', content: title},
{property: 'og:type', content: 'website'},
{property: 'og:site_name', content: siteName},
{tagName: 'link', rel: 'canonical', href: canonical},
{property: 'og:url', content: canonical},
];
if (seo.description) {
tags.push(
{name: 'description', content: seo.description},
{property: 'og:description', content: seo.description},
);
}
if (seo.image) tags.push({property: 'og:image', content: seo.image});
if (seo.noIndex) tags.push({name: 'robots', content: 'noindex'});
for (const block of seo.jsonLd ?? []) tags.push({'script:ld+json': block});
return tags;
}
Each route calls it from meta with its own loaderData.seo, and returns a bare title when loaderData is missing. It type-checked under TypeScript 7.0.2 against both router versions and rendered the same head on each, with the JSON-LD escaped inside its script tag. new URL() throws on a relative address on purpose. Google recommends absolute canonical URLs, and a route that passed a bare path failed with TypeError: Invalid URL on its first render.
tagName: 'link' is the part to copy exactly. Without it, React Router renders a descriptor it does not recognise as a <meta> element. The legacy skeleton’s product route, on the 2026-04 branch on 30 November 2026, returns {rel: 'canonical', href} with no tagName and a relative path. The same descriptor through <Meta /> on both router versions became <meta rel="canonical" href="/products/canvas-apron"/>, which is not the <link> element Google’s canonical documentation describes.
Which should you use?
On a legacy storefront that already calls getSeoMeta, keep it. Pass images as strings, write x-default as a literal language, use noSnippet instead of a zero, and spread og:type and the other missing tags after its result. Those are call-site fixes, and a store you plan to leave on 2026.4 does not need more.
On 2026.10, or on a legacy store you expect to move, write the helper. It needs only React Router, so it runs on both lines, and the 2026.10 migration has one file fewer to rewrite. Shopify’s docs already file 2026.4 and earlier under “Legacy Hydrogen” and recommend migrating.
Then view source on the home page, a product, a collection and one route with no meta export. Check the sitemap the same way: our Hydrogen sitemap fixes list what the starter gets wrong there.
Whoooop builds and maintains Shopify storefronts, on themes and on Hydrogen. Our Shopify development page describes the Shopify side of the studio.