Noindex Cart Pages

New Member
6 0 0

Hello,

Would like to noindex cart/checkout pages. 

I have tried the following with no luck.

{% if template contains 'cart' %}

{% if template == 'cart' %}

 

Help please.

 

0 Likes
Shopify Expert
9807 92 1560

What's not working? 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Shopify Staff
Shopify Staff
5704 0 287

Hi Shannon!

All Shopify stores have a robots.txt file — yours does too — that tell search engines to not index your cart page. So that's taken care of for you.

Your robots.txt file includes this:

Disallow: /cart
Caroline from http://11heavens.com ∴ mllegeorgesand AT gmail DOT com
0 Likes
New Member
6 0 0

Thanks Caroline. I see that in the robots file. Can we access the robots file at all?

0 Likes
Shopify Staff
Shopify Staff
5704 0 287

No, you cannot access that file.

Caroline from http://11heavens.com ∴ mllegeorgesand AT gmail DOT com
0 Likes
Tourist
10 0 1

Hello,
I allow myself to go back to the subject because now Google indexes the checkout and login pages despite the robots.txt. There must be a tag <meta content="noindex" /> on the page to avoid indexing.

I've tried:

 

{% if template contains 'account/login' %}
<meta name="robots" content="noindex">
{% endif %}

 

{% if template contains 'checkout' %}
<meta name="robots" content="noindex">
{% endif %}

 

But still no tag "noindex".

Capture.PNG

0 Likes
Shopify Partner
4 0 0

HighMar, have you managed to exclude properly  ?

0 Likes
New Member
2 0 0

Bonjour,

 

As tu solutionné ton problème, j'ai exactement la même chose dans la Google Console ?

 

Cdlt

0 Likes
New Member
1 0 0

Did you figure out the solution to this issue?

 

Cheers,

Sean

0 Likes
New Member
2 0 0

No for the checkout page, because the code of this page is also available to the Shopify Side. We can't modify it !

 

for the other one I add this line on the "Theme.liquid" page : 

 

{% if template contains 'cart' %}
<meta name="robots" content="noindex">
{% endif %}
{% if template contains 'login' %}
<meta name="robots" content="noindex">
{% endif %}
{% if template contains 'register' %}
<meta name="robots" content="noindex">
{% endif %}
{% if template contains 'search' %}
<meta name="robots" content="noindex">
{% endif %}
{% if template contains '404' %}
<meta name="robots" content="noindex">
{% endif %}

0 Likes