Velohost Velohost

Astro & SEO

Astro Canonical Plugin FAQs

Clear answers explaining how Astro Canonical enforces canonical URL correctness at build time.

Answers

Why does Astro Canonical exist?

Canonical URL errors are often invisible until SEO damage is done. Astro Canonical makes canonical correctness non-optional by enforcing it at build time.

Does Astro Canonical add runtime overhead?

No. The plugin runs exclusively during astro build and produces no runtime code.

What validation rules are enforced?

Each HTML page must include a canonical tag, the URL must be absolute, must start with the configured site, and must respect trailing-slash rules if configured.

How does trailing slash enforcement work?

astro-canonical reads your trailingSlash setting from astro.config.mjs and enforces canonical URLs to match it exactly.

What if trailingSlash is not configured?

If trailingSlash is not set, the plugin enforces canonical presence, absolute URLs, and site matching but does not enforce trailing-slash rules.

Are 404 pages validated?

No. 404.html files are ignored automatically.

What happens when a violation is found?

The build fails immediately and prints a detailed summary of invalid canonicals.

What does the validation output look like?

A clear build-time summary listing the site, trailing-slash policy, files scanned, and any invalid canonicals found.

Does the plugin modify HTML output?

No. Astro Canonical only validates output — it never modifies HTML.

Is Astro Canonical open source?

Yes. Astro Canonical is fully open source and released under the MIT license.

Want to try it yourself? Astro Canonical plugin or Astro Security plugin or Astro IndexNow plugin

Ready to enforce canonical correctness in your Astro project?