Check 04.05 · Indexing and canonicalization

Keep customer accounts and carts out of the index

Remove cart, checkout, customer account and add-to-cart links from the index with noindex, robots.txt or login, on WooCommerce, Shopify, PrestaShop or Magento.

Priority
Critical
Difficulty
Intermediate
Estimated time
1 to 2 h
Free, no account: your progress is saved in this browser.

Ask an AI to check this point on your site

Opens the assistant with a ready-made question: this check, its goal and your site URL.

For Gemini, Copilot or another assistant, copy the question. The link opens the chosen service directly: nothing goes through this site.

In short

The cart, the checkout flow, the customer account area, the login and sign-up pages, the wishlist and add-to-cart links have no business in search results. Each page of this kind must either require a login, carry a noindex directive or be disallowed from crawling in robots.txt, depending on its role. Once the check is done, none of these URLs appears in Google’s or Bing’s index, none is listed in a sitemap, and bots no longer waste time on add-to-cart variants.

Why it matters

These pages are personal or transactional. For a bot arriving without a session, a cart is empty, an account redirects to the login page, an order confirmation makes no sense. Once indexed, they produce useless results (“Your cart is empty”), soft 404s and duplicates of the login page.

The most tangible cost is crawling. A store that shows an add-to-cart button as a GET link on every product page and every category creates one URL per product (?add-to-cart=123), sometimes combined with filters and sorting. Bots can spend a significant share of their time on these URLs instead of your product pages.

Three mechanisms exist, and they should not be combined on the same URL:

  • Authentication: the only real protection for customer data. An anonymous request to /mon-compte/commandes must receive a redirect to the login page, a 401 or a 403.
  • noindex: the page remains crawlable, the search engine reads it and removes it from the index. Suited to the cart and to public pages with no value.
  • Disallow in robots.txt: the bot no longer requests the URL. Suited to action links and infinite variants. A blocked URL that receives links can, however, stay in the index without content, because the bot does not see any noindex it may carry.

These exclusions target search engine indexes. They do not prevent a visitor, or an assistant browsing on their behalf, from using the cart and the checkout flow.

What it improves

  • Index quality Fewer useless URLs, fewer soft 404s and duplicates reported in Search Console.
  • Crawling Bots spend their time on product and category pages. A noticeable effect on large catalogs, a small one on a small store.
  • Privacy Account pages that require a login cannot be read by a bot.
  • Experience from search No more visitors landing on an empty cart from Google.
  • Rankings No direct effect.

How to check

1. What is already indexed. Search in Google and Bing, for example:

site:example.com inurl:panier
site:example.com inurl:cart
site:example.com inurl:mon-compte
site:example.com inurl:add-to-cart

The site: operator is not exhaustive, but a single result is enough to flag the problem. In Search Console’s Page indexing report, open “Indexed” and filter the examples on these paths.

2. Directives per page.

for u in /panier /commande /mon-compte /connexion /liste-de-souhaits; do
  printf "%-20s " "$u"
  curl -s -o /tmp/p.html -D /tmp/h.txt -w "%{http_code} " "https://example.com$u"
  grep -i -o "x-robots-tag:.*" /tmp/h.txt | tr -d '\r' | tr '\n' ' '
  grep -i -o -E '<meta[^>]+name="robots"[^>]*>' /tmp/p.html | head -n 1
  echo
done

Adapt the paths to your platform (/cart, /checkout, /my-account, /customer/account). Expected result: noindex on the cart and on public pages with no value, a redirect (302) or 401/403 on account pages.

3. robots.txt. curl -s https://example.com/robots.txt: action links (add-to-cart) and the paths you chose to block are listed, and no path carrying a noindex that still needs to be read.

4. Sitemaps. None of these URLs should appear in your sitemaps: curl -s https://example.com/sitemap.xml | grep -i -E "cart|panier|account|compte|checkout|commande".

5. Cache. Account and cart pages must send Cache-Control: private, no-store, otherwise a shared cache may serve one visitor’s cart to another; see configure browser and server caching (opens in a new tab).

How to implement

Before you start

Inventory and method by page type:

Page Example URL Method
Customer account, orders, addresses, invoices /mon-compte/… authentication (redirect to login); noindex on the login page
Login, sign-up, forgotten password /connexion, /inscription noindex
Cart /panier, /cart noindex, or Disallow if the platform already does it and no URL is indexed
Checkout flow, confirmation /commande, /checkout noindex or Disallow, plus Cache-Control: private, no-store
Add to cart, wishlist or comparison links ?add-to-cart=123 Disallow
Wishlist, comparison /liste-de-souhaits noindex

Rules:

  • A URL that is already indexed must first be crawlable with noindex to leave the index. Only add the Disallow afterwards, if you want to save crawling.
  • Remove these URLs from sitemaps. A URL that is submitted and noindex shows up as an error in Search Console.
  • Action buttons submit a POST form when your platform allows it. Bots do not submit forms, so the add-to-cart URL problem disappears.
  • Do not block resources (CSS, JavaScript, public APIs) that product pages need to render.

Example robots.txt block to adapt:

User-agent: *
Disallow: /*add-to-cart=
Disallow: /*add_to_wishlist=
Disallow: /checkout/
Disallow: /commande/

Apache

Versions Apache 2.4.

To set the header on paths generated by the application, in the virtual host (mod_headers enabled):

<If "%{REQUEST_URI} =~ m#^/(panier|commande|connexion|inscription|liste-de-souhaits)(/|$)#">
    Header set X-Robots-Tag "noindex"
    Header set Cache-Control "private, no-store"
</If>

Reload with sudo apachectl configtest && sudo systemctl reload apache2. In a .htaccess, <If> also works since Apache 2.4.

Nginx

Versions Nginx 1.18 and later.

location ~ ^/(panier|commande|connexion|inscription|liste-de-souhaits)(/|$) {
    add_header X-Robots-Tag "noindex" always;
    add_header Cache-Control "private, no-store" always;
    try_files $uri $uri/ /index.php?$query_string;
}

Adapt the last line to your application (proxy_pass for Node.js, for example), and repeat the server block’s security headers in this block. Reload with sudo nginx -t && sudo systemctl reload nginx.

Cloudflare

Versions Cloudflare dashboard, all plans, November 2026.

In the Rules Overview, create a response header transform rule with the expression:

(http.request.uri.path matches "^/(panier|commande|connexion|liste-de-souhaits)") or (http.request.uri.path contains "/my-account")

Action: set the X-Robots-Tag header to noindex. The matches operator (regular expressions) depends on your plan; otherwise, combine several starts_with conditions. Also check that no cache rule includes these paths.

WordPress

Versions WordPress 6.4 and later, WooCommerce 9 to 11, Yoast SEO 20 and later, Rank Math 1.0.

WooCommerce itself adds noindex, follow to the Cart, Checkout and My account pages defined in WooCommerce > Settings > Advanced, and recent versions remove them from the native WordPress sitemap. Check this with curl, then:

  • Yoast SEO or Rank Math: leave these pages set to noindex in the plugin too, so they drop out of its sitemap. Do not force them to be indexed.
  • Wishlist or comparison pages added by a plugin: set them to noindex in the SEO plugin’s Advanced tab.
  • Add-to-cart links: WooCommerce generates ?add-to-cart=ID links on archives. Add Disallow: /*add-to-cart= to robots.txt, through your SEO plugin’s robots.txt editor or in the physical file.
  • Cache: check that the caching plugin excludes the cart, checkout and account pages.

Shopify

Versions Shopify admin and Online Store 2.0 themes, all plans, November 2026.

Shopify’s default robots.txt already blocks the cart, the checkout flow, the customer account and orders (/cart, /checkout, /checkouts/, /account, /orders). There is nothing to add for these paths; simply check your /robots.txt if the theme contains a customized robots.txt.liquid file. For a wishlist page created by an app, use the seo.hidden metafield or a condition on its handle in layout/theme.liquid:

{% if handle == 'liste-de-souhaits' %}
<meta name="robots" content="noindex">
{% endif %}

PrestaShop

Versions PrestaShop 8 and 9.

In Shop Parameters > Traffic & SEO, generate the robots.txt file (button at the bottom of the page). The file PrestaShop produces blocks the rewritten URLs and the controller= parameters for the cart (cart), checkout (order, order-confirmation), account (my-account, identity, addresses, history), login (authentication, password) and search. Regenerate it after each new language or rewritten URL change, and check the result at /robots.txt. Modules that add pages (wishlist, comparison) must be checked one by one.

Magento

Versions Magento Open Source and Adobe Commerce 2.4.

In Content > Design > Configuration, edit the global or website configuration, “Search Engine Robots” section. Leave “Default Robots” set to INDEX, FOLLOW and add at least the following to the robots.txt custom instructions:

User-agent: *
Disallow: /checkout/
Disallow: /customer/
Disallow: /wishlist/
Disallow: /catalog/product_compare/

The Adobe Commerce documentation offers a more complete list. Save, flush the cache, then check /robots.txt.

Wix

Versions Wix Editor and Wix Studio, all plans, November 2026.

Member pages and store pages (cart, thank-you) are set page by page: in each page’s SEO settings, turn off the option that lets search engines index the page. Wix notes that some member pages must be hidden manually.

Laravel

Versions Laravel 10 to 13.

Group the routes concerned, protect the account with auth and set the header with a middleware:

Route::middleware(SetRobotsHeader::class.':noindex')->group(function (): void {
    Route::get('/panier', [CartController::class, 'show'])->name('cart');
    Route::get('/connexion', [LoginController::class, 'create'])->name('login');

    Route::middleware('auth')->group(function (): void {
        Route::get('/mon-compte', [AccountController::class, 'show'])->name('account');
    });
});

The SetRobotsHeader middleware is described in check meta robots and X-Robots-Tag (opens in a new tab). An anonymous visitor is redirected to /connexion by the auth middleware. Use Route::post for adding to the cart rather than a GET link.

Next.js

Versions Next.js 15 and 16 (App Router).

Place the pages concerned in a route group with its own layout:

// app/(prive)/layout.js
export const metadata = {
  robots: { index: false, follow: true },
};

export default function PrivateLayout({ children }) {
  return children;
}

The pages app/(prive)/panier/page.js and app/(prive)/mon-compte/page.js inherit the directive. Check the session server-side for the account, and declare the paths to block in app/robots.js:

export default function robots() {
  return {
    rules: [{ userAgent: '*', allow: '/', disallow: ['/checkout/'] }],
    sitemap: 'https://example.com/sitemap.xml',
  };
}

Common mistakes

  • Disallow and noindex on a URL that is already indexed: the bot no longer sees the noindex, and the URL stays in the index without content.
  • Relying only on robots.txt for the customer area: a public file is not protection; authentication is.
  • Leaving these pages in the sitemap: Search Console reports URLs that were submitted but excluded.
  • Forcing WooCommerce pages to be indexed to make a warning go away: the warning goes away, the problem arrives.
  • Blocking /*?* to get rid of add-to-cart links: you also block useful pagination and filters.
  • Caching the cart or the account: risk of leaking information from one customer to another.
  • Forgetting language variants: /en/cart, /de/warenkorb need the same rules as the main language.

Frequently asked questions

Should I block the cart page in robots.txt or use noindex?

Both methods work, but not together on a URL that is already indexed. Use noindex if cart pages are in the index: the bot must be able to read them to remove them. Blocking through robots.txt is suitable when no URL is indexed and you want to save crawling, as Shopify and PrestaShop do by default. In every case, remove the cart from your sitemaps.

Search Console reports “Excluded by ‘noindex’ tag” on my WooCommerce pages: is that a problem?

No, if these URLs are the cart, checkout or My account. WooCommerce deliberately adds noindex to them, and that is the desired behavior. The warning usually comes from a sitemap that still lists these pages: exclude them from your SEO plugin’s sitemap while keeping them noindex. Above all, do not force them to be indexed just to make the message disappear.

Is noindex enough to protect the customer account area?

No. Noindex only asks search engines not to show the page in their results; it does not stop anyone from downloading it. Pages that contain customer data, such as orders, addresses or invoices, must require a server-side login and redirect an anonymous visitor to the login page. Reserve noindex for public pages with no value, such as the login page or the cart.

Updated on

Topic checklist (PDF)

And now?

In the “Indexing and canonicalization” topic

  1. Check that the homepage is indexed
  2. Check strategic pages
  3. Check meta robots and X-Robots-Tag
  4. Remove accidental noindex tags
  5. Keep customer accounts and carts out of the index
  6. Handle internal search results with no SEO value
  7. Protect staging and private data with authentication
  8. Analyze pages discovered but not indexed
  9. Analyze pages crawled but not indexed
  10. Fix abnormal exclusions
  11. Fix soft 404s
  12. Check canonicals and absolute URLs
  13. Use self-referencing canonicals where relevant
  14. Align canonicals, sitemap and internal links
  15. Identify and consolidate duplicates
  16. Control parameterized URLs
  17. Standardize HTTP/HTTPS and www/non-www
  18. Compare declared and Google-selected canonicals
  19. Check Bing indexing
  20. Monitor indexing reports