noindex a whole page directoru
is there a way to noindex a whole page directory in nuxt3? currently we are adding noindex to useHead on every page we dont want indexed
page
---dir1 (we want to noindex this dir1 and all pages under it dir1/** )
---dir2
---dir3
dir3/page1
dir3/page2
how to achieve this? thanks
6 Replies
Have you thought about combining
routeRules
with the X-Robots-Tag
header?
For example:
Or if you prefer the meta tags over headers, use a nitro plugin to hook into the rendering of the html:
@cuebit thanks I will try both!
just use robots.txt
or nuxt/robots
above solutions are just as good though
@harlan I tried that but im having thse warning/errors regarding the runtime package
π€
which nuxt version out of interest?
@harlan im running nuxt 3.10.3