Skip to content
TheChatArchiveThe Chat Archive
GLMGLM-5 / Pony Alpha· unknownHugging Face Frontier Reasoning Traces

Build a snippet control playbook: data-nosnippet, max-snippet, and preview management.

  1. User

    Build a snippet control playbook: data-nosnippet, max-snippet, and preview management.

  2. GLM Assistant

    The user wants a "snippet control playbook" for managing search engine snippets (primarily Google) using specific meta tags and HTML attributes: data-nosnippet, max-snippet, and preview management directives.

    Goal: Create a comprehensive guide or "playbook" explaining how to control how content appears in search results.

    Key Concepts to Cover:

    1. data-nosnippet: An HTML attribute to prevent specific sections of text from being used in snippets.
    2. max-snippet: A robots meta tag directive to limit the length (in characters/bytes) of the snippet.
    3. Preview Management: This usually refers to max-image-preview and max-video-preview within the robots meta tag.

    Structure of the Playbook:

    • Introduction: Briefly explain why snippet control matters (CTR, privacy, branding).
    • Section 1: The Scalpel (data-nosnippet) - Focus on granular control.
      • What it is.
      • Syntax/Implementation.
      • Use cases (e.g., removing sensitive info, boilerplate text).
    • Section 2: The Limiter (max-snippet) - Focus on length control.
      • What it is.
      • Syntax/Implementation.
      • Use cases (preventing truncation, summarizing).
    • Section 3: The Visuals (Preview Management) - Focus on media.
      • max-image-preview.
      • max-video-preview.
      • Use cases (bandwidth, layout consistency).
    • Section 4: The "Big Hammer" (Global Settings) - Briefly mention how to combine them or turn them off entirely (nosnippet vs. noindex).
    • Section 5: The Playbook Table/Cheat Sheet - A quick reference guide.
    • Validation: How to test (Rich Results Test, URL Inspection).

    Drafting Content - Details & Nuances:

    • data-nosnippet: It applies to span, div, and section. It's critical to mention that it doesn't remove the page from the index, just that text from the generated snippet.
    • max-snippet: Values are integers. 0 means no snippet (or just a link). -1 means no limit.
    • Previews:
      • max-image-preview: none, standard, large.
      • max-video-preview: integer seconds or -1.
    • Combined Syntax: Can combine these in one meta tag (e.g., <meta name="robots" content="max-snippet:50, max-image-preview:large">).

    Refining the Tone: The user asked for a "playbook." This implies a practical, actionable, and strategic guide, not just a dictionary definition. I should use terms like "Strategy," "Implementation," and "Best Practices."

    Step-by-Step Construction:

    1. Title: Snippet Control Playbook.
    2. Module 1: The data-nosnippet Attribute (Granular Control).
      • Scenario: You want the page indexed, but exclude a specific sentence (e.g., "Subscribe to our newsletter" or a price).
      • Code: Wrap text in <span data-nosnippet>...</span>.
      • Note: Only works on block-level elements usually, but technically span works too.
    3. Module 2: The max-snippet Directive (Length Control).
      • Scenario: You have concise content and don't want Google to pull weird filler text, or you want to force a "Click to Read More" situation.
      • Code: <meta name="robots" content="max-snippet:160">.
      • Values: 0 (none), specific number, -1 (unlimited).
    4. Module 3: Preview Management (Visuals).
      • Scenario: Controlling image size (large vs thumbnail) or video duration.
      • Code: max-image-preview, max-video-preview.
    5. Module 4: Combination Strategy.
      • How to stack directives in one meta tag.
    6. Common Pitfalls/FAQ.
      • Does this affect ranking? (Indirectly via CTR).
      • Does data-nosnippet hide text from indexing? (No, only from the snippet generation).

    Self-Correction during drafting: I initially thought about nosnippet (the global meta tag), but the user specifically asked for data-nosnippet, max-snippet, and preview management. I will include nosnippet as a "fallback/nuclear option" just for context, but focus on the requested items.

    Formatting: Use Markdown heavily. Code blocks for syntax. Tables for the cheat sheet. Bold text for emphasis.

    Final Polish: Ensure the distinction between "indexed" and "snippets" is clear. Google indexes the whole page (unless noindex), but these controls dictate what is displayed in the SERP.

    Let's write it out.

    • Intro: Control the narrative in SERPs.
    • Part 1 (data-nosnippet): "The Redaction Pen."
    • Part 2 (max-snippet): "The Length Regulator."
    • Part 3 (Previews): "The Visuals."
    • Cheat Sheet: Table format.

    Looks good. I will generate the response based on this structure. This playbook outlines how to control exactly how your content appears (or doesn't appear) in Google Search results.

    Using these directives allows you to protect sensitive data, optimize for Click-Through Rate (CTR) by limiting snippet length, and manage visual assets.


    1. The Redaction Pen: data-nosnippet

    Use this HTML attribute to keep specific chunks of text out of the search result snippet while keeping the rest of the page indexable. This is ideal for removing PII (Personally Identifiable Information), internal notes, or time-sensitive disclaimers that appear in body text.

    Implementation

    Wrap the text you want to hide in a block-level or inline HTML element and add the data-nosnippet attribute.

    Valid HTML5 elements: <span>, <div>, <section>, <p>, etc.

    <p>This product is available globally.</p>
    <div data-nosnippet>
      <p>Internal Note: Stock is low in Warehouse B. Do not advertise on homepage.</p>
    </div>
    <p>Buy now for free shipping.</p>
    

    Playbook Rules:

    • Don't use nosnippet: Do not confuse the <meta name="robots" content="nosnippet"> tag (which blocks the entire page snippet) with this attribute (which blocks parts of text).
    • Structure: It is usually safer to use block elements (div, p) rather than inline span tags to ensure the parser respects the boundaries.

    2. The Length Limiter: max-snippet

    Use this robots meta tag to set a maximum character limit for your text snippets. This is useful for pages where a full paragraph summary ruins the mystery or "click-need."

    Implementation

    Place this in the <head> of your document.

    <meta name="robots" content="max-snippet:160">
    

    Value Definitions

    • 0: No snippet will be shown. (Equivalent to nosnippet).
    • -1: There is no limit. Google decides the length based on the user's query and device.
    • [Number]: The maximum number of characters.

    Playbook Rules:

    • SEO Strategy: Limiting to roughly 160 characters aligns with standard desktop display lengths, potentially preventing Google from pulling random text that cuts off awkwardly.
    • Featured Snippets: If you set this too low (e.g., 50), you significantly reduce your chances of winning a Featured Snippet (Position 0) because you aren't providing enough context.

    3. The Visual Manager: Preview Control

    This controls the size of images and video thumbnails in search results. This is critical for managing visual real estate and server bandwidth.

    A. max-image-preview

    Controls the size of image thumbnails associated with your link.

    <meta name="robots" content="max-image-preview:large">
    
    • none: No image preview.
    • standard: Default size (usually a small thumbnail).
    • large: Allows larger image previews (great for news, blogs, and recipes).

    B. max-video-preview

    Controls the duration (in seconds) of video snippets.

    <meta name="robots" content="max-video-preview:30">
    
    • -1: No limit.
    • 0: Only a static image is allowed (no video playback in SERP).
    • [Number]: Max seconds allowed.

    4. The "Nuclear" Options (Global Overrides)

    Sometimes you want to block previews entirely across all surfaces (Search, Discover, Assistant).

    nopagereadaloud

    Prevents Google Assistant from reading the page aloud.

    <meta name="google" content="nopagereadaloud">
    

    nositelinkssearchbox

    Specifically blocks the sitelinks search box that sometimes appears under your brand result.

    <meta name="google" content="nositelinkssearchbox">
    

    5. Strategy Cheat Sheet

    ScenarioStrategyCode Snippet
    Full ControlLimit text length + Allow large images<meta name="robots" content="max-snippet:160, max-image-preview:large">
    Content PaywallShow headline only, no text preview<meta name="robots" content="max-snippet:0, max-image-preview:standard">
    Redacted InfoHide specific data within text<span data-nosnippet>Confidential Data</span>
    Video FocusAllow long video previews but short text<meta name="robots" content="max-snippet:80, max-video-preview:120">

    Summary Checklist

    1. Inspect: Identify pages with sensitive data or poor auto-generated snippets.
    2. Redact: Use data-nosnippet to surgically remove specific text lines.
    3. Limit: Use max-snippet to keep text concise.
    4. Visuals: Use max-image-preview to control the "pop" of your result.