YAML is a human-readable data serialization language designed for storing or transmitting structured information.
SEOs, especially those working with static site generators, read about YAML when they need to write front matter or metadata.
External context
For individuals managing their own web pages, knowing YAML means understanding how to handle configuration files and data storage. It utilizes simple Python-style indentation to indicate nested structures and generally does not require quotes around most string values, making it a minimal syntax that is easy for humans to read.
YAML Wikipedia contributors, “YAML”, en.wikipedia.orgLicence01What it is and how it works
YAML (YAML Ain't Markup Language) uses indentation and key-value pairs to represent nested data. In SEO, it appears as front matter at the top of Markdown or HTML files in static site generators like Jekyll, Hugo, or Eleventy. The front matter is parsed at build time to generate HTML meta tags, such as ` and `. Search engines never see the YAML itself; they see the rendered HTML. The format is strict about spaces and structure, so a small error can break the entire build or silently drop metadata.
YAML is a way to write data with indentation and key-value pairs, used to set titles, descriptions, and other SEO fields on pages.
02What to do about it
Add YAML front matter to every page on your static site. Include at least title, description, and canonical fields. Use the same key names across all pages for consistency. Validate your YAML with a linter before building the site. If you use a CMS that outputs YAML, check that the generated HTML contains the expected meta tags. For dynamic sites, YAML is usually not needed; use a database or JSON instead.
03How it is measured or noticed
You notice YAML issues by inspecting the rendered HTML of your pages. Look for the ` and ` tags; if they are missing or wrong, the front matter is likely incorrect. Use Google Search Console to see if Google displays the titles and descriptions you intended. A site crawler like Screaming Frog can also report missing or duplicate meta tags, which often trace back to front matter problems. You can also check the build log for YAML parse errors.
04Common mistakes
- Using tabs for indentation instead of spaces — YAML requires spaces.
- Forgetting to quote strings that contain colons, such as "Title: A Guide".
- Writing structured data in YAML instead of JSON-LD — search engines don't parse YAML.
- Skipping validation; a single typo can break the whole build.
- Repeating the same key in one block, which is invalid in YAML.
05Limits
YAML is a build-time tool, not a runtime format. Search engines do not read YAML directly, so it cannot replace structured data like JSON-LD. It only applies to static site generators or build pipelines; dynamic sites that render pages from a database have no use for YAML. YAML is often confused with JSON because both are data formats, but YAML is more human-readable and supports comments, while JSON is a strict subset and is the standard for structured data. YAML also has edge cases with special characters that can cause silent failures.
06Worked example
---
title: "How to Use YAML for SEO"
description: "A practical guide to YAML front matter."
canonical: "https://example.com/yaml-seo"
robots: "index, follow"
---
The entry above is written by GetLoopLoop. What follows is what independent catalogues hold about the same term — none of it is the source of this page.
- Also called
- YAML Ain't Markup Language, Yet Another Markup Language, .yaml, .yml
- Introduced
- 2001
- Developed by
- Clark Evans
- Builds on
- XML
- Kind of thing
- file format, markup language, data serialization format
The same term on Wikipedia
Catalogued in 26 languagesFrequently asked questions
How is YAML different from JSON?
YAML is more human-readable and uses indentation instead of brackets and commas, while JSON is a strict subset of YAML. For front matter, YAML is the default in most static site generators because it's easier to write and read.
Is YAML front matter required for my static site?
No, it's optional but recommended. Most static site generators use YAML front matter to set metadata like title, description, and layout. Without it, you'll miss out on SEO and structured data features.
How do I write YAML front matter correctly?
Place it between triple dashes at the top of your file, then use key-value pairs with consistent indentation. Use spaces, not tabs, and quote strings that contain special characters like colons or hashes.
Does YAML still work with modern static site generators?
Yes, YAML is still the standard for front matter in Jekyll, Hugo, and Eleventy. It's well supported and even newer tools like Astro accept it. You can rely on it for your site's metadata.
What breaks if my YAML has a syntax error?
Your site might fail to build, or pages will show default titles and descriptions instead of your custom ones. You'll notice it by inspecting the rendered HTML and seeing missing meta tags. The build system usually points to the exact line.
Wikimedia Commons
Related visuals with source and licence credit
Asked out loud
spoken, not typedThe same term in the words somebody uses speaking to an assistant rather than typing into a box — written from the situation, which is why each one carries the situation it came from.
It's probably your YAML front matter. Open the page's markdown file and look at the title field between the dashes. Fix it and rebuild the site.
That's YAML front matter. It holds the page's metadata like title, description, and layout. You can edit it directly and the site will update when you rebuild.
You likely forgot to add a description in the YAML front matter. Check the top of each page file and add a description field. Rebuild and deploy again.