Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Google can select text from the "Read more" related-posts section at the
bottom of a post page as the search-result snippet for that page, instead of
the post's own content — even though the related posts are unrelated to the
page's actual topic.
For example, a search for "WordA WordB" returned a result linking to a post
whose title contains "WordA", but with a snippet containing "WordB" — text
that doesn't appear anywhere in that post, but does appear in the title/
excerpt of an unrelated post shown in its "Read more" section.
Solution
Add the data-nosnippet attribute to the
<section>already wrapping the related-posts block inpost.hbs.This tells Google to never use this section's text for a search snippet
(applies to both classic web search and AI Overviews/AI Mode, per Google's
docs), while leaving the section, its links, and its visual layout completely
unchanged for real visitors.
data-nosnippetonly affects snippet text selection — it does not changecrawling, link-following, or indexing behavior in any way. The related-posts
links remain fully crawlable and followable, the section's content stays
indexed and eligible for ranking.
data-nosnippetis documented by Google as supported onspan,div, andsectionelements specifically — the existing wrapper is already a<section>, so no tag change is needed, just the one attribute:Alternatives considered
We considered semantic-only alternatives (e.g. wrapping the section in
<aside>instead of<section>), but tag choice alone has no documentedeffect on Google's snippet selection —
data-nosnippetis the actual,documented mechanism for this, and Google only guarantees it on
span,div, andsection.Files
post.hbs— 1 line changed (addeddata-nosnippetattribute, no otherchanges)
Testing
pnpm install --frozen-lockfile+pnpm test:ci(gulp zipthengscan --fatal --verbose .) — ✓ no fatal compatibility issues with Ghost 6.x.data-nosnippethas no CSS or rendering effect.Browser support
data-nosnippetis inert everywhere except crawlers that recognize it —currently Google (web search and AI Overviews/AI Mode) and, as of October
2025, Bing.
It's a plain HTML
data-*attribute with zero visual or functional effect inany browser or any crawler that doesn't recognize it.
Co-developed with GitHub Copilot.