-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add data-nosnippet
to prevent cookie banner text appearing in Google Search snippets
#2192
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense, but as I sort of prompted this PR I think it'd be worth @hannalaakso reviewing in case she can think of any reason why this would ever be problematic.
For users that don't know what data-nosnippet
does, is there a better description for the changelog / PR title that focuses on the outcome of the change?
I also wonder if it'd also be useful to cross-reference the PR from GOV.UK where they added this in the commit message? Just as 'prior art'.
Great spot adding the missing README as well.
f8ab8c4
to
4ff5ae3
Compare
The data-nosnippet attribute stops the cookie banner text from appearing in any Google Search text snippets.
4ff5ae3
to
c4ef8b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me 🎉 The NHS also seem to have done this in their cookie banner for nearly a year now which gives me confidence.
data-nosnippet
to prevent cookie banner text appearing in Google Search snippets
The data-nosnippet attribute stops the 'show' text from appearing in any Google Search text snippets. We have successfully used a similar approach for the [cookie banner](#2192) and on [GOV.UK Publishing components](alphagov/govuk_publishing_components#1185)
The data-nosnippet attribute stops the 'show' text from appearing in any Google Search text snippets. We have successfully used a similar approach for the [cookie banner](#2192) and on [GOV.UK Publishing components](alphagov/govuk_publishing_components#1185)
The data-nosnippet attribute stops the 'show' text from appearing in any Google Search text snippets. We have successfully used a similar approach for the [cookie banner](#2192) and on [GOV.UK Publishing components](alphagov/govuk_publishing_components#1185)
The data-nosnippet attribute stops the 'show' text from appearing in any Google Search text snippets. We have successfully used a similar approach for the [cookie banner](#2192) and on [GOV.UK Publishing components](alphagov/govuk_publishing_components#1185)
Apply a data-nosnippet attribute to the cookie banner component to stop it appearing in Google Search snippets. alphagov/govuk-frontend#2192
Implemented on the GOVUK Frontend cookie banner component in: alphagov/govuk-frontend#2192 This tells Google to ignore the cookie banner when it indexes the content of our pages.
Implemented on the GOVUK Frontend cookie banner component in: alphagov/govuk-frontend#2192 This tells Google to ignore the cookie banner when it indexes the content of our pages.
Implemented on the GOVUK Frontend cookie banner component in: alphagov/govuk-frontend#2192 This tells Google to ignore the cookie banner when it indexes the content of our pages.
What
Add
data-nosnippet
to the cookie banner componentWhy
Taken inspiration from alphagov/govuk_publishing_components#1185
Apply a
data-nosnippet
attribute to the cookie banner component to stop its text content appearing in Google Search snippets.We think we can make this change without adding a macro option to remove the attribute, as we can't think of a scenario where you would want the cookie banner text to appear in Google Search snippets.