SEO Check Tool
seo-in-astro includes a built-in tool to audit your project’s SEO implementation.
-
Add the following script to your
package.json:package.json {"scripts": {"check-seo": "node --input-type=module -e \"import('@dlcastillop/seo-in-astro/tooling').then(m => m.checkSeo())\""}} -
Run the check from your terminal:
Terminal window npm run check-seoTerminal window yarn check-seoTerminal window pnpm check-seo
What it checks
Section titled “What it checks”The SEO check tool analyzes four areas of your project:
1. Page Metadata
Section titled “1. Page Metadata”Identifies the metadata status for each page in your application:
- Pages without metadata: Routes that are missing SEO metadata configuration
- Pages with manual metadata: Routes using frontmatter metadata directly in
.astrofiles - Pages using SEO layouts: Routes leveraging the library’s layout components (
Layout,LayoutForArticle,LayoutForBreadcrumb,LayoutForSoftwareApp,LayoutForFaq)
2. Robots Configuration
Section titled “2. Robots Configuration”Verifies how your site handles robot crawling rules:
- Static file: Checks if
robots.txtexists in thepublicfolder - Plugin-based: Identifies if the
seoInAstroplugin is configured inastro.config.*
3. Sitemap Configuration
Section titled “3. Sitemap Configuration”Examines your sitemap implementation:
- Static file: Checks if
sitemap.xmlexists in thepublicfolder - Plugin-based: Identifies if the
seoInAstroplugin is configured inastro.config.*
4. Improvement Suggestions
Section titled “4. Improvement Suggestions”Based on the analysis, the tool provides actionable recommendations to enhance your SEO setup, such as:
- Adding metadata to pages that are missing it
- Migrating from static files to the
seoInAstroplugin for better flexibility - Using SEO layouts from
@dlcastillop/seo-in-astrofor consistent metadata management - Ensuring proper sitemap and robots configuration for better crawlability