Hướng dẫn về nosnippet

nosnippet kills đó snippet cho một toàn bộ trang; dữ liệu-nosnippet hides chỉ một section. Đó scopes, đó hợp lệ-HTML gotcha, và đó AI Overviews angle.

Xuất bản lần đầu: 23 thg 6, 2026 · Cập nhật lần cuối: 8 thg 8, 2026 · Advanced
Ngôn ngữ

nosnippet và dữ liệu-nosnippet cả hai suppress snippet text, tại khác nhau scopes. nosnippet là một robots directive — một meta-robots giá trị hoặc an X-Robots-Tag header — đó kills đó snippet text và video preview cho đó toàn bộ trang (though một static image thumbnail có thể vẫn cho thấy), xóa featured-snippet eligibility, và (theo Google) drops đó nội dung as một trực tiếp input để AI Overviews và AI Chế độ. dữ liệu-nosnippet là an HTML thuộc tính, hợp lệ chỉ on span/div/section, đó hides chỉ đó wrapped section — từ cả hai regular và featured snippets — trong khi đó rest of đó trang vẫn giữ eligible; đây là một boolean thuộc tính, đó markup phải được hợp lệ, closed HTML hoặc an unclosed tag swallows mọi thứ sau điều này, và dữ liệu có cấu trúc bên trong điều này vẫn giữ usable. nosnippet equals max-snippet:0 cho text; neither touches lập chỉ mục hoặc thứ hạng; Bing hỗ trợ nosnippet nhưng documents không dữ liệu-nosnippet. Google là cũng kiểm thử một tách biệt thuộc tính-cấp độ Tìm kiếm generative AI control trong Search Console.

TL;DR — nosnippet là một robots directive (<meta name="robots" content="nosnippet"> hoặc an X-Robots-Tag: nosnippet header) đó suppresses đó text snippet đó video preview cho đó toàn bộ trang, xóa featured-snippet eligibility, và — theo Google — drops đó nội dung as một trực tiếp input để AI Overviews và AI Chế độ. Cho text điều này equals max-snippet:0, và on conflict đó hơn restrictive rule wins (nosnippet beats max-snippet:50). data-nosnippet là an HTML thuộc tính, hợp lệ chỉ on span/div/section, đó excludes một section — từ cả hai regular và featured snippets; đây là boolean (bất kỳ giá trị là đã bỏ qua), đó markup phải được hợp lệ, closed HTML hoặc an unclosed tag swallows mọi thứ sau điều này, và dữ liệu có cấu trúc bên trong điều này vẫn giữ usable. Neither touches lập chỉ mục hoặc thứ hạng, và nosnippet không bảo đảm zero visuals (một static image thumbnail có thể vẫn cho thấy). Bing honors nosnippet; điều này documents không data-nosnippet.

Evidence for this claim Google's nosnippet directive prevents a text snippet and video preview from being shown for the page in search results. Scope: Google Search presentation; it does not itself remove the URL from the index. Confidence: high · Verified: Google Search Central: Robots directives Evidence for this claim Google's data-nosnippet attribute can exclude text within span, div, and section elements from snippets. Scope: Section-level Google snippet control; valid, well-formed HTML is required. Confidence: high · Verified: Google Search Central: data-nosnippet

Hai controls, hai scopes

Choose by scope: `nosnippet` removes the page preview; `data-nosnippet` excludes only selected HTML from Google's snippet.

Nosnippet is a page-level robots directive that removes the whole text snippet and video preview and prevents direct use in Google AI features. Data-nosnippet is an attribute on a span, div, or section that excludes only the properly wrapped valid HTML. Both control display rather than indexing or ranking.

Đó toàn bộ điều xuất hiện xuống để phạm vi. nosnippet hoạt động tại đó trang cấp độ; data-nosnippet hoạt động tại đó section cấp độ. Mọi người reach cho đó sai một constantly, so giữ này straight:

  • nosnippet — một giá trị trong một robots meta tag hoặc đó X-Robots-Tag header. Toàn bộ-trang suppression.
  • data-nosnippet — an HTML thuộc tính on span/div/section. Một-section suppression.

Cả hai là display controls. They sit alongside đó rest of đó robots meta tag family và đó X-Robots-Tag header, và họ là đó suppression cousins of đó max-snippet / max-image-preview length controls.

nosnippet — đó trang-cấp độ robots directive

Syntax (meta tag và header)

Trong HTML, bạn set điều này on đó robots meta tag:

<meta name="robots" content="nosnippet">

Cho bất cứ điều gì đó không HTML — PDFs, images, other files nơi bạn không thể thêm một <head> — bạn gửi điều này as an HTTP header phản hồi thay vì:

X-Robots-Tag: nosnippet

Giống nhau directive, hai phân phối mechanisms. Đó header route là đó chỉ way để reach non-HTML các tài nguyên.

Điều gì điều này thực ra xóa

Google spec là đơn giản: nosnippet có nghĩa là “Do not show a text snippet or video preview in the search results for this page.” (bản dịch) «Không cho thấy một text snippet hoặc video preview trong đó kết quả tìm kiếm cho này trang.» đó là rộng hơn điều này sounds. Theo đó giống nhau doc, điều này “applies to all forms of search results (at Google: web search, Google Images, Discover, AI Overviews, AI Mode) and will also prevent the content from being used as a direct input for AI Overviews and AI Mode.” (bản dịch) «áp dụng để all forms of kết quả tìm kiếm (tại Google: web tìm kiếm, Google Images, Discover, AI Overviews, AI Chế độ) và sẽ cũng ngăn đó nội dung từ đang dùng as một trực tiếp input cho AI Overviews và AI Chế độ.»

Evidence for this claim Google's nosnippet directive prevents a text snippet and video preview from being shown for the page in search results. Scope: Google Search presentation; it does not itself remove the URL from the index. Confidence: high · Verified: Google Search Central: Robots directives

So một directive làm four điều:

  1. Xóa đó text snippet.
  2. Xóa đó video preview.
  3. Xóa featured-snippet eligibility — Google says nếu bạn muốn một guaranteed way out of featured snippets, nosnippet là điều này.
  4. Xóa đó nội dung as một trực tiếp input để AI Overviews và AI Chế độ.

Một qualification worth knowing: nosnippet không bảo đảm một completely bare listing. Google spec adds đó “a static image thumbnail (if available) may still be visible, when it results in a better user experience.” (bản dịch) «một static image thumbnail (nếu khả dụng) có thể vẫn là visible, khi điều này dẫn đến một tốt hơn người dùng experience.» So bạn là guaranteed không text snippet và không video preview — không nhất thiết zero visuals.

Evidence for this claim Google's nosnippet directive prevents a text snippet and video preview from being shown for the page in search results. Scope: Google Search presentation; it does not itself remove the URL from the index. Confidence: high · Verified: Google Search Central: Robots directives

Nếu bạn không set điều này, đó default là đó “Google may generate a text snippet and video preview based on information found on the page.” (bản dịch) «Google có thể generate một text snippet và video preview dựa trên information được tìm thấy on đó trang.»

Mối quan hệ để max-snippet:0

nosnippet là functionally tương đương để max-snippet:0 cho text — Google documents đó 0 cho max-snippet có nghĩa là “No snippet is to be shown. Equivalent to nosnippet.” (bản dịch) «Không snippet là để là shown. Tương đương để nosnippet Đó khác biệt là đó max-snippet cũng takes positive các giá trị (cap đó snippet tại N characters) nơi nosnippet là all-hoặc-không có gì.

Khi robots rules conflict, đó hơn restrictive một áp dụng. Google own ví dụ: “if a page has both max-snippet:50 and nosnippet rules, the nosnippet rule will apply.” (bản dịch) «nếu một trang có cả hai max-snippet:50nosnippet rules, đó nosnippet rule sẽ apply.»

Evidence for this claim `max-snippet:0` is equivalent to `nosnippet`, and if `nosnippet` conflicts with less restrictive snippet rules it takes precedence. Scope: public web and verified properties as applicable Confidence: high · Verified: Robots meta tag, data-nosnippet, and X-Robots-Tag specifications

data-nosnippet — đó section-cấp độ HTML thuộc tính

Syntax và đó chính thức ví dụ

Bạn designate một chunk of text để là kept out of đó snippet by putting đó thuộc tính on đó element đó wraps điều này. Google: “You can designate textual parts of an HTML page not to be used as a snippet. This can be done on an HTML-element level with the data-nosnippet HTML attribute on span, div, and section elements.” (bản dịch) «Bạn có thể designate textual parts of an HTML trang không để là dùng as một snippet. Này có thể là đã xong on an HTML-element cấp độ với đó data-nosnippet HTML thuộc tính on span, div, và section elements.» Những three elements là đó toàn bộ được phép list — điều này làm không hoạt động on arbitrary tags.

Evidence for this claim Google's data-nosnippet attribute can exclude text within span, div, and section elements from snippets. Scope: Section-level Google snippet control; valid, well-formed HTML is required. Confidence: high · Verified: Google Search Central: data-nosnippet

Ở đây Google own ví dụ, verbatim:

<p>This text can be shown in a snippet
<span data-nosnippet>and this part would not be shown</span>.</p>

<div data-nosnippet>not in snippet</div>
<div data-nosnippet="true">also not in snippet</div>
<div data-nosnippet="false">also not in snippet</div>
<!-- all values are ignored -->

<div data-nosnippet>some text</html>
<!-- unclosed "div" will include all content afterwards -->

đây là một boolean thuộc tính

Notice đó ="true"="false" lines trên behave identically. đó là vì, trong Google words, “The data-nosnippet is considered a boolean attribute. As with all boolean attributes, any value specified is ignored.” (bản dịch) «Đó data-nosnippet là considered một boolean thuộc tính. As với all boolean các thuộc tính, bất kỳ giá trị specified là đã bỏ qua.» Presence là điều gì matters — không bother giving điều này một giá trị, và không assume ="false" turns điều này off. Điều này không.

Đó hợp lệ-HTML requirement (đó chế độ lỗi)

Này là đó part gần như không ai covers, và đây là đó hầu hết phổ biến reason data-nosnippet silently không hoạt động. Google parses đó thuộc tính từ được kết xuất markup, so: “To ensure machine-readability, the HTML section must be valid HTML and all appropriate tags must be closed accordingly.” (bản dịch) «Để bảo đảm machine-readability, đó HTML section phải được hợp lệ HTML và all appropriate tags phải được closed accordingly.»

Xem đó cuối cùng line of Google ví dụ again — <div data-nosnippet>some text</html>. Đó div là không bao giờ closed, và Google comment spells out đó kết quả: đó “unclosed div will include all content afterwards.” (bản dịch) «unclosed div sẽ bao gồm all nội dung afterwards.» Trong other words, an unclosed protected region không hide hơn, điều này hides không có gì — mọi thứ sau đó open tag leaks lại vào đó snippet. Nếu của bạn data-nosnippet không taking, kiểm tra rằng đó wrapping element là thực ra closed.

Đó JavaScript caveat

Một hơn từ đó spec: “To avoid uncertainty from rendering, do not add or remove the data-nosnippet attribute of existing nodes through JavaScript.” (bản dịch) «Để tránh uncertainty từ kết xuất, không thêm hoặc xóa đó data-nosnippet thuộc tính of existing nodes qua JavaScript.» Put điều này trong đó máy chủ-được kết xuất HTML và leave điều này ở đó. Toggling điều này client-side introduces chính xác đó kind of kết xuất ambiguity đó hợp lệ-HTML rule là trying để ngăn. Building elements dynamically là fine — Google hướng dẫn là để set đó thuộc tính tại creation time, không để mutate existing nodes: “When adding DOM elements through JavaScript, include the data-nosnippet attribute as necessary when initially adding the element to the page’s DOM.” (bản dịch) «Khi thêm DOM elements qua JavaScript, bao gồm đó data-nosnippet thuộc tính as necessary khi initially thêm đó element để đó trang DOM.»

Đó section-cấp độ exclusion không limited để regular snippets — một section wrapped trong data-nosnippet là cũng kept out of featured snippets. Và nếu một trang carries cả hai một trang-cấp độ nosnippet và một section-cấp độ data-nosnippet, đó trang-cấp độ rule là đó hơn restrictive một, so điều này takes priority cho đó toàn bộ trang.

data-nosnippet cũng không touch dữ liệu có cấu trúc đó way bạn có thể assume: Google says “structured data remains usable for search results when declared within a data-nosnippet element.” (bản dịch) «dữ liệu có cấu trúc vẫn usable cho kết quả tìm kiếm khi declared trong một data-nosnippet element.» không generalize đó thuộc tính past text snippet eligibility — điều này không an access-control mechanism và điều này không hide images hoặc other media on đó trang; điều này chỉ giữ đó wrapped text out of snippet selection (với đó được ghi lại max-snippet/mô tả-trường nuances Google covers cho dữ liệu có cấu trúc riêng).

Mà một để dùng

Đó decision là gần như luôn về phạm vi và intent:

  • Hide đó toàn bộ snippet (và exit featured snippets / AI Overviews cho đó trang) → nosnippet.
  • Hide chỉ một paragraph hoặc block trong khi đó rest of đó trang giữ của nó snippet → data-nosnippet.
  • Chỉ shorten đó snippet thay vì kill điều này → đó là max-snippet:N, đó length control, không những.
  • Apply điều này để một PDF hoặc other non-HTML fileX-Robots-Tag: nosnippet, since có không <head> để put một meta tag trong.

Removing nội dung từ AI Overviews

Đó 2025–2026 reason một lot of mọi người land on này topic là AI Overviews. Đó mechanics hoạt động — nosnippetdata-nosnippet làm xóa nội dung as một trực tiếp input — nhưng expect latency. Trong Glenn Gabe case nghiên cứu, nosnippet pulled his nội dung out of an AI Overview quickly, nhưng đó effect đã là initially ngắn-lived và đó nội dung reappeared trước điều này settled; sau John Mueller weighed trong, đó removal đã làm ultimately stick — điều này chỉ took lâu hơn để fully xử lý. So nếu bạn apply điều này và đó nội dung vẫn cho thấy, cho điều này time trước assuming điều này failed.

Và mind đó trade-off Gabe flagged: toàn bộ-trang nosnippet cũng strips của bạn thông thường snippet, leaving an awkward, mô tả-ít hơn listing trong đó ten blue links. Nếu bạn chỉ cần để xóa part of đó nội dung từ AI surfaces, section-cấp độ data-nosnippet (hoặc một max-snippet cap) là đó gentler lever.

có cũng một newer, tách biệt control worth knowing về: Google là kiểm thử một thuộc tính-cấp độ “Search generative AI” (bản dịch) «Tìm kiếm generative AI» control trong Search Console — an bao gồm/exclude/inherit setting đó scopes để AI Overviews, AI Chế độ, và generative AI trong Discover. đây là distinct từ trang-cấp độ nosnippet (mà là một theo-trang HTML/header rule) và từ Google-Extended (mà governs AI training và grounding, không Tìm kiếm preview eligibility). Đó rollout là limited, và theo Google, propagation of một thay đổi có thể take một day hoặc hai, hoặc lâu hơn. không reach cho điều này as của bạn default — đây là một Search Console setting layered on top of đó trang-cấp độ controls trên, không một replacement cho them.

Evidence for this claim As of 2026-07-17, Google is testing a separate property-level Search generative AI include/exclude/inherit control for AI Overviews, AI Mode and generative AI in Discover; it does not affect other Search ranking/inclusion or AI training. Scope: public web and verified properties as applicable Confidence: high · Verified: Google common crawlers: Google-Extended

Bing và other engines

MỘT parity caveat worth saying out loud: Bing hỗ trợ nosnippet (và đó snippet-length controls), nhưng Bing làm không document data-nosnippet. Đó section-cấp độ thuộc tính xuất hiện để là Google-cụ thể. Nếu bạn cần section-cấp độ snippet control để hold mọi nơi, chỉ Google bảo đảm điều này — không assume Bing honors một data-nosnippet wrapper.

Apple documents một khác nhau, hữu ích boundary: với nosnippet, Apple có thể vẫn dùng một trang tiêu đề cho matching và phát hiện, nhưng điều này sẽ không dùng đó trang nội dung as context cho generative models. Đó là an Apple-cụ thể dùng-control notice, không một generic claim đó nosnippet xóa đó URL từ phát hiện.

Evidence for this claim Apple says a page marked nosnippet may still be matched or discovered using its title, but the page content is not used as context for generative models. Scope: Applebot and Apple generative-model context use; it does not describe Google, Bing, or generic indexing behavior. Confidence: high · Verified: Apple Support: About Applebot

Đó cost bạn là accepting

đây là worth đang honest đó snippet eligibility là một real, losable asset. I learned đó blunt way với Đó Story of Blocking 2 Cao-Xếp hạng Các trang Với Robots.txt — khi I blocked hai of của chúng ta xếp hạng các trang trong robots.txt, đó hầu hết visible casualty đã là đó they lost all of của họ featured snippets. Đó đã là robots.txt, không nosnippet, nhưng đó lesson transfers: giving lên snippet eligibility là một deliberate cost. Đó khác biệt là đó nosnippetdata-nosnippet let bạn cho điều này lên precisely — toàn bộ trang hoặc một section, on purpose — thay vì as collateral damage từ một crawl block. Spend điều này nơi đây là worth spending.

Add an expert note

Pin an expert quote

New person? Create their unclaimed profile at /admin/experts/ → Pin a quote first.