Skip to content

seo-in-astro includes a built-in tool to audit your project’s SEO implementation.

  1. 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())\""
    }
    }
  2. Run the check from your terminal:

    Terminal window
    npm run check-seo

The SEO check tool analyzes four areas of your project:

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 .astro files
  • Pages using SEO layouts: Routes leveraging the library’s layout components (Layout, LayoutForArticle, LayoutForBreadcrumb, LayoutForSoftwareApp, LayoutForFaq)

Verifies how your site handles robot crawling rules:

  • Static file: Checks if robots.txt exists in the public folder
  • Plugin-based: Identifies if the seoInAstro plugin is configured in astro.config.*

Examines your sitemap implementation:

  • Static file: Checks if sitemap.xml exists in the public folder
  • Plugin-based: Identifies if the seoInAstro plugin is configured in astro.config.*

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 seoInAstro plugin for better flexibility
  • Using SEO layouts from @dlcastillop/seo-in-astro for consistent metadata management
  • Ensuring proper sitemap and robots configuration for better crawlability