Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)75k · #2935

meta-in-body

Skill này làm gì

Skill này kiểm tra các thẻ meta như noindex, canonical, description và viewport có nằm trong phần head của trang hay không. Skill dành cho người xây web muốn công cụ tìm kiếm và trình duyệt đọc được chúng.

Khi nào nên dùng

  • ✓Khi bạn nhờ agent kiểm tra cấu trúc HTML của trang để tìm thẻ bị đặt sai chỗ.
  • ✓Khi một plugin hoặc script có thể đã thêm thẻ meta vào thân trang và các chỉ thị tìm kiếm dường như bị bỏ qua.
  • ✓Khi một trang được lập chỉ mục hoặc bị loại bất ngờ và bạn cần xác nhận các chỉ thị meta đang ở đúng chỗ.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/meta-in-body/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/meta-in-body/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Một vài thẻ meta trên trang của tôi có thể đang ở sai chỗ. Bạn có thể kiểm tra và sửa không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent phân tích trang và tìm các phần tử meta nằm trong thân hoặc sau khi head đã đóng. Sau đó nó chuyển chúng vào head, hoặc sửa script đang chèn chúng để nhắm vào head.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Meta Tags in Body

Meta tags placed in the document body are ignored by search engines and most browsers—directives like noindex or canonical-url are silently ineffective, causing pages to be indexed or de-indexed unexpectedly.

Quick Reference

  • All <meta> tags must appear inside <head>, never inside <body>
  • Browsers may ignore or move misplaced meta tags, making them ineffective
  • Crawlers like Googlebot only process meta tags found in <head>
  • Validate with HTML validator or inspect parsed DOM to confirm placement

Check

Parse the HTML and check whether any <meta> elements appear outside <head>—i.e., inside <body> or after the </head> closing tag. Flag each misplaced tag by name/property.

Fix

Move 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.

Explain

Meta tags are document-level metadata and must live in <head>. When placed in <body>, they fall outside the metadata model of the document—search engines and browsers do not honour them, so directives like noindex or canonical-url will have no effect.

Code Review

Parse the rendered HTML and check the DOM structure. Find all <meta> elements. For each one, traverse up the parent chain — 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.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/seo/meta-in-body

Câu hỏi thường gặp

Vì sao thẻ meta đặt sai chỗ lại quan trọng?

Công cụ tìm kiếm và trình duyệt có thể bỏ qua chúng, nên các chỉ thị như noindex hoặc canonical sẽ không có tác dụng.

Nếu một script thêm các thẻ này thì sao?

Skill gợi ý sửa script để nó thêm chúng vào phần head của tài liệu thay vì thân trang.

Làm sao kiểm tra vị trí của chúng?

Skill khuyên dùng công cụ kiểm tra HTML hoặc xem cấu trúc trang đã phân tích.

Chi tiết

Mô tả gốc của tác giả

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.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#2935
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự