Skip to content

Fix red X thumbnail appearing in Google search results#241

Merged
svekars merged 1 commit intopytorch_sphinx_theme2from
fix-pytorch-x-icon
Mar 30, 2026
Merged

Fix red X thumbnail appearing in Google search results#241
svekars merged 1 commit intopytorch_sphinx_theme2from
fix-pytorch-x-icon

Conversation

@svekars
Copy link
Copy Markdown
Contributor

@svekars svekars commented Mar 30, 2026

  • Google was picking up the pytorch-x.svg image (red X close button on the cookie banner) as the page thumbnail in search results, since it was
    served as an tag — one of the few crawlable images on most doc pages
  • Replaced the tag in the cookie banner with a CSS-only using ::before/::after pseudo-elements to draw the X, so there's no image for
    Google to index
  • Added data-nosnippet attribute to the cookie banner wrapper as an extra signal to Google to exclude it from search snippets

Test plan

  • Verify the cookie banner close button still renders as a red X and is clickable
  • Verify the close button styling is correct across breakpoints (mobile, tablet, desktop)
  • Inspect the page source to confirm no tag referencing pytorch-x.svg remains
  • After reindexing, confirm Google search results no longer show the red X thumbnail

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 30, 2026

Deploy Preview for pytorchsphinxtheme ready!

Name Link
🔨 Latest commit 0f66633
🔍 Latest deploy log https://app.netlify.com/projects/pytorchsphinxtheme/deploys/69cabe41cc89250008fde0a2
😎 Deploy Preview https://deploy-preview-241--pytorchsphinxtheme.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@meta-cla meta-cla bot added the cla signed label Mar 30, 2026
@svekars svekars merged commit b19813f into pytorch_sphinx_theme2 Mar 30, 2026
7 checks passed
@svekars svekars deleted the fix-pytorch-x-icon branch March 30, 2026 22:23
@svekars svekars mentioned this pull request Apr 3, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants