seo object, and you control it through the company API.
The seo object
Every storefront response includes seo with four fields:
These are the values the storefront page itself uses, so the API and the rendered page always agree. None of them is ever
null.
Values you haven’t set
You don’t have to set SEO. When a field has no SEO value of its own, Fluid fills it from the next source in line:
Descriptions are stripped of HTML and cut to 200 characters.
On company responses,
seo.id tells you where the values come from. A number means the resource has its own SEO settings. null means every value is filled in from the resource or the store.
SEO settings are stored once per resource, in the store’s default language. When you read a resource with another
lang, seo is filled from the resource’s translated title, description, and image instead.When a page is indexable
seo.indexable is true only when nothing is stopping search engines. It’s false when any of these is true:
- The resource isn’t live — for example a draft, or a scheduled resource before its time. See Visibility, drafts, and scheduling.
- You opted the resource out by writing
indexable: false. - The store blocks search engine indexing for the whole storefront.
- The product isn’t published to the storefront.
false value means the storefront page tells search engines not to index it.
Set SEO
Write SEO withsearch_engine_optimizer_attributes on a company create or update. The shape is the same on every resource:
- Write and read keys differ. You write
search_engine_optimizer_attributesand readseo. Sending anseoobject in a write returns422. - To remove a custom value, send
nullfor that field. It then falls back as described above. - To keep a resource out of search engines, send
indexable: false. The resource stays live for shoppers.
Slugs and canonical URLs
A resource’s slug is part of its public URL, and every response returns the full address ascanonical_url. You can’t set canonical_url directly — change the slug instead. Changing a slug changes the URL search engines have indexed, so do it sparingly. See Slugs and URLs.
Checklist
- Give every live resource a clear
titleanddescription. They’re the SEO fallbacks. - Set SEO values only where the page should read differently in search results than on the page itself.
- Pin slugs on pages you promote, so a rename doesn’t change their URL.
- Use
indexable: falsefor pages that should work for shoppers but stay out of search results, such as thank-you or member-only pages. - Check
seo.indexableon the public slug lookup before you share a URL you expect to be indexed.