{"record":{"id":"c37af7836d6abcc6","repo":"mui/material-ui","slug":"docs-infra-the-title-title-is-too-long-ti","errorCode":null,"errorMessage":"docs-infra: The title \"${title}\" is too long (${title.length} characters).\\nIt needs to have fewer than 70 characters—ideally less than 60. For more details, see:\\nhttps://developers.google.com/search/docs/advanced/appearance/title-link\\n","messagePattern":"docs-infra: The title \"(.+?)\" is too long \\((.+?) characters\\)\\.\\\\nIt needs to have fewer than 70 characters—ideally less than 60\\. For more details, see:\\\\nhttps://developers\\.google\\.com/search/docs/advanced/appearance/title-link\\\\n","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages-internal/markdown/prepareMarkdown.mjs","lineNumber":104,"sourceCode":"\n  translations\n    // Process the English markdown before the other locales.\n    // English ToC anchor links are used in all languages\n    .sort((a) => (a.userLanguage === 'en' ? -1 : 1))\n    .forEach((translation) => {\n      const { filename, markdown, userLanguage } = translation;\n      const headers = getHeaders(markdown);\n      const location = headers.filename || `/${fileRelativeContext}/${filename}`;\n      const markdownH1 = getTitle(markdown);\n      const title = headers.title || markdownH1;\n      const description = headers.description || getDescription(markdown);\n\n      if (title == null || title === '') {\n        throw new Error(`docs-infra: Missing title in the page: ${location}\\n`);\n      }\n\n      if (title.length > 70) {\n        throw new Error(\n          [\n            `docs-infra: The title \"${title}\" is too long (${title.length} characters).`,\n            'It needs to have fewer than 70 characters—ideally less than 60. For more details, see:',\n            'https://developers.google.com/search/docs/advanced/appearance/title-link',\n            '',\n          ].join('\\n'),\n        );\n      }\n\n      if (description == null || description === '') {\n        throw new Error(`docs-infra: Missing description in the page: ${location}\\n`);\n      }\n\n      if (description.length > 160) {\n        throw new Error(\n          [\n            `docs-infra: The description \"${description}\" is too long (${description.length} characters).`,\n            'It needs to have fewer than 170 characters—ideally less than 160. For more details, see:',","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/mui/material-ui/blob/bdc96df2cb530fcdd60a7a7aabe37f610ce0f0a5/packages-internal/markdown/prepareMarkdown.mjs#L86-L122","documentation":"During docs build, prepareMarkdown reads the page title (from the `title:` frontmatter header or the first H1) and enforces Google's SEO title-link guidance: titles must be 70 characters or fewer, ideally under 60. A longer title fails the build so the published page does not get truncated in search results.","triggerScenarios":"Authoring a markdown docs/blog page whose `title:` header (or first # heading) exceeds 70 characters; the build runs prepareMarkdown and throws before generating the page.","commonSituations":"Writing a new docs page or blog post with an overly descriptive title; copy-pasting a section heading as the title.","solutions":["Edit the page's `title:` frontmatter (or the H1) to 60 characters or fewer.","Move detail into the `description:` header instead of the title.","Re-run `pnpm docs:build` to confirm the fix."],"exampleFix":"---\ntitle: This is a very long docs page title that goes well beyond the seventy character limit imposed by the build\n---\n// after\n---\ntitle: Short page title\ndescription: The longer explanation moves here.\n---","handlingStrategy":"validation","validationCode":"function validateTitle(title) {\n  if (typeof title !== 'string' || title.length === 0) throw new Error('Missing title');\n  if (title.length > 70) throw new Error(`Title too long: ${title.length} chars`);\n  return title;\n}\n// run validateTitle on the markdown frontmatter before committing docs","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add a pre-commit/docs lint rule that checks title length <= 70 (ideally <= 60).","Keep titles short by moving detail into the description header.","Run `pnpm docs:build` locally before pushing docs changes."],"tags":["docs-infra","seo","build","validation"],"backgroundTag":null,"analyzedSha":"bdc96df2cb530fcdd60a7a7aabe37f610ce0f0a5","analyzedAt":"2026-08-12T22:59:56.717Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}