If you offer any subscription-based access to your website content, or if users must register for access to any content you want to be indexed, you can add structured data to the website that helps Google differentiate paywall content from the practice of cloaking.

How to Add?

Step 1: Add a class name around each paywall section of your page. For example:

<body>
<p>This content is outside a paywall and is visible to all.</p>
<div class="paywall">This content is inside a paywall, and requires a subscription or registration.</div>
</body>

Step 2: Add NewsArticle structured data. (Click here for details)

Step 3: Now, add the following JSON-LD structured data to your NewsArticle structured data. The cssSelector references the class name that you added in Step 1.

{
"@context": "https://schema.org",
"@type": "NewsArticle",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://example.org/article"
},
(...)
"isAccessibleForFree": "False",
"hasPart": {
"@type": "WebPageElement",
"isAccessibleForFree": "False",
"cssSelector": ".paywall"
}
}

AMP

For AMP, use amp-subscriptions where appropriate.