If you want to control exactly how much of your page Google and AI answer engines can quote, you use three directives: nosnippet (show no text snippet at all), max-snippet (cap the snippet at a set number of characters), and data-nosnippet (hide a specific element on the page from being quoted). They are robots directives, not robots.txt rules, and they work at the page or element level rather than blocking the crawl entirely.

What each directive actually does

These three controls solve different problems, and mixing them up is the most common mistake:

The key distinction: nosnippet and max-snippet are page-wide and live in the robots meta tag or the X-Robots-Tag HTTP header. data-nosnippet is surgical and lives in your HTML markup.

How to set them correctly

For a whole page, add a meta tag in the <head>:

For non-HTML files like PDFs, you cannot add a meta tag, so you use the X-Robots-Tag HTTP header instead — the same directives apply. We cover that delivery method in depth in our X-Robots-Tag guide.

For a single element, wrap it in a tag carrying the data-nosnippet attribute — for example a paragraph or a span. Everything inside that element is excluded from snippets, but Google still crawls and indexes it. This is useful for boilerplate, disclaimers, or a login-gated teaser you do not want lifted verbatim into an answer.

When to use snippet control — and when not to

Most sites should not restrict snippets. If your goal is to get cited by ChatGPT, Perplexity, or Google AI Overviews, the snippet is your entry ticket — restricting it removes you from exactly the surfaces you want to appear in. If you are unsure how AI systems decide what to quote, read our breakdown of how ChatGPT chooses which websites to cite.

There are a few legitimate reasons to limit snippets. Paywalled publishers use max-snippet to preview a controlled amount of text without giving the whole article away. Some sites use data-nosnippet on price or availability blocks that change frequently, so a stale quoted price does not appear in results. And a few brands cap snippet length to force searchers to click through rather than getting their full answer in the SERP.

Weigh this carefully against the zero-click reality. In many niches the answer is consumed in the result itself, and fighting that with nosnippet often just means you lose the impression entirely. Our zero-click search strategy covers how to earn value even when the click never happens.

Common mistakes that backfire

Do not try to control snippets through robots.txt — blocking a URL there prevents crawling but does not remove snippets; Google can still show a snippet built from external signals. Snippet directives only work when the bot is allowed to crawl the page and read the meta tag or header.

Do not apply nosnippet site-wide by accident. A blanket X-Robots-Tag rule on your server can silently strip every page from AI answers, and because nothing visibly breaks, it often goes unnoticed for months. Check your response headers before assuming your content is eligible.

Finally, remember that data-nosnippet hides text from snippets but not from indexing — it is not a privacy tool. Anything sensitive still belongs behind authentication, not behind an attribute.

Not sure whether your pages are sending nosnippet, max-snippet, or X-Robots-Tag directives you never intended? Run the free CheckMy.site scanner to see the exact robots directives and headers each of your pages returns to crawlers and AI bots — and catch the ones quietly keeping you out of AI answers.