{"data":{"slug":"github-thedaviddias-front-end-checklist-skills-meta-in-body-b6675a2c9f83","title":"Fix Meta Tags in Body","summary":"Move meta tags like noindex, canonical-url, and OG tags from the <body> to the <head> section of HTML documents to ensure they are recognized by search engines and browsers.","url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-meta-in-body-b6675a2c9f83","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-thedaviddias-front-end-checklist-skills-meta-in-body-b6675a2c9f83","markdown_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-meta-in-body-b6675a2c9f83.md","download_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-meta-in-body-b6675a2c9f83\/download","category":{"slug":"content-editorial","name":"Content & Editorial"},"editor_note":"Before fixing, validate the HTML structure using an HTML validator or by inspecting the parsed DOM. If meta tags are injected by scripts, ensure they target document.head instead of document.body.","instructions":"---\nname: meta-in-body\ndescription: \"Use when auditing HTML document structure. Applies to any page where meta tags (noindex, canonical-url, description, viewport, OG tags) may have been injected into the body by CMS plugins, widgets, or JavaScript rendering.\"\nmetadata:\n  category: seo\n  priority: high\n  difficulty: beginner\n  estimatedTime: \"5\"\n  source: frontendchecklist.io\n  url: https:\/\/frontendchecklist.io\/rules\/seo\/meta-in-body\n---\n\n# Meta Tags in Body\n\nMeta tags placed in the document body are ignored by search engines and most browsers\u2014directives like noindex or canonical-url are silently ineffective, causing pages to be indexed or de-indexed unexpectedly.\n\n## Quick Reference\n\n- All <meta> tags must appear inside <head>, never inside <body>\n- Browsers may ignore or move misplaced meta tags, making them ineffective\n- Crawlers like Googlebot only process meta tags found in <head>\n- Validate with HTML validator or inspect parsed DOM to confirm placement\n\n## Check\n\nParse the HTML and check whether any <meta> elements appear outside <head>\u2014i.e., inside <body> or after the <\/head> closing tag. Flag each misplaced tag by name\/property.\n\n## Fix\n\nMove all <meta> tags into the <head> section before <\/head>. If they are injected by a script after the DOM is built, refactor the injection to target document.head instead of document.body.\n\n## Explain\n\nMeta tags are document-level metadata and must live in <head>. When placed in <body>, they fall outside the metadata model of the document\u2014search engines and browsers do not honour them, so directives like noindex or canonical-url will have no effect.\n\n## Code Review\n\nParse the rendered HTML and check the DOM structure. Find all <meta> elements. For each one, traverse up the parent chain \u2014 if any ancestor is <body> or if the element appears after <\/head> in the source, flag it. Pay special attention to: meta name='robots', meta name='description', meta property='og:*', and link rel='canonical' placed in body.\n\n---\n\nFor full implementation details, code examples, and framework-specific guidance,\nsee `references\/rule.md`.\n\nRule page: https:\/\/frontendchecklist.io\/rules\/seo\/meta-in-body\n","use_cases":["Auditing HTML documents for misplaced meta tags injected by CMS plugins or JavaScript.","Fixing pages that are unexpectedly indexed or de-indexed due to noindex tags in the body.","Validating canonical URLs and OG tags are recognized by search engines."],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/thedaviddias\/Front-End-Checklist\/blob\/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e\/skills\/meta-in-body\/SKILL.md","source_commit":"e8d14d049010e2ce25afcd5e8609dfcbbe63e47e","license":null,"version":null,"listing_approved_at":"2026-11-23","created_at":"2026-11-22T17:03:04.000000Z","updated_at":"2026-11-23T04:55:39.000000Z","seo_title":"Fix Meta Tags in Body for SEO","seo_description":"Ensure meta tags like noindex, canonical-url, and OG tags are placed in the <head> section of HTML documents for proper SEO.","seo_keywords":["fix meta tags in body","seo meta tags in head","canonical url in head","og tags in head","noindex in head"]}}