Noindex Cart Pages

Shannon_Hyland
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
Jason
Shopify Expert
10360 158 2005

What's not working? 

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.


★ http://freakdesign.com.au ★
0 Likes
Caroline_Schnap
Shopify Staff
Shopify Staff
5710 1 350

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
0 Likes
Shannon_Hyland
New Member
6 0 0

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

0 Likes
Caroline_Schnap
Shopify Staff
Shopify Staff
5710 1 350

No, you cannot access that file.

0 Likes
Hightmar
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
arougeot
Shopify Partner
8 0 0

HighMar, have you managed to exclude properly  ?

0 Likes
brouskoff
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
SeanBobby
New Member
1 0 0

Did you figure out the solution to this issue?

 

Cheers,

Sean

0 Likes
brouskoff
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