nextjs-seo-indexing
Skill này làm gì
Công cụ này giúp sửa các vấn đề về cách Google tìm và hiển thị các trang website Next.js của bạn. Nó kiểm tra xem cài đặt SEO có đúng không, Google có thể thu thập dữ liệu website hiệu quả không và có lỗi nào ngăn Google lập chỉ mục các trang không.
Khi nào nên dùng
- ✓Khi Google Search Console báo lỗi lập chỉ mục.
- ✓Trước khi triển khai các cập nhật lớn của website để đảm bảo SEO không bị ảnh hưởng.
- ✓Để kiểm tra xem các trang quan trọng có được Google tìm thấy và hiển thị đúng không.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/nextjs-seo-indexing/SKILL.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Kiểm tra các vấn đề lập chỉ mục của website Next.js của tôi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ phân tích cấu hình website Next.js của bạn, như thẻ canonical, quy tắc 'noindex', sitemap và cách các trang được tạo ra. Nó so sánh các cài đặt này với thực hành tốt nhất để đảm bảo Google có thể thu thập và lập chỉ mục nội dung.
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.
Next.js SEO Indexing & Crawl Budget Skill
Fix Google Search Console coverage issues, canonical problems, sitemap errors, and crawl budget waste in Next.js apps.
When to Use
- Use when a Next.js site has Google Search Console coverage issues such as duplicate canonicals, accidental noindex, crawl waste, or discovered-but-not-indexed URLs.
- Use when auditing sitemap, robots.txt, redirect, internal-linking, or static-rendering problems before an SEO release.
- Use when you need framework-specific examples for Next.js App Router metadata,
generateMetadata,robots.js, and sitemap routes.
Understanding Search Console Coverage States
| Status | Meaning | Fix |
|---|---|---|
| Crawled – not indexed | Google crawled but chose not to index | Improve content quality + canonical + internal links |
| Duplicate without canonical | Multiple URLs serve same content, no canonical | Add explicit canonical to the preferred URL |
| Excluded by noindex | noindex tag present |
Remove noindex if page should be indexed |
| Duplicate, Google chose different canonical | Google prefers a different URL than you specified | Align canonical with the URL Google naturally picks |
| Alternative page with proper canonical | Correct — non-preferred duplicate pointing to canonical | Expected behavior, not a problem |
| Not found 404 | Page deleted or URL changed | Add redirect or restore page |
| Discovered – not indexed | Google knows it exists but hasn't crawled it | Improve internal linking + crawl budget |
| Page with redirect | Redirect chain or redirect to wrong target | Shorten redirect chain, verify destination |
Step 1 — Canonical Audit
Next.js App Router (metadata export)
// app/blog/my-post/page.js
export const metadata = {
title: 'My Post Title',
alternates: {
canonical: 'https://www.yourdomain.com/blog/my-post',
},
};
Next.js App Router (generateMetadata)
export async function generateMetadata({ params }) {
return {
alternates: {
canonical: `https://www.yourdomain.com/blog/${params.slug}`,
},
};
}
Common canonical mistakes to fix:
// ❌ WRONG — relative URL
canonical: '/blog/my-post'
// ❌ WRONG — missing trailing slash inconsistency
// (pick one and stick with it sitewide)
// ✓ CORRECT — absolute URL, consistent scheme + subdomain
canonical: 'https://www.yourdomain.com/blog/my-post'
Step 2 — Noindex Audit
Find pages that are accidentally noindexed:
# Search for noindex in metadata
rg -n --glob '*.{js,ts,jsx,tsx}' 'noindex|robots.*noindex' app pages
# Check layout.js — a noindex here affects ALL pages
grep -n "robots" app/layout.js
In Next.js App Router, robots in the root layout applies globally. Only set it there if you want the whole site affected.
// app/layout.js — only set robots if you need sitewide control
export const metadata = {
// ✓ Allow indexing
robots: { index: true, follow: true },
// ❌ This would noindex the entire site:
// robots: { index: false }
};
Step 3 — Sitemap Health
Verify sitemap routes return 200 + valid XML
curl -sI https://www.yourdomain.com/sitemap.xml | grep -i "content-type\|status"
curl -s https://www.yourdomain.com/sitemap.xml | head -20
Next.js App Router sitemap (recommended pattern)
// app/sitemap.js
export default async function sitemap() {
const baseUrl = 'https://www.yourdomain.com';
// Static pages
const staticPages = [
{ url: baseUrl, lastModified: new Date(), changeFrequency: 'daily', priority: 1.0 },
{ url: `${baseUrl}/about`, lastModified: new Date(), changeFrequency: 'monthly', priority: 0.8 },
];
// Dynamic pages (fetch from DB or CMS)
const posts = await getPosts(); // your data fetch
const dynamicPages = posts.map(post => ({
url: `${baseUrl}/blog/${post.slug}`,
lastModified: new Date(post.updatedAt),
changeFrequency: 'weekly',
priority: 0.7,
}));
return [...staticPages, ...dynamicPages];
}
Multiple sitemaps (sitemap index)
// app/sitemap-tools/sitemap.js
// app/sitemap-blog/sitemap.js
// Each returns an array of URL entries
Step 4 — Static Rendering Verification
Pages must be statically generated (or SSR with metadata in HTML) for Google to see SEO tags.
# Check build output — pages should show ● (static) not λ (dynamic)
npm run build 2>&1 | grep -E "○|●|λ|/blog|/tools"
…
Câu hỏi thường gặp
Thẻ canonical là gì?
Đây là chỉ dẫn cho Google biết phiên bản chính của một trang khi nhiều URL có cùng nội dung, giúp tránh nhầm lẫn.
“Noindex” nghĩa là gì?
Đó là chỉ dẫn yêu cầu Google không hiển thị một trang cụ thể trong kết quả tìm kiếm.
“Crawl budget” là gì?
Đó là lượng tài nguyên mà Google dành để thu thập dữ liệu website của bạn. Tối ưu tốt giúp Google dùng ngân sách này cho các trang quan trọng nhất.
Chi tiết
Mô tả gốc của tác giả
Fix SEO indexing issues, crawl budget problems, and Search Console coverage errors for Next.js apps. Covers canonical tags, noindex audits, sitemap health, static rendering, and internal linking.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #5302
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
competitive-platform-analysis
280kGiúp bạn hiểu rõ đối thủ cạnh tranh. Công cụ xác định, phân loại và lọc các công ty cạnh tranh trước khi phân tích sâu hơn.
competitive-report-structure
280kTạo báo cáo đối thủ cạnh tranh toàn diện. Kết hợp thông tin để thể hiện bức tranh chung, đề xuất và giúp đồng đội thống nhất hướng đi.
lead-intelligence
280kGiúp agent tìm và liên hệ với những người quan trọng. Phân tích khách hàng tiềm năng, gợi ý cách tiếp cận và quản lý việc liên lạc qua email và mạng xã hội.