0

I have noindex enabled in my entire Vue app using { name: 'robots', content: 'noindex' }, but I want to enable it just for some pages. I am using Vue 2 and webpack 4.46.0.

Is there a way to disable noindex for specific pages or should I overwrite it with some custom meta tags or maybe do something else? Thanks in advance.

  • Well are you setting those values in a script? Instead of `'noindex'` you could call a function returning `'index,follow'` or `'noindex,nofollow'`, depending on the current router path. AFAIK navigation using `#` is probably not counted as a different page so Google will not reconsider the robot meta tag when navigating using vue router. – Peter Krebs Mar 13 '23 at 14:35
  • @PeterKrebs , thank you for the quick response. Yes, I am using a function in my `nuxt.config.js` file and my meta look like this: `meta: [...meta({ title, description, homepage })]` and my meta function is defined in another file. However, I am not sure if I will be able to access the route in this nuxt config file. – Georgi Todorov Mar 13 '23 at 14:46
  • Ah yes the headers in this case will be fixed to whatever you set it to. You could use native JavaScript to change the meta robots tag depending on the current route. I doubt Google will observe the change if the page is not reloaded, though. – Peter Krebs Mar 13 '23 at 15:17

0 Answers0