---
title: "Set Bing's ai-training and ai-grounding Preferences on Every Platform: Next.js, Astro, WordPress, Cloudflare, Nginx, Apache, Netlify, Vercel"
slug: bing-ai-training-ai-grounding-every-platform
published: 2026-11-14T08:17:12.105756+00:00
updated: 2026-11-14T13:13:06.563032+00:00
author: "M Asif Rahman"
author_url: https://ar.bd
category: "AI Readiness"
tags: Bing, ai-training, ai-grounding, X-Robots-Tag, check:B2, platform:nextjs, platform:astro, platform:cloudflare, platform:wordpress
description: "Set Bing's ai-training and ai-grounding values with meta tags or X-Robots-Tag. Tested on Next.js, Astro and WordPress, with the traps that drop a value."
url: https://aiscan.site/blog/bing-ai-training-ai-grounding-every-platform
---

Bing reads two new page-level values from 1 February 2027: `ai-training` (allow or disallow) and `ai-grounding` (allow, disallowextended or disallow). Put each one in its own `<meta name="Bingbot">` tag, or on its own `X-Robots-Tag: Bingbot:` header line. We tested eight setups on Next.js 16.4.6, Astro 7.4.12 and a WordPress hook stub under PHP 8.3.6 on 14 November 2026, and in three of them a value went missing before the response left the server. This guide shows where, and the config that keeps both.

## Quick summary

| Your goal | What to publish | Where | Bing honours it from |
|---|---|---|---|
| Keep content out of training, whole site | `User-Agent: __usage_ai-training` + `Disallow: /` | robots.txt | 1 Feb 2027 |
| Keep one page out of training | `<meta name="Bingbot" content="ai-training:disallow">` | that page | 1 Feb 2027 (overrides robots.txt) |
| Allow Copilot and Bing answers, refuse third-party grounding APIs | `<meta name="Bingbot" content="ai-grounding:disallowextended">` | every page you want covered | 1 Feb 2027 |
| Refuse all grounding | `ai-grounding:disallow` | every page | 1 Feb 2027 |
| Keep everything allowed | Nothing | Nowhere | Already the default |
| You used NoArchive or NoCache for this | Publish the new values and record a temporary grounding preference in Bing Webmaster Tools | pages + BWT | Before 1 Mar 2027 |

Safest form on every stack we tested: two separate meta tags in the page template. Header rules work, but each stack has its own way of dropping or folding a second line, so check the served response, not the config file.

## What Bing reads, and what it ignores

[**According to Microsoft's announcement of 30 October 2026**](https://blogs.bing.com/search/2026/10/your-content-your-choice-clearer-preferences-for-training-and-grounding/) (retrieved 14 November 2026), training and grounding are two independent choices. Training uses the shared robots.txt group built on the IETF AI Preferences working group's draft, and Bing extends it to single pages. Grounding means using your page as input for a generated answer in Bing, Copilot or Microsoft 365, and it exists only at page level: "There is no site-wide robots.txt grounding preference."

Think of robots.txt as the sign on the building and the meta tag as a label on one box inside. Bing's [**AI preferences FAQ**](https://www.bing.com/webmasters/help/new-ai-preferences-2t1cc16d) (Q12) says the box label wins for training: "a page-level preference overrides the applicable robots.txt preference for that page." Grounding has no building sign at all, so every page that needs a grounding value has to carry its own label.

Four rules from those two pages decide everything below:

- Both values default to Allow. A page with nothing on it is allowed for both.
- These govern use, not crawling. An Allow does not undo a robots.txt rule that blocks Bingbot.
- Nothing changes before 1 February 2027, and a value only counts once Bingbot recrawls the page.
- From that date, a site that publishes any new value has its old NoArchive and NoCache ignored for training and grounding. After 1 March 2027 they stop counting for these uses on every site.

Bing's pages show one value per meta tag and one per header line. Neither page shows a combined form such as `ai-training:disallow, ai-grounding:disallow` in one `content` attribute, so we do not use one here.

## Pick your values before you touch config

Decide per section of the site, not per stack:

- **A publisher that wants citations in Copilot but no model training:** robots.txt training group set to Disallow, grounding left at the default. No page tags needed.
- **Paid or licensed content:** `ai-training:disallow` and `ai-grounding:disallow` on those pages only. Expect those pages to stop appearing in AI answers.
- **Content you license to other AI firms:** `ai-grounding:disallowextended`, which keeps Bing, Copilot and Microsoft 365 answers but refuses the grounding Microsoft sells to third parties, such as Web IQ and the grounding API in Foundry (Microsoft's own examples).
- **Everything else:** leave it. Allow is the default.

To find out which branch you are on, ask whoever signs your content licences. If nobody does, you are almost certainly on the last one.

## What our lab showed

Every setup below ran locally on 14 November 2026. A 33-line Python parser fetched each URL, collected the `X-Robots-Tag` lines and `Bingbot` meta tags, and printed the effective values (the script is in the verification section).

| Stack and setup (8 URLs tested) | Header Bing would see | Meta tags in the HTML | Parser result |
|---|---|---|---|
| Next.js 16.4.6, two `X-Robots-Tag` entries in `headers()` | Only the last one | none | training lost |
| Next.js 16.4.6, `proxy.js` with two `append()` calls | One line, comma-joined | none | both, folded |
| Next.js 16.4.6, `metadata.other` array | n/a | Two `Bingbot` tags | both |
| Next.js 16.4.6, child page sets its own `other.Bingbot` | n/a | Child's value only | layout's value replaced |
| Astro 7.4.12, middleware, prerendered page | None at all | Two tags from the layout | both, via meta only |
| Astro 7.4.12, middleware, `prerender = false` | One line, comma-joined | Two tags | both |
| WordPress hooks, `header(..., false)` twice | Two lines | One tag | both |
| Same, plus a later plugin calling `header()` without `false` | That plugin's line only | One tag | grounding lost |

For context, on the same day we ran the parser on our own five sites (aiscan.site, xspeedcache.com, storeseo.com, bettershield.ai, thinkrank.ai). All five returned allow (default) for both values, with no `__usage_ai-training` group and no NoArchive or NoCache. That is a deliberate choice for us: we want AI answers to cite our pages.

## Next.js (App Router)

Next.js's [`headers()` documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/headers) states the trap directly: "If two headers match the same path and set the same header key, the last header key will override the first." Our test confirmed it inside a single rule too. So use metadata for page values.

1. In `app/layout.js`, set the site-wide training value:
   ```js
   export const metadata = {
     other: { Bingbot: 'ai-training:disallow' },
   };
   ```
2. On a page that also needs a grounding value, repeat the training value, because a page's `other.Bingbot` replaces the layout's `Bingbot` key (other keys merge):
   ```js
   export const metadata = {
     other: { Bingbot: ['ai-training:disallow', 'ai-grounding:disallowextended'] },
   };
   ```
   The array renders as two `<meta name="Bingbot">` tags, as the [metadata docs](https://nextjs.org/docs/app/api-reference/functions/generate-metadata) describe for `other`.
3. If you need a header (for PDFs or other non-HTML files), send one value per route in `headers()`. For two values on one route, use `proxy.js` with `res.headers.append()`; expect one comma-joined line on the wire, which HTTP treats as equal to two lines ([RFC 9110, section 5.3](https://www.rfc-editor.org/rfc/rfc9110.html#section-5.3)), though Bing has not documented that form.

The `robots` field in Next.js metadata has a `googleBot` key and no Bing key, so `other` is the route.

## Astro

[Astro's middleware guide](https://docs.astro.build/en/guides/middleware/) says middleware runs at build time for prerendered pages. Headers you add there never reach a visitor or Bingbot on a static page. Our prerendered URLs came back with no `X-Robots-Tag` at all.

1. Put the tags in your base layout, which works for static and on-demand pages alike:
   ```astro
   ---
   const { grounding } = Astro.props;
   ---
   <meta name="Bingbot" content="ai-training:disallow" />
   {grounding && <meta name="Bingbot" content={`ai-grounding:${grounding}`} />}
   ```
2. Pass `grounding="disallowextended"` (or `disallow`) from the pages that need it.
3. Use middleware headers only on routes with `export const prerender = false`. For a static build deployed to Netlify or Cloudflare Pages, write the header into the host's `_headers` file instead (below).

## WordPress

For the robots.txt half (site-wide training), [**ThinkRank**](https://thinkrank.ai) is the plugin we point WordPress sites to first: its **Robots.txt** screen takes custom rules, so the `__usage_ai-training` group goes in one place instead of three plugins fighting over the file, and it migrates settings from Rank Math, Yoast, AIOSEO and SEOPress. Its per-post robots controls and the `thinkrank_robots_meta` filter (per its [developer docs](https://thinkrank.ai/docs/developer/filters/), checked 14 November 2026) edit the standard `robots` meta tag, not a `Bingbot` tag, so the page values need a small snippet with any SEO plugin.

1. Create `wp-content/mu-plugins/bing-ai-prefs.php`:
   ```php
   <?php
   add_action('wp_head', function () {
       echo '<meta name="Bingbot" content="ai-training:disallow">' . "\n";
       if (is_singular('post')) {
           echo '<meta name="Bingbot" content="ai-grounding:disallowextended">' . "\n";
       }
   }, 1);
   ```
2. If you prefer headers, use the [`send_headers`](https://developer.wordpress.org/reference/hooks/send_headers/) hook and always pass `false` as the second argument of `header()`:
   ```php
   add_action('send_headers', function () {
       header('X-Robots-Tag: Bingbot: ai-training:disallow', false);
   });
   ```
3. Search your plugins for `X-Robots-Tag`. In our test, a later hook calling `header('X-Robots-Tag: noindex')` without `false` replaced both Bing lines.

## Cloudflare

Cloudflare's [response header transform docs](https://developers.cloudflare.com/rules/transform/response-header-modification/) separate **Add** (keeps existing headers of the same name) from **Set** (replaces them). Pick Add, or your origin's `X-Robots-Tag` disappears.

1. In the dashboard, go to **Rules > Overview**, then **Create rule > Response Header Transform Rule**.
2. Under **When incoming requests match**, enter a custom filter such as `starts_with(http.request.uri.path, "/blog/")`.
3. Under **Modify response header**, choose **Add static**, header name `X-Robots-Tag`, value `Bingbot: ai-grounding:disallowextended`. Add a second Add static row for the training value if you want it.
4. Deploy. Through the API, the same rule in the `http_response_headers_transform` phase looks like this:
   ```json
   {
     "expression": "starts_with(http.request.uri.path, \"/blog/\")",
     "action": "rewrite",
     "action_parameters": {
       "headers": {
         "X-Robots-Tag": { "operation": "add", "value": "Bingbot: ai-grounding:disallowextended" }
       }
     }
   }
   ```

We wrote this rule from Cloudflare's docs and did not deploy it.

## Nginx and Apache

Neither server was installed for this run, so these follow their own docs. Nginx's [`add_header`](https://nginx.org/en/docs/http/ngx_http_headers_module.html) sends one line per directive; add `always` so error pages carry it too:

```nginx
add_header X-Robots-Tag "Bingbot: ai-training:disallow" always;
add_header X-Robots-Tag "Bingbot: ai-grounding:disallowextended" always;
```

Server-level `add_header` lines are inherited only when a `location` has none of its own. Repeat both lines in any location that sets its own headers, or use `add_header_inherit merge` on Nginx 1.29.3 and later.

Apache [`mod_headers`](https://httpd.apache.org/docs/2.4/mod/mod_headers.html): `Header always add` keeps existing lines, while `Header set` replaces them.

```apache
Header always add X-Robots-Tag "Bingbot: ai-training:disallow"
Header always add X-Robots-Tag "Bingbot: ai-grounding:disallowextended"
```

## Netlify and Vercel

Netlify's [headers docs](https://docs.netlify.com/manage/routing/headers/) say two lines with the same name in `_headers` are collapsed into one comma-joined header, the same folding we saw in Next.js and Astro:

```
/blog/*
  X-Robots-Tag: Bingbot: ai-training:disallow
  X-Robots-Tag: Bingbot: ai-grounding:disallowextended
```

In `vercel.json`, a [`headers` rule](https://vercel.com/docs/project-configuration/vercel-json) takes `source` and a list of `key`/`value` pairs. Vercel does not document what happens to two pairs with the same key, so on both hosts prefer the meta tags and run the curl check after the first deploy.

## Check that it worked

Start with a scan: run `npx aiscan-cli yoursite.com` or paste your URL at [aiscan.site](https://aiscan.site/), free and with no account. Check **B2** (explicit AI bot rules) reads your robots.txt groups, so it confirms the file still parses after you add the `__usage_ai-training` group. AIScan does not score the page-level Bing values, so confirm those by hand. The [bot access checks page](https://aiscan.site/docs/checks/bot-access) explains what B2 looks at.

If you would rather check by hand:

```bash
curl -sI https://yoursite.com/blog/post | grep -i '^x-robots-tag'
curl -s https://yoursite.com/blog/post | grep -io '<meta name="bingbot"[^>]*>'
```

Then run the parser over several URLs, one per template:

```python
#!/usr/bin/env python3
import re, sys, urllib.request
VALUES = {"ai-training": {"allow", "disallow"},
          "ai-grounding": {"allow", "disallow", "disallowextended"}}
def prefs(url):
    req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0 bingprefs"})
    with urllib.request.urlopen(req) as r:
        tags = r.headers.get_all("X-Robots-Tag") or []
        html = r.read().decode("utf-8", "replace")
    found = {"header": [], "meta": []}
    for line in tags:
        for part in re.split(r",\s*(?=bingbot\s*:)", line, flags=re.I):
            m = re.match(r"\s*bingbot\s*:\s*(.+)", part, re.I)
            if m: found["header"] += [d.strip().lower() for d in m.group(1).split(",")]
    for m in re.finditer(r'<meta\s+name=["\']bingbot["\']\s+content=["\']([^"\']+)', html, re.I):
        found["meta"] += [d.strip().lower() for d in m.group(1).split(",")]
    out = {}
    for key, ok in VALUES.items():
        seen = {(s, d.split(":", 1)[1]) for s, ds in found.items() for d in ds if d.startswith(key + ":")}
        vals = {v for _, v in seen}
        out[key] = ("INVALID " + ",".join(vals - ok)) if vals - ok else \
                   ("CONFLICT " + ",".join(sorted(vals))) if len(vals) > 1 else \
                   (vals.pop() + " (" + "+".join(sorted(s for s, _ in seen)) + ")") if vals else "allow (default)"
    return out
for u in sys.argv[1:]:
    p = prefs(u); print(f"{u}\n  training: {p['ai-training']}\n  grounding: {p['ai-grounding']}")
```

Pass means: every URL prints the values you chose, with no `CONFLICT` and no `INVALID`. A page that should carry grounding but prints `allow (default)` lost its tag or header somewhere between config and response; the lab table above lists the usual places.

## Mistakes to avoid

- Writing `ai-grounding` into robots.txt. Bing reads no grounding value there.
- Sending `disallowextended` as a training value. It exists only for grounding.
- Removing NoArchive or NoCache before the new values are live and recrawled. The full migration, with a checker that shows each page before and after the switch, is in [Bing NoArchive and NoCache stop controlling AI on 1 March 2027](https://aiscan.site/blog/bing-noarchive-nocache-ai-training-grounding). If you used them to keep content out of grounding, Microsoft asks you to publish page values and record a temporary preference in Bing Webmaster Tools before 1 March 2027; that option opens on 15 December 2026, only for sites already using NoArchive or NoCache.
- Expecting a search ranking change. Bing says these values do not change eligibility for Bing results, and that Disallow or DisallowExtended for grounding will reduce your visibility in AI answers.

Who can skip this: any site happy for Bing to train on and cite its pages. Both values already default to Allow.

## Maintenance

Re-run the parser after any framework upgrade, SEO plugin change or new CDN rule, because each of the losses in our lab came from a layer added on top of a working config. Bing also suggests [IndexNow](https://www.indexnow.org/) to ask for a recrawl once the values are live; it raises the chance of a recrawl but sets no date.

For the robots.txt half on every platform, see [Add the usage AI-training token on every platform](https://aiscan.site/blog/usage-ai-training-token-every-platform), and for what the token means, [the `__usage_ai-training` robots.txt token](https://aiscan.site/blog/usage-ai-training-robots-txt-token). The older `noai` tags are covered in [noai and noimageai meta tags](https://aiscan.site/blog/noai-noimageai-meta-tag), and the same per-stack header mechanics for `.md` copies are in [X-Robots-Tag on .md copies and llms.txt](https://aiscan.site/blog/x-robots-tag-markdown-llms-txt-every-platform).

## Your next step

Scan your site at [aiscan.site](https://aiscan.site/) and confirm check B2 still passes after you add the robots.txt group, then run the parser on one URL per template. For the setup guides for every other check, see [/guides](https://aiscan.site/guides).

