Ad

Hide The Catalog Page On Shopify

- 1 answer

Is there a way to hide the catalog page in Shopify? Here is more detail about the Shopify catalog page.

Ad

Answer

You might add an automatic javascript redirection to home when collection URL contains 'all'.

So this could be something like this in collection template in your theme :

{% if collection.handle == 'all' %}
    <script>window.location.href = '{{ shop.url }}';</script>
{% else %}
    Usual code for collection template display if this is not the 'all' collection.
{% endif %}

Please note that is NOT RECOMMENDED practice. For example, if your customer has disabled Javascript, the page content will be blank as redirection won't work.

A better practice would be to not index page in search engines, so if there is no internal link and if search engines do not index it, no one will see it.

To do that, open the 'theme.liquid' template, and then, add this in <head> section :

{% if collection.handle == 'all' %}
<meta name="robots" content="noindex">
{% endif %}

HTH

Ad
source: stackoverflow.com
Ad