The short answer

Add data-nosnippet to the span, div or section around the public text you want excluded from Google snippets. Close the element at the intended boundary and inspect the published HTML. To let that text supply snippets again, remove the entire attribute.

On this page
  1. Choose the exact text to exclude
  2. Wrap the notice in a supported element
  3. Remove the attribute to stop excluding the block
  4. Check the published boundary
  5. Sources & further reading

Choose the exact text to exclude

Use data-nosnippet when one piece of public page text should be excluded from Google's text snippets. The rest of the page can still supply snippet text. Google selects snippets for the particular search and may use either page content or a suitable meta description.

For example, a fictional weaving studio wants its course summary available for search previews. A daily booking notice changes often, so the editor chooses to exclude that notice. Visitors should still be able to read it on the course page.

Decide the boundary before editing. If the attribute lands on the container around the entire article, it covers much more text than the booking notice. Keep the course summary and useful visit details outside the marked block.

Wrap the notice in a supported element

Google supports the attribute on span, div and section. This example uses a div around one paragraph.

<p>Learn basic weaving in a two-hour class at Cedar Studio.</p>
<div data-nosnippet>
  <p>Call the studio to confirm today's remaining places.</p>
</div>
<p>Materials are included. Contact us about step-free access.</p>

The closing </div> comes immediately after the notice. The final paragraph stays outside it.

Add the attribute through your site's template or an HTML field that preserves it. Then inspect the output your CMS publishes. Some editors strip attributes or rearrange containers when saving.

Text inside the block remains readable on the public page. For private information, enforce access protection. Our robots.txt and noindex guide explains the separate decisions for crawling, indexing and private resources.

Remove the attribute to stop excluding the block

Google treats data-nosnippet as a boolean attribute. Its presence is what matters. Writing data-nosnippet="false" still leaves the exclusion in place. To allow that block to supply snippet text again, remove the entire attribute, including any assigned value.

If a template offers an on/off control, check the generated HTML in both states. The off state should omit the attribute. A saved word such as “false” in an editor isn't sufficient evidence that the output changed.

Keep the attribute in the initial HTML when you can. Google's documentation cautions against adding or removing it later on an existing element through JavaScript, because extraction may happen before or after rendering.

Check the published boundary

After release, open the exact public URL and use your browser's View page source command and Elements inspector to examine the source HTML and the rendered element.

  1. Find the intended notice and its marked div, span or section.
  2. Check the opening and closing tags. In the studio example, the materials and access paragraph must sit outside the marked block.
  3. Confirm that the notice stays visible and readable to visitors.
  4. Search the page for another copy of the notice, including the description field and structured data. The wrapper covers its own contents. Review repeated copies separately.

Google's documentation says structured data remains usable for search results even when declared inside a data-nosnippet element. Check any such values you publish alongside the visible copy.

Google needs access to the page to read the setting. Keep a record of the URL, marked passage and release date, then record the query and displayed snippet when checking the search result later. A local HTML inspection verifies your output. The search result is a separate observation.

Use our meta description examples to improve the page's overall summary. The attribute excludes a passage while the description gives Google another summary to consider.

Sources & further reading

Primary references checked Nov 20, 2026. Platform guidance can change.

  1. Control your snippets in search results
  2. Robots meta tag and data-nosnippet specifications
  3. Google preview control announcement
  4. HTML Standard for boolean attributes

AI-assisted research and writing. Learn about our editorial standards.

Suggest a correction ↗