Skip to main content

Hide Generated Products from Search and Index

Question​

> The products generated by the configurator appear in Shopify search, on Google, and are crawled by bots (e.g., Pinterest). How can I hide them?

Answer​

K3 automatically adds a tag to every generated product: k3-generated

With this tag, you can remove the products from the store search, make them invisible to search engines, exclude them from collections, and prevent bots from accessing the K3 app URL.

Items must remain published

For K3 to add an item to the cart, it must be published and listed in Shopify. A completely unpublished item cannot be added to the cart. The following measures ensure that the products remain invisible to end customers and search engines.

Overview of Measures​

MeasureWhat it does
1. Filter store searchEnd customers can no longer find the products via the store search
2. Prevent search engine indexingGoogle, Bing, Pinterest, and others do not include the product pages in their index
3. Exclude from collectionsThe items do not appear on collection pages or in the navigation
4. Block bot crawling of the app URLCrawlers no longer access the /apps/k3/ route

1. Filter items from the store search​

Purpose: End customers using the store search will not see K3-generated items in the results.

The Shopify Search & Discovery app allows you to exclude products from search results based on tags—including from the Search API and Predictive Search. Set up a rule there to hide products with the tag k3-generated.

Option B – Liquid Filter in the Theme​

Alternatively, you can filter the search results in the theme template:

{% unless product.tags contains 'k3-generated' %}
<!-- Produkt anzeigen -->
{% endunless %}
Note on the Liquid filter

The Liquid filter only hides the items in the rendered view. The Shopify Search API (/search.json, Predictive Search) will continue to return the results. If you want to remove the products completely from search results, use Option A.


2. Prevent search engine indexing (noindex)​

Purpose: Search engines such as Google, Bing, and Pinterest do not include the product pages in their search index. This prevents the products from appearing in external search results.

In the theme layout (theme.liquid) in the <head> section:

{% if product.tags contains 'k3-generated' %}
<meta name="robots" content="noindex, nofollow">
{% endif %}
What about the sitemap?

Shopify automatically includes all published products in the sitemap—there’s no way to prevent this. But that’s not a problem: If a crawler finds the page via the sitemap and sees the noindex tag there, the page will not be included in the index. The sitemap directs the crawler to the page, while the noindex tag prevents indexing.


3. Exclude from Collections​

Purpose: The generated items do not appear on collection pages and therefore cannot be found via the store navigation.

In the Shopify admin, under Collections → Conditions, set:

> Tag does not contain k3-generated

Then these items won’t be included in the collection in the first place.

Option B – Liquid filter in the collection template​

{% for product in collection.products %}
{% unless product.tags contains 'k3-generated' %}
<!-- Produkt anzeigen -->
{% endunless %}
{% endfor %}

4. Block bot crawling of the app URL (robots.txt)​

Purpose: Search engine bots and other crawlers (e.g., Pinterest, GPTBot) will no longer directly access the K3 app route /apps/k3/.

K3 creates the article once per configuration, specifically when the configuration is saved. Accessing this URL does not generate a new article. Crawlers still generate unnecessary requests there, however. The entry in robots.txt instructs compliant crawlers to ignore this route.

Shopify allows you to customize the robots.txt via a theme template. Create the file templates/robots.txt.liquid in your theme with the following content:

Note the indentation

The template must not be indented. Any space in the template is carried over directly into the robots.txt output—leading spaces before Disallow: rules invalidate the robots.txt.

{%- for group in robots.default_groups %}
{{- group.user_agent -}}
{%- for rule in group.rules %}
{{- rule -}}
{%- endfor %}
Disallow: /apps/k3/
{% endfor -%}
Shopify comment block

The Shopify default includes a comment block at the beginning of the robots.txt that informs bot operators of the Shopify Terms of Service (no automated checkout without human confirmation). This block cannot be retrieved via Liquid and is omitted when using a custom template. If you want to keep it, you can manually copy it to the beginning of the template:

# we use Shopify as our ecommerce platform

# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ Robots & Agent policy ┃
# ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
# ┃ Checkouts are for humans. ┃
# ┃ * Automated scraping, "buy-for-me" agents, or any end-to-end flow ┃
# ┃ that completes payment without a final human review step is not ┃
# ┃ permitted. ┃
# ┃ * Legitimate integrators must use the official Checkout Kit: ┃
# ┃ https://www.shopify.com/checkout-kit ┃
# ┃ ┃
# ┃ Terms of Service: https://www.shopify.com/legal/terms ┃
# ┃ Contact: bots@shopify.com ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Restriction

The robots.txt is only recognized by compliant crawlers (e.g., Googlebot, Bingbot, Pinterest crawler). Link previews (WhatsApp, Slack, iMessage) and some marketing bots ignore robots.txt. Therefore, this measure is a useful supplement to the other measures, but not a standalone protection.


Cleanup: Delete Old Generated Products​

The measures mentioned above prevent generated products from being visible—but the products themselves remain in Shopify. To keep your store clean, you can regularly delete old K3-generated products that are no longer needed.

Manually: In the Shopify admin, under Products, filter by the tag k3-generated and delete older entries without associated orders.

Automated: Using Shopify Flow, you can set up a workflow that automatically deletes K3-generated products after a defined period (e.g., 30 days), provided no active order is linked to them.


Additional Information​