# Mark up paywalled content

- Check 48.05 · Media and publishers · Important
- Source: https://checklist-seo-geo.com/en/media-publishers/mark-up-paywalled-content
- Mark up your paywalled articles (isAccessibleForFree, cssSelector) and serve the full text only to subscribers and verified Googlebot, with no cloaking risk.
- Updated on 2026-11-27
- Licence: CC BY 4.0. Credit “Checklist SEO & GEO” with a link to https://checklist-seo-geo.com/en/media-publishers/mark-up-paywalled-content.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## In short

A paywalled article that is indexed in full shows Googlebot text that a non-subscriber does not see. So that Google does not mistake this gap for cloaking, the page declares `isAccessibleForFree: false` in JSON-LD and points to the restricted part with a CSS selector. Once this check is done, every paywalled article carries this markup, the full text is sent only to subscribers and to crawlers whose identity has been verified, and nothing leaks into the HTML served to everyone else.

## Why it matters

Google's spam policies define cloaking as presenting different content to users and to search engines. They provide an exception: a paywall is not cloaking if Google can see all the content behind it, just as a subscriber can, and if the site follows its flexible sampling guidance. Paywalled content markup is the signal that lets Google tell the difference.

What Google can index depends on what the HTML it receives contains:

| Model | What Googlebot receives | What gets indexed |
|---|---|---|
| Metering (a few free articles per month) | The full article: Googlebot does not send cookies from one page to the next, so it is always on its “first article” | All the text |
| Lead-in with no access for Googlebot | The first paragraphs | The lead-in only |
| Hard paywall with access for verified Googlebot | The full article | All the text |
| Hard paywall with no access for Googlebot | The headline and the invitation to subscribe | Almost nothing |

Google recommends two forms of sampling: metering, monthly rather than daily, and a lead-in visible before the wall. It leaves the dosage to publishers and suggests testing cautiously.

Since August 2025, its documentation has warned against JavaScript paywalls that send the full text in the server response and then hide it in the browser: this is not a reliable way to limit access, and Google asks that the full content be provided only once the subscription is confirmed. Text that is present in the HTML can be read by disabling JavaScript, by viewing the source code, or with any crawler.

This is the point that concerns generative engines. Content served in full to any client that calls itself “Googlebot” can be read by any script that spoofs that name. Access must therefore rest on a verified identity (reverse DNS or published address ranges), never on the user agent alone: see [verify crawler identity against official IP ranges](https://checklist-seo-geo.com/en/ai-crawler-access-data-policy/verify-crawler-identity-against-official-ip-ranges-if-possible).

## What it improves

- **Compliance**: the gap between Googlebot's version and the visitor's version is declared. The risk of being treated as [deceptive cloaking](https://checklist-seo-geo.com/en/practices-avoid/eliminate-deceptive-cloaking) goes down.
- **Indexing**: the full text of paywalled articles can be indexed and rank for queries that the lead-in alone does not cover.
- **Content protection**: with a server-side wall and verified crawlers, the text no longer leaks into the source code or to fake Googlebots.
- **AI Overviews and AI Mode**: no special treatment. Google states that these features obey the same preview controls as Search (`nosnippet`, `data-nosnippet`, `max-snippet`).
- **Rankings**: no bonus. The markup creates no rich result; it avoids a misunderstanding.

## How to check

Request a paywalled article with no cookie, then while posing as Googlebot:

```bash
curl -s https://example.com/article-payant/ | grep -c 'class="paywall"'
curl -s -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" \
  https://example.com/article-payant/ | grep -c 'class="paywall"'
```

Compliant result with a server-side wall: `0` in both cases. If the second command returns the text, your site trusts the user agent and anyone can read your articles.

Next, check the markup, which is present for all visitors:

```bash
curl -s https://example.com/article-payant/ | grep -o -E '"(isAccessibleForFree|cssSelector)" *: *[^,}]*'
```

Then, in Search Console:

1. Inspect the URL, run “Test live URL” and open the crawled HTML: the full text must be there, inside the element designated by `cssSelector`.
2. Run the URL through the Rich Results Test: the article is detected with no critical error.
3. Open the [Manual actions report](https://search.google.com/search-console/manual-actions): no action for cloaking or for structured data.

## How to implement

### Before you start

First decide, article by article or section by section: the paywall model (metering, lead-in, hard paywall) and the indexing you want (full text or lead-in only). Google's documentation applies only to paywalled content that you want crawled and indexed.

**HTML structure.** Wrap the restricted part in an element that carries a class. Google accepts only class selectors (`.paywall`) and asks you not to nest sections.

```html
<article>
  <h1>Article headline</h1>
  <div class="article-intro">
    <p>Lead-in visible to everyone.</p>
  </div>
  <div class="paywall">
    <p>The rest, for subscribers only.</p>
  </div>
</article>
```

**Reference JSON-LD block**, to be served to all visitors, on every version of the page (AMP included):

```html
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "NewsArticle",
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://example.com/article-payant/"
  },
  "headline": "Article headline",
  "image": "https://example.com/images/article-16x9.jpg",
  "datePublished": "2026-11-24T08:00:00+01:00",
  "dateModified": "2026-11-25T09:20:00+01:00",
  "author": {
    "@type": "Person",
    "name": "Claire Martin",
    "url": "https://example.com/auteurs/claire-martin/"
  },
  "isAccessibleForFree": false,
  "hasPart": {
    "@type": "WebPageElement",
    "isAccessibleForFree": false,
    "cssSelector": ".paywall"
  }
}
</script>
```

`isAccessibleForFree` is the only required property; `hasPart` is recommended and specifies which part is restricted. For several paywalled sections, give each one a class and make `hasPart` an array. The markup is accepted on `CreativeWork` and the subtypes Google lists (`Article`, `NewsArticle`, `Blog`, `Course`, `HowTo`, `Review`, `WebPage`…). The rest of the block follows the guide on [Article, BlogPosting or NewsArticle](https://checklist-seo-geo.com/en/schemaorg-structured-data/implement-article-blogposting-newsarticle).

**Access rule.** The server sends the `.paywall` section to three audiences only: logged-in subscribers, visitors still within their quota if you use metering, and verified search crawlers. Here is a PHP function that verifies with a double DNS lookup, following the method documented by Google:

```php
function isVerifiedGooglebot(string $ip, string $userAgent): bool
{
    if (! str_contains($userAgent, 'Googlebot')) {
        return false;
    }

    $host = gethostbyaddr($ip);

    if (! is_string($host) || ! preg_match('/\.(googlebot|google|googleusercontent)\.com$/', $host)) {
        return false;
    }

    $records = array_merge(dns_get_record($host, DNS_A) ?: [], dns_get_record($host, DNS_AAAA) ?: []);

    foreach ($records as $record) {
        if (inet_pton($record['ip'] ?? $record['ipv6']) === inet_pton($ip)) {
            return true;
        }
    }

    return false;
}
```

Cache the result per IP address (one day is enough): two DNS queries per page would slow crawling down. Behind a CDN or a proxy, pass the client's real address, not the proxy's. The address lists published by Google, which are faster to test, are described in the guide on IP verification.

> **Warning:** the full version must never enter a shared cache. Send `Cache-Control: private, no-store` on responses that contain the paywalled section, otherwise the CDN or the page cache will serve it again to the next visitor.

### WordPress

Versions: WordPress 6.4 to 7.1, Yoast SEO 20 and later, membership plugins in their November 2026 versions.

The common membership plugins (MemberPress, Paid Memberships Pro, Restrict Content Pro, Leaky Paywall, WooCommerce Memberships) restrict display on the server side. Check two points in their documentation that vary from one plugin to another: the access given to search crawlers (and how they are recognized) and whether paywalled content markup is added. Failing that, this file placed in `wp-content/mu-plugins/paywall.php` cuts the article at the “Read more” tag and extends the Yoast SEO schema:

```php
<?php

function example_has_full_access(): bool
{
    if (current_user_can('read_premium')) {
        return true;
    }

    $ip = $_SERVER['REMOTE_ADDR'] ?? '';
    $cached = get_transient('gbot_' . md5($ip));

    if ($cached === false) {
        $cached = isVerifiedGooglebot($ip, $_SERVER['HTTP_USER_AGENT'] ?? '') ? 'yes' : 'no';
        set_transient('gbot_' . md5($ip), $cached, DAY_IN_SECONDS);
    }

    return $cached === 'yes';
}

add_filter('the_content', function (string $content): string {
    if (! is_singular('post') || ! get_post_meta(get_the_ID(), 'premium', true)) {
        return $content;
    }

    $parts = preg_split('/<span id="more-\d+"><\/span>/', $content, 2);

    if (count($parts) < 2) {
        return $content;
    }

    if (! example_has_full_access()) {
        return $parts[0] . '<p class="subscribe-box"><a href="/abonnement/">Subscribe to read the rest</a></p>';
    }

    nocache_headers();

    return $parts[0] . '<div class="paywall">' . $parts[1] . '</div>';
}, 20);

add_filter('wpseo_schema_article', function (array $data): array {
    if (! get_post_meta(get_the_ID(), 'premium', true)) {
        return $data;
    }

    $data['isAccessibleForFree'] = false;
    $data['hasPart'] = [
        '@type' => 'WebPageElement',
        'isAccessibleForFree' => false,
        'cssSelector' => '.paywall',
    ];

    return $data;
});
```

Paste the `isVerifiedGooglebot()` function into the same file, replace the `read_premium` capability with your plugin's access check, and exclude paywalled articles from the page cache for subscribers and crawlers. With Rank Math, the equivalent filter is `rank_math/json_ld`.

### Laravel

Versions: Laravel 11 to 13.

Decide in the controller, never in the view or in the browser:

```php
public function show(Request $request, Article $article): Response
{
    $ip = (string) $request->ip();

    $hasFullAccess = ! $article->is_premium
        || $request->user()?->hasActiveSubscription() === true
        || Cache::remember("googlebot:{$ip}", now()->addDay(), fn (): bool => isVerifiedGooglebot($ip, (string) $request->userAgent()));

    $schema = [
        '@context' => 'https://schema.org',
        '@type' => 'NewsArticle',
        'mainEntityOfPage' => route('articles.show', $article),
        'headline' => $article->title,
        'datePublished' => $article->published_at->toIso8601String(),
        'dateModified' => $article->content_updated_at->toIso8601String(),
        'isAccessibleForFree' => ! $article->is_premium,
    ];

    if ($article->is_premium) {
        $schema['hasPart'] = [
            '@type' => 'WebPageElement',
            'isAccessibleForFree' => false,
            'cssSelector' => '.paywall',
        ];
    }

    return response()
        ->view('articles.show', compact('article', 'hasFullAccess', 'schema'))
        ->header('Cache-Control', $article->is_premium && $hasFullAccess ? 'private, no-store' : 'public, max-age=300');
}
```

```blade
<script type="application/ld+json">{!! json_encode($schema, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) !!}</script>

<div class="article-intro">{!! $article->intro_html !!}</div>

@if($hasFullAccess && $article->is_premium)
    <div class="paywall">{!! $article->body_html !!}</div>
@elseif($hasFullAccess)
    {!! $article->body_html !!}
@else
    @include('articles.subscribeBox')
@endif
```

Build the schema in PHP: written out in a view, `@context` would be compiled as a Blade directive. Behind a load balancer, configure trusted proxies so that `$request->ip()` returns the client's address.

### Symfony

Versions: Symfony 6.4, 7.4 and 8.x.

Same logic: the controller computes `hasFullAccess` (`$this->isGranted('ROLE_SUBSCRIBER')` or a verified crawler with `$request->getClientIp()`, with the result cached), builds the schema array and sets the cache header with `$response->setPrivate()` and `no-store` for the full version. In Twig:

```twig
<script type="application/ld+json">{{ schema|json_encode(constant('JSON_UNESCAPED_SLASHES') b-or constant('JSON_UNESCAPED_UNICODE'))|raw }}</script>

<div class="article-intro">{{ article.introHtml|raw }}</div>

{% if hasFullAccess %}
    <div class="paywall">{{ article.bodyHtml|raw }}</div>
{% else %}
    {{ include('article/_subscribe_box.html.twig') }}
{% endif %}
```

Declare `trusted_proxies` in `config/packages/framework.yaml` if a proxy sits in front of the application.

### Next.js

Versions: Next.js 15 and 16 (App Router).

The classic trap: a client component that receives the whole article in its props and decides whether to display it. The text is then in the server response. Decide in a server component; `lib/googlebot.ts`:

```ts
import { reverse, lookup } from 'node:dns/promises';

export async function isVerifiedGooglebot(ip: string, userAgent: string): Promise<boolean> {
  if (!userAgent.includes('Googlebot')) return false;

  try {
    const [host] = await reverse(ip);
    if (!/\.(googlebot|google|googleusercontent)\.com$/.test(host)) return false;

    const addresses = await lookup(host, { all: true });
    return addresses.some((entry) => entry.address === ip);
  } catch {
    return false;
  }
}
```

`app/articles/[slug]/page.tsx`:

```tsx
import { headers } from 'next/headers';
import { isVerifiedGooglebot } from '@/lib/googlebot';

export default async function ArticlePage({ params }: { params: Promise<{ slug: string }> }) {
  const { slug } = await params;
  const article = await getArticle(slug);
  const requestHeaders = await headers();
  const ip = requestHeaders.get('x-forwarded-for')?.split(',')[0].trim() ?? '';

  const hasFullAccess =
    !article.premium ||
    (await isSubscriber()) ||
    (await isVerifiedGooglebot(ip, requestHeaders.get('user-agent') ?? ''));

  const jsonLd = {
    '@context': 'https://schema.org',
    '@type': 'NewsArticle',
    mainEntityOfPage: `https://example.com/articles/${article.slug}/`,
    headline: article.title,
    datePublished: article.publishedAt,
    dateModified: article.updatedAt,
    isAccessibleForFree: !article.premium,
    ...(article.premium && {
      hasPart: { '@type': 'WebPageElement', isAccessibleForFree: false, cssSelector: '.paywall' },
    }),
  };

  return (
    <article>
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd).replace(/</g, '\\u003c') }}
      />
      <h1>{article.title}</h1>
      <div className="article-intro" dangerouslySetInnerHTML={{ __html: article.introHtml }} />
      {hasFullAccess ? (
        <div className={article.premium ? 'paywall' : undefined} dangerouslySetInnerHTML={{ __html: article.bodyHtml }} />
      ) : (
        <SubscribeBox />
      )}
    </article>
  );
}
```

Calling `headers()` makes the page dynamic: it is no longer statically generated, which is intended. Read `x-forwarded-for` only if it is written by your own proxy or your platform.

### Nuxt

Versions: Nuxt 3 and 4.

The full text must only ever come out of a server route (`server/api/articles/[slug].get.ts`) that checks the session or the crawler before returning `bodyHtml`; otherwise it returns only the lead-in. Forward the headers of the original request during server rendering, then declare the schema:

```vue
<script setup lang="ts">
const route = useRoute();
const { data: article } = await useFetch(`/api/articles/${route.params.slug}`, {
  headers: useRequestHeaders(['cookie', 'user-agent', 'x-forwarded-for']),
});

useHead({
  script: [{
    type: 'application/ld+json',
    innerHTML: JSON.stringify({
      '@context': 'https://schema.org',
      '@type': 'NewsArticle',
      headline: article.value?.title,
      isAccessibleForFree: false,
      hasPart: { '@type': 'WebPageElement', isAccessibleForFree: false, cssSelector: '.paywall' },
    }),
  }],
});
</script>

<template>
  <article>
    <h1>{{ article?.title }}</h1>
    <div class="article-intro" v-html="article?.introHtml" />
    <div v-if="article?.bodyHtml" class="paywall" v-html="article.bodyHtml" />
    <SubscribeBox v-else />
  </article>
</template>
```

The `isVerifiedGooglebot` function from the Next.js section can be used as is in the server route.

## Common mistakes

- **Hiding the text with CSS or JavaScript** (`display: none`, an overlay, a blur): the content stays in the HTML, readable by anyone. This is the case Google describes as unreliable.
- **Opening the wall on the “Googlebot” user agent alone**: one line of curl is enough to read the whole site, and scrapers know it.
- **Blocking Googlebot behind the wall while adding the markup**: the markup declares a section that Google does not receive; only the lead-in is indexed.
- **Relying on `noarchive`**: Google has not used this rule since the “Cached” link disappeared. To limit what is reused in snippets, use `data-nosnippet` or `max-snippet` ([preview controls](https://checklist-seo-geo.com/en/ai-crawler-access-data-policy/check-nosnippet-max-snippet-data-nosnippet)). Bing documents its own directives: check its page.
- **Caching the full version** on the CDN or in the page cache: it is served again to everyone.
- **Marking up free articles with `isAccessibleForFree: false`**, or using an ID selector (`#paywall`) instead of a class.
- **Distributing the full text elsewhere**: a full-text RSS feed, the AMP version, a public API, hydration data (`__NEXT_DATA__`, `__NUXT__`). For the feed, see [publish a complete RSS or Atom feed](https://checklist-seo-geo.com/en/media-publishers/publish-complete-rss-atom-feed).

## Frequently asked questions

### Does Google consider a paywall to be cloaking?

No, a paywall is not cloaking if Google can see all the content placed behind it, just as a subscriber can, and if the site follows its flexible sampling guidance. Google also asks for paywalled content markup (`isAccessibleForFree` set to `false` and, preferably, `hasPart` with a class selector) to tell this case apart from concealment.

### Does Google index text hidden behind a paywall?

Google indexes only the text present in the HTML it receives. If the server sends the full article to Googlebot, all the text can be indexed and appear in snippets, unless you set otherwise with `data-nosnippet` or `max-snippet`. If Googlebot receives only the lead-in, only the lead-in is indexed and the article ranks for fewer queries.

### Is isAccessibleForFree markup required?

The markup is required only if you show Googlebot content that a non-subscriber does not see and that you want indexed. In that case, `isAccessibleForFree` is the property Google requires. If the crawler receives exactly the same page as an anonymous visitor, there is no gap to declare, but the markup is still useful information.

### Can AI assistant crawlers read my paywalled articles?

A crawler reads only what the server sends it. If the full text is in the public HTML or served to any client that claims to be Googlebot, any crawler can retrieve it by spoofing that name. With a server-side wall and identity verification through reverse DNS or published addresses, only the crawlers you explicitly allow get access.

### How many free articles should I allow with metering?

Google sets no threshold. Its flexible sampling guidance recommends monthly rather than daily metering, suggests starting from ten articles per month for visitors arriving from Search and then testing, and notes that most daily news publishers find their balance between six and ten. The right number depends on your audience and has to be measured.

## Resources

- [Google Search Central: structured data for subscription and paywalled content](https://developers.google.com/search/docs/appearance/structured-data/paywalled-content?hl=en)
- [Google Search Central: flexible sampling general guidance](https://developers.google.com/search/docs/appearance/flexible-sampling?hl=en)
- [Google Search Central: fix Search-related JavaScript problems, including JavaScript paywalls](https://developers.google.com/search/docs/crawling-indexing/javascript/fix-search-javascript?hl=en)
- [Google Search Central: spam policies, cloaking](https://developers.google.com/search/docs/essentials/spam-policies?hl=en#cloaking)
- [Google: verify requests from Googlebot and other Google crawlers](https://developers.google.com/crawling/docs/crawlers-fetchers/verify-google-requests?hl=en)
- [Google Search Central: robots meta tag, data-nosnippet and noarchive](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag?hl=en)
- [Bing Webmaster Tools: supported robots meta tags](https://www.bing.com/webmasters/help/robots-meta-tags-and-attributes-that-bing-supports-5198d240)
- [Schema.org: isAccessibleForFree](https://schema.org/isAccessibleForFree)
- [Yoast: schema API (`wpseo_schema_*` filters)](https://developer.yoast.com/features/schema/api/)

Next steps: [follow the content policies of Google News and Discover](https://checklist-seo-geo.com/en/media-publishers/follow-content-policies-google-news-discover), [create a Google News sitemap](https://checklist-seo-geo.com/en/media-publishers/create-google-news-sitemap) and [provide large images with max-image-preview:large](https://checklist-seo-geo.com/en/media-publishers/provide-large-images-max-image-preview-large).
