#How to exclude a starlight page from SEO?
7 messages · Page 1 of 1 (latest)
Hi @sour tapir. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
To exclude a Starlight page from SEO, the knowledge sources do not provide a direct, built-in Starlight frontmatter option specifically for excluding a page from search engine indexing (such as adding a noindex meta tag). However, you can add custom tags to a page’s <head> using the head frontmatter field. This allows you to add a <meta name="robots" content="noindex"> tag, which instructs search engines not to index the page:
---
title: Private Page
head:
- tag: meta
attrs:
name: robots
content: noindex
---
This approach is documented as a way to add custom tags to the page’s head, which can include SEO-related meta tags. See the Frontmatter Reference for more details on the head field and its usage.
If you want to exclude a page from Starlight’s internal search (Pagefind), you can set pagefind: false in the frontmatter, but this does not affect SEO or search engine indexing Site Search.
In summary:
- To exclude from SEO, use the head frontmatter to add a noindex meta tag.
- To exclude from Starlight’s search, use
pagefind: falsein the frontmatter.
If you need more advanced SEO exclusion (like removing from sitemaps), the knowledge sources do not provide explicit instructions for Starlight, so you may need to refer to Astro’s broader documentation for further customization.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@sour tapir Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@placid jasper I'm using docsearch, how can I exclude a page there?
Let me check the knowledge base for you again. One moment! :books:
I'm sorry, but the knowledge sources do not contain information about how to exclude a page from Algolia DocSearch when using the Starlight DocSearch plugin. The available documentation covers how to exclude pages from Starlight's default Pagefind search (using the pagefind: false frontmatter), but does not specify a method for excluding pages from DocSearch indexing or results Site Search.