nopcommercemetatagnoindex

NopCommerce - using metatag noindex on specific page and language


I have a site that uses 3 languages. The thing is only one of those languages has a specific page. (the client wants each language to be used for each country that he sells to)

I could create a metatag in the header that would ignore the full page, but that would disable indexing that page in all languages.

Is there a way to disable indexing in a page only in specific languages? (using the WorkContext.WorkingLanguage.Id, i.e.)

Thank you.

TZ


Solution

  • Create a HTML helper method that resolves the IWorkContext and checks the language locale for your languages to ignore, then returns a string with the noindex meta tag. Then, call that in your /Shared/_Root.Head.cshtml view