Skip to content

Instruct search engines

By default, LightNet allows search engines to crawl and index your site.

If search engines such as Google discover your site, they may include its pages in search results.

If you do not want your site to appear on Google or other search engines, you can ask them not to index your site.

Set disallowSearchIndexing to true in your LightNet configuration:

astro.config.mjs
import lightnet from "lightnet";
import { defineConfig } from "astro/config";
export default defineConfig({
integrations: [
lightnet({
disallowSearchIndexing: true,
// ...
}),
],
});

This adds a noindex robots directive to every page. When a search engine crawls a page, the directive tells it not to include that page in search results. The page can still be visited by people who have the link.

Do not combine disallowSearchIndexing directive with a robots.txt file that is configured to block the whole site.

A robots.txt rule like Disallow: / tells search engines not to crawl any page on your site. If a search engine does not crawl a page, it cannot see the noindex directive on that page. As a result, the page may still appear in search results if the search engine already knows about it from before or finds links to it elsewhere.