Velohost Velohost

Astro Integration

Astro NoIndex

Protect non-production Astro sites from search engine indexing — safely, explicitly, and at build time.

Usage snapshot

95
Downloads in the last 30 days
Latest npm version · v1.0.0
Source: npm registry

Why this plugin exists

Accidental indexing of staging and preview sites is a common and costly SEO mistake.

astro-noindex prevents this by enforcing noindex rules during the build process, not at runtime.

The result is deterministic, adapter-agnostic, and immune to environment misconfiguration.

What it delivers

Design principles

  • Build-time enforcement only
  • Explicit allow-listing
  • No environment guessing
  • No runtime middleware
  • Respect existing SEO decisions

What this plugin does

  • Injects noindex, nofollow meta tags at build time
  • Explicit hostname allow-listing
  • Never overrides existing robots meta tags
  • Works with static and hybrid output
  • Adapter-agnostic and CDN-safe
  • Zero runtime JavaScript

Installation

npm install astro-noindex

The plugin runs during astro build and injects noindex directives into generated HTML when the site hostname is not allow-listed.

Project links

Source code, releases, documentation, and contribution guidelines.

Want the deep dive?

Read the FAQs for implementation details, design rationale, and integration guidance.

View plugin FAQs