Have a web emergency? We'll fix your site free! →

How to Control Google AI Mode on Your WordPress Site

Learn how to control Google AI Mode on your WordPress site with the Search Console setting, nosnippet, data-nosnippet and Google-Extended rules.

Nick Stafford, Chief Executive Officer 7 min read
How to Control Google AI Mode on Your WordPress Site Tutorials

Google AI Mode now sits at the center of the Google desktop homepage, and many site owners want to know what they can actually control. This guide shows you how to control Google AI Mode on a WordPress site, step by step, using only the tools Google documents: one Search Console setting, three robots rules and one robots.txt line. If you missed the news behind it, start with our post on Google AI Mode taking over the homepage.

Plan on about 30 minutes for the full walkthrough. Most sites will only need the first two steps.

Before You Start: Know Which Lever Does What

Google gives you separate controls, and each one does a different job. Picking the wrong one is the most common mistake we see.

  • Search generative AI setting in Search Console: keeps your whole site, or a section of it, in or out of AI Overviews, AI Mode and generative AI features in Discover.
  • nosnippet and max-snippet: page level rules that limit how much text Google can show in results and use as direct input for AI Overviews and AI Mode.
  • data-nosnippet: hides selected parts of a page from snippets while the rest stays usable.
  • Google-Extended in robots.txt: controls whether your content can be used to train Gemini models. Google says it does not remove your site from AI Overviews or AI Mode.

Keep that list handy. Every step below uses one of these four.

Step 1: Measure Your Current AI Exposure

Do not change anything until you know what you have to lose. Open Google Search Console and go to Performance > Search results.

  1. Set the date range to Compare and pick the last 28 days against the same 28 days last year.
  2. Turn on Total clicks, Total impressions and Average position.
  3. Open the Pages tab and sort by the change in clicks.
  4. Export the table so you have a baseline to check against later.

Done looks like: a saved export that shows which pages gained or lost clicks. Pages that answer a simple question usually lose clicks first. Pages that help someone compare, buy or book usually hold up better.

Step 2: Decide Your Google AI Mode Policy

For most business sites, we recommend staying in. When AI Mode cites your page, you get a link and your brand name in front of someone who is actively researching. Our Monday post covers why opting out has not been shown to win back clicks.

Excluding content can make sense when the content itself is what you sell. Paid research, detailed pricing data and reference libraries are common examples. Write your choice down in one sentence, such as “Whole site stays in AI Mode, the members area is excluded.” Every later step follows from that sentence.

Done looks like: one written policy that names the site, sections or pages you want to keep out, if any.

Step 3: Set the Search Console Switch

This is the broadest control. According to Google’s Search generative AI help page, it works like this:

  1. In Search Console, select your property.
  2. Go to Settings > Search generative AI.
  3. Pick one option:
    • Include my site’s links and content in Search generative AI features is the default for all properties.
    • Exclude my site’s links and content from Search generative AI features removes your content from these features.
    • Inherit control from parent uses the setting of the parent property. It is the default for properties that have a parent.
  4. Save your choice.

If you only want to exclude one section, add that section as its own URL prefix property, such as https://www.example.com/members/, and set that child property to Exclude. Google’s help page explains that URL prefix properties can act as children of a domain property, and that domain owners are notified when a child overrides the parent.

Google says changes generally take a few days, with content typically excluded within 1 to 2 days after the change goes live. It also states that the setting is not a ranking signal, does not affect AI training and does not remove your site from Search.

Done looks like: the setting shows the option that matches your policy on every property you manage.

Step 4: Use nosnippet or max-snippet on Single Pages

Use this step when only a few pages need protection. Google’s robots meta tag documentation says nosnippet will “also prevent the content from being used as a direct input for AI Overviews and AI Mode.” It also says max-snippet “will also limit how much of the content may be used as a direct input for AI Overviews and AI Mode.”

There is a cost. nosnippet also removes the text snippet under your regular search listing, and that can lower clicks from normal results. A max-snippet value is a softer option because it caps the text length instead of removing it.

Option A: Your SEO plugin

Most SEO plugins, including Rank Math and Yoast, offer advanced robots settings for each post or page. Open the page in the editor, find the plugin’s advanced or robots section, and choose No Snippet or set a Max Snippet length. Update the page.

Option B: The wp_robots filter

WordPress has included the wp_robots filter since version 5.7. You can add this to a small custom plugin or your child theme’s functions.php. Replace 123 with your page ID.

add_filter( 'wp_robots', function( $robots ) {
    if ( is_singular() && get_the_ID() === 123 ) {
        $robots['nosnippet'] = true;
    }
    return $robots;
} );

To cap the length instead, swap the nosnippet line for $robots['max-snippet'] = '50'; and pick the length that fits.

Two rules from Google’s documentation matter here. When rules conflict, the more restrictive one applies, so nosnippet beats max-snippet. And a max-snippet value of 0 is the same as nosnippet.

Option C: PDFs and other files

Files such as PDFs cannot carry a meta tag. Google supports the same rules in an X-Robots-Tag HTTP header. Your host or a server rule can send a header like X-Robots-Tag: nosnippet for those files. If you are on WP Farm, open a ticket and we will set it for you.

Done looks like: view the page source in your browser and search for name="robots". The tag should list nosnippet or your max-snippet value.

Step 5: Hide Only the Sensitive Parts With data-nosnippet

Sometimes you want a page to stay fully visible except for one block, such as a price table or a members only answer. Google’s documentation says you can mark textual parts of a page so they are not used as a snippet with the data-nosnippet attribute on span, div and section elements.

<div data-nosnippet>
  Our detailed pricing table goes here.
</div>

In the block editor, select the block, open Edit as HTML from the block toolbar menu, and add the attribute to a wrapping div. Google warns not to add or remove the attribute with JavaScript, so put it in the saved HTML.

Done looks like: the attribute appears in the page source around the right content, and the rest of the page is untouched.

Step 6: Decide on Google-Extended

Google-Extended is a robots.txt token for AI training. Google’s Search generative AI help page points to it for training choices and makes clear that the Search Console setting does not cover training. Google’s common crawlers documentation notes that Google-Extended has no user agent of its own and works only as a control token.

If you do not want your content used for Gemini training, add this group to robots.txt:

User-agent: Google-Extended
Disallow: /

WordPress serves a virtual robots.txt by default, and most SEO plugins include a robots.txt editor. If you have a physical robots.txt file in your site root, edit that file instead. Never add a Disallow for Googlebot itself, because AI Mode and regular Search both depend on Googlebot being able to crawl your pages. Our Meta AI crawler post covers how to tell search crawlers apart from AI training crawlers.

Done looks like: visiting https://www.yoursite.com/robots.txt shows the Google-Extended group, and Googlebot is still allowed.

Step 7: Verify and Recheck in Two Weeks

  1. Use URL Inspection in Search Console on one changed page and run Test live URL to confirm Google can fetch it.
  2. Check that robots.txt does not block any page that carries a nosnippet or max-snippet rule. Google’s documentation says rules on a page blocked by robots.txt will not be found and will be ignored.
  3. Set a reminder for two weeks out. Rerun the Step 1 comparison and set it beside your baseline export.

If clicks dropped on pages you limited and nothing else changed, consider loosening the rule. Speed matters here too, since AI Mode can only cite pages Google can fetch quickly and reliably. Our guide to Core Web Vitals optimization covers the basics.

FAQ

Does excluding my site from AI Mode hurt my regular rankings?

Google says no. Its help page states the Search generative AI setting is not used as a ranking signal for other parts of Search.

Will blocking Google-Extended keep me out of AI Mode?

No. Google-Extended is about AI training. Use the Search Console setting or nosnippet to limit AI Overviews and AI Mode.

How fast do changes show up?

For the Search Console setting, Google says a few days, with content typically excluded within 1 to 2 days. Page level robots rules apply after Google recrawls the page.

Get Help Setting It Up

Not sure which pages to protect, or how to add the headers? Contact WP Farm support and our team will review your setup and help you control Google AI Mode the right way for your business.

Nick Stafford Chief Executive Officer Nick founded WP Farm and runs it, along with its sister company SADOS. He has managed WordPress hosting and server infrastructure since 2008, and he writes about WordPress speed, security and hosting from that work.