SEO view configuration
General
A view's seo object sets the metadata that search engines and social networks read from the page. The page title comes from the view's title field, see View settings.
"seo": {
"language": "de",
"alternates": [{ "lang": "en", "path": "/en/about" }],
"canonical": "https://www.example.com/about",
"meta": [
{ "name": "description", "content": "$context.content.description" },
{ "property": "og:type", "content": "website" }
]
}Language
language sets the lang attribute of the page. Without it, the language from experience.config.json applies, or en if none is set.
Alternate languages
alternates lists the same page in other languages. path is relative, the full URL is calculated at runtime.
Canonical URL
Purple Experience sets the canonical URL (and og:url) automatically: on content pages from the content's canonical URL, otherwise from the current address, keeping only the parameters that select content. Set canonical to a full URL to override it.
Meta tags
meta is a list of meta tags. Each entry has name or property and content, and optionally media. Values can use expressions with context data (see Context Data), as the description does in the example above. An entry whose content is empty is not set.
- Open Graph tags use property, e.g. { "property": "og:image", "content": "https://…" }.
- Tags with the same name and a different media are set side by side, e.g. a light and a dark theme-color.
- A view tag replaces a content tag with the same name or property.
Robots
Set the robots value as a meta tag, e.g. { "name": "robots", "content": "noindex" }. To prevent accidental indexing, Purple Experience always sets noindex, nofollow on previews, on websites without a custom domain, and when the address has a preview or debug parameter.
In apps
In apps, the view title and language are set, and of the meta tags only theme-color (as of Purple Experience 6.2.0, see Status bar colour in apps). Canonical URL, alternate languages and all other meta tags are only used on the web.
Content SEO metadata
On pages with the content body component (e.g. article pages), the SEO metadata of the content (e.g. from Yoast in the DS Hub) is added automatically:
- og_* keys become og:* properties, og_image becomes og:image with width, height and type
- article_* keys become article:* properties
- twitter_* keys become twitter:* names
- twitter_misc becomes one twitter:labelN / twitter:dataN pair per entry
- robots becomes the robots tag, other keys become tags with that name
The content's title applies when the view has no title. The view configuration always wins: its title and its meta tags replace those of the content.