Skip to content

Add data-nosnippet to cookie banner in 2.11 docs#75

Merged
svekars merged 1 commit intositefrom
fix-red-cross
Mar 31, 2026
Merged

Add data-nosnippet to cookie banner in 2.11 docs#75
svekars merged 1 commit intositefrom
fix-red-cross

Conversation

@svekars
Copy link
Copy Markdown
Contributor

@svekars svekars commented Mar 30, 2026

  • Google is indexing the red X close-button image (pytorch-x.svg) from the cookie consent banner and showing it as the page thumbnail in search
    results.
    • Added data-nosnippet attribute to the
      element across all 2,820 HTML files in the 2.11/ directory.
    • This tells Google not to use any content within the cookie banner (including the close button image) for search snippets or thumbnails, so it will
      select more relevant page content instead.

Details

Simple string replacement in every .html file:

 - <div class="cookie-banner-wrapper">                                                                                                               
 + <div class="cookie-banner-wrapper" data-nosnippet>             

No impact on indexing, ranking, or page functionality — data-nosnippet only controls what appears in search result previews.

Test plan

  • Verified all 2,820 HTML files in 2.11/ were updated
  • Confirmed no files were missed
  • Spot-check rendered pages to confirm cookie banner still functions normally

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 30, 2026
@svekars svekars merged commit 875e2fe into site Mar 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants