Hide a block from search and AI snippets (data-nosnippet)
Keep a block out of Google's search snippets, AI Overviews and AI Mode with one switch, while visitors still see it and the page stays indexed.
On this page
Sometimes a part of a page should not be quoted in search results or AI answers: a price that changes often, a disclaimer, a coupon code, a cookie notice or text that only makes sense in context. RankFlect SEO lets you mark that part so Google leaves it out of snippets.
It uses data-nosnippet, the attribute Google documents for this. The text stays on the page for visitors, and the page stays in search results.
What it does
| With the switch on | |
|---|---|
| Visitors | See the block as before. Nothing changes in the design. |
| Google search snippets | Leave the block out. |
| Google AI Overviews and AI Mode | Leave the block out. |
| Indexing | The page is still indexed and can still rank. |
| Automatic meta description | RankFlect SEO leaves the block out when it writes the description from the content. A description you write yourself is used as it is. |
Note
data-nosnippetis documented by Google. Other search engines and AI assistants may not follow it. To keep a whole page out of search, use noindex instead. See Noindex, nofollow and canonical URLs.
Hide a block in the block editor
- Edit the post or page.
- Select the block you want to hide from snippets.
- In the block settings sidebar, open Advanced.
- Turn on Hide from search and AI snippets.
- Save or update the post.
The switch works on every block, including Paragraph, Heading, List, Image, Group, Columns, Cover and dynamic blocks such as Latest Posts. To hide a whole section, put it in a Group block and turn the switch on for the Group.
To undo it, turn the switch off and save.
Hide content in the Classic Editor or a page builder
Wrap the content in the shortcode:
[rankflect_nosnippet]This price is valid until Friday.[/rankflect_nosnippet]
On the page this becomes:
<div data-nosnippet>This price is valid until Friday.</div>
Other shortcodes inside it still work. The shortcode adds a div, which starts on a new line, so use it around whole paragraphs or sections.
How the markup is added
Google documents data-nosnippet on div, section and span elements, so RankFlect SEO picks the right element for each block:
| Block | Markup |
|---|---|
Group, Columns, Column, Cover and other blocks with one div, section or span |
The attribute goes on that element. |
| Paragraph and Heading | The attribute on the element, with its content wrapped in a span data-nosnippet. |
| List item | The attribute on the element, with its content wrapped in a div data-nosnippet. |
| Anything else (List, Image, Table, Latest Posts, Custom HTML) | The whole block is wrapped in a div data-nosnippet. Wide and full-width blocks keep their width. |
The switch is saved in the block's settings, not in its HTML. The saved content of the block does not change, so you never get a "This block contains unexpected or invalid content" message, on new or older posts.
FAQ
Will this stop the page from ranking?
No. The page is still crawled and indexed. Only the marked text is left out of the snippet Google shows. Google may then show another part of the page as the snippet.
How long until Google stops showing the text?
Google has to crawl the page again first. You can ask for a recrawl with URL inspection in Google Search Console.
Does it hide the text from visitors?
No. Visitors see the block exactly as before.
Is this a Pro feature?
No. It is free in RankFlect SEO.
Was this page helpful?
Related guides
Noindex, nofollow and canonical URLs
Keep pages out of search with noindex, stop link credit with nofollow, and point duplicates to the main version with canonical URLs in RankFlect SEO.
Edit SEO in the block editor
A tour of the RankFlect SEO panel in the block editor: title, description, keywords, analysis, schema, social, advanced settings and Write with AI.
Optimize for AI search (GEO)
A practical checklist to help ChatGPT, Claude, Gemini, Perplexity and Copilot find, understand and cite your site, using RankFlect SEO's settings.
SEO in the Classic Editor
Use RankFlect SEO in the Classic Editor: the RankFlect SEO box with search preview, analysis and social fields, and the RankFlect SEO Schema box.
Still need help?
Email us with your WordPress and RankFlect SEO versions and what you tried. Pro customers get priority replies.