Is there a built-in way to exclude a page from SEO...
# kobweb
a
Is there a built-in way to exclude a page from SEO in Kobweb?
I use the following:
Copy code
LaunchedEffect(Unit) {
        val metaTag = document.createElement("meta") as HTMLMetaElement
        metaTag.name = "robots"
        metaTag.content = "noindex, nofollow"

        document.head!!.appendChild(metaTag)
    }
Which sets the this
<meta name="robots" content="noindex, nofollow">
in the
head
tag.
thank you color 1
s
well, this is tricky. Do you only want it to exclude from Google's indexing? In that case I'd use google search console and exclude it there. Same thing with bing and every other major search engine. Or is the page content critical and must not be crawled by any bots? In that case, norobots can't really be considered safe.
a
Some pages like 404 don't make sense to search in Google and other search engines and find it.
s
for that I wouldn't worry. Google will do this by itself. They don't want to show your 404 page either. Or do you get traffic to it?
a
Still, there are other pages like the user's dashboard which doesn't make sense either, I think they exclude it by default only if the status code of that page is 404.
s
yeah for something like this you can use a norobots file and exclude it in the search console if it pops up
👍 1