Implement 'noindex' tags on specific pages using Liquid
On this page
Use this process to keep specific pages out of search engine results by adding a Liquid template to the content block in your store’s HTML Head Content Block field. The template inserts a noindex meta tag when the visitor is on one of the paths you list.
Before you start
You need a store where you can edit the content block in its HTML Head Content Block field. See Adding custom JavaScript, CSS and head content.
Add the noindex template
-
Open the Store record and find the Global Content section.

- Open the content block in the HTML Head Content Block field, or create a new one and set it there.
- Paste this Liquid into the block’s Content field.
```liquid
{% assign noindex_pages = "/omnico,/omnico/conservation,/omnico/products/water-conservation" | split: "," %}
{% assign path_to_check = current_request.path | strip_newlines | strip %}
{% assign is_noindex = false %}
{% for page in noindex_pages %}
{% if page == path_to_check %}
{% assign is_noindex = true %}
{% endif %}
{% endfor %}
{% if is_noindex %}
<meta name="robots" content="noindex">
{% endif %}
```
-
Replace the values in
noindex_pageswith the paths you want to exclude, as a comma-separated list. Each path is compared tocurrent_request.pathexactly, so write it with a leading slash and no domain, for example/summer-sale. A path without the leading slash never matches.:::note On a store mounted at a path,
current_request.pathincludes that store path, so/summer-saleon a store mounted at/auis/au/summer-sale. Either include the store path in your list, or swapcurrent_request.pathforcurrent_request.local_path, which strips it. ::: -
Select Save.
Verify the tag is present
- Open one of the excluded pages on your live storefront and refresh it.
-
View the page source and search it for
noindex.
The <meta name="robots" content="noindex"> tag now appears in the <head> of every page you listed, and on no others. Search engines drop those pages from their index at their next crawl, which can take days or weeks.
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.