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/commandesmust 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.Disallowin 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 anynoindexit 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
noindexto leave the index. Only add theDisallowafterwards, if you want to save crawling. - Remove these URLs from sitemaps. A URL that is submitted and
noindexshows up as an error in Search Console. - Action buttons submit a
POSTform 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
noindexin 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
noindexin the SEO plugin’s Advanced tab. - Add-to-cart links: WooCommerce generates
?add-to-cart=IDlinks on archives. AddDisallow: /*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
Disallowandnoindexon a URL that is already indexed: the bot no longer sees thenoindex, 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/warenkorbneed 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.
Do add-to-cart links waste crawl budget?
They can on a large catalog. A GET add-to-cart link, such as ?add-to-cart=123, creates one URL per product, sometimes multiplied by filters and sorting, which bots crawl without finding anything useful. Block this parameter in robots.txt and, when the platform allows it, use a POST form for adding to the cart. On a small store, the effect is minor.
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.
Resources
- Google: Block indexing with noindexdevelopers.google.com
- Google: Introduction to robots.txtdevelopers.google.com
- Google: Large site owner’s guide to managing your crawl budgetdevelopers.google.com
- Shopify: Hide a page from search engineshelp.shopify.com
- Adobe Commerce: SEO overview and robotsexperienceleague.adobe.com
- Wix: Preventing search engines from indexing your pagesupport.wix.com
- Next.js: robots filenextjs.org
Updated on
Topic checklist (PDF)