LLMAffiliate AI Traffic Monetizer

Description

LLMAffiliate AI Traffic Monetizer is a WordPress plugin that detects Large Language Model (LLM) traffic and dynamically serves enhanced content while ensuring compliance with search engine parity requirements.

It mirrors the behavior of an interception layer (e.g., Cloudflare Worker) directly inside WordPress, enabling controlled content delivery for AI crawlers and agents.

CORE FEATURES

  • Detects major LLM user agents including ChatGPT, Claude, Gemini, Copilot, Perplexity, Pi, LLaMA, Grok, Cohere, Mistral, Anthropic, and OpenAI.
  • Ensures Googlebot and search engine crawlers always receive original content (configurable parity enforcement).
  • Serves enhanced HTML responses via a remote content service.
  • Automatically falls back to native WordPress rendering if the external service fails.
  • Adds cache-control, licensing, and optional Text and Data Mining headers.
  • Supports secure QA overrides using HMAC-signed query parameters.

HOW IT WORKS

The plugin intercepts incoming HTTP requests and:

  1. Identifies whether the request originates from an LLM or standard browser.
  2. If LLM traffic is detected:
    • Fetches enhanced content from a configured external service.
    • Applies headers and response transformations.
  3. If the service fails:
    • Falls back to WordPress rendering safely.
  4. Ensures search engines always receive unmodified content.

USE CASES

  • AI traffic handling and request analysis
  • Controlled content delivery for LLM vs. human visitors
  • Response parity handling (search engines receive origin content)
  • Experimentation with LLM-specific rendering in compliant deployments

OPERATIONAL LOGGING & PRIVACY

An in-plugin setting (Settings LLMAffiliate AI Traffic Advanced Detection Settings) allows you to disable request and suspicious-event logging. When disabled, no logs are stored. When enabled (default), the plugin may store operational or security logs. These may include:
* IP address
* User agent
* Requested URL
* Referer
* Selected HTTP headers
* Detection and decision metadata
* Suspicious-event or request logs

This logging is used for debugging, security analysis, and request classification. Data is stored within your WordPress database. Configure and retain logs in accordance with your privacy policy and applicable regulations.

AI TERMS PAGE

The plugin can serve a public /ai-terms page (or equivalent) that displays your site’s AI usage and content terms. It functions as a site-published policy page that visitors—including AI systems and human readers—can view. Site owners are responsible for the contents and legal suitability of the terms. The plugin includes a default template; you may customize it to match your needs.

External services

This plugin connects to the LLM Affiliate cloud service to detect visiting AI crawlers (ChatGPT, Perplexity, Claude, Gemini, Copilot, etc.) and return an LLM-optimized, monetizable version of the requested article. Without this external service the plugin still performs local LLM detection, search-engine parity, and renders the /ai-terms page, but the enhanced-content feature is not available.

This service is provided by LLM Affiliate (llmaffiliate.com).

Service endpoints used:

  1. Site OnboardingPOST https://api.llmaffiliate.com/api/v1/enhanced-content/onboarding/

    • Purpose: Registers your WordPress site with the LLM Affiliate backend so the site can receive enhanced content. Think of it as a one-time (idempotent) handshake.
    • When it is sent: Only when you click Generate Token in the plugin admin screen (Settings LLMAffiliate AI Traffic). It is also re-sent if you regenerate/rotate the token. It is not sent on every page load.
    • Data sent (JSON body):
      • token – the authentication token generated by the plugin
      • site_id – an internal site identifier (e.g., site_xxxxxxxx) generated by the plugin
      • host – your site’s public URL (WordPress home_url())
    • No post content, no user data, no visitor IP, and no visitor PII is transmitted by this endpoint.
  2. Enhanced Content RenderGET https://api.llmaffiliate.com/api/v1/enhanced-content/render

    • Purpose: Fetches the LLM-optimized HTML version of a single article URL to serve back to the detected AI crawler.
    • When it is sent: Only when the plugin’s LLM detector classifies an incoming request as an AI/LLM user-agent (ChatGPT, Perplexity, Claude, Gemini, Copilot, LLaMA, Grok, Cohere, Mistral, DeepSeek, Pi, and similar). It is not sent for human visitors, for search-engine crawlers (Googlebot, Bingbot), or for admin/REST/static-asset requests.
    • Data sent (query string + pass-through headers):
      • url – the public URL of the article being requested (query string + path)
      • llm_profile – the detected LLM profile name (e.g., chatgpt, claude, gemini)
      • User-Agent header – forwarded from the visiting LLM client
      • Accept-Language header – forwarded from the visiting LLM client
      • X-LLM-Profile header – the plugin’s detected profile
      • X-LLM-Confidence header – a numeric confidence score (0–1) from the local detector
    • No cookies, session IDs, logged-in-user identifiers, or page body content are sent. Only the public URL and the minimum context needed to produce and attribute enhanced content is transmitted.

All requests are made over HTTPS. If the service is unavailable or returns a non-200 response, the plugin adds an X-LLMAFFTM-Interceptor: fallback header and allows WordPress to render the normal (origin) page — humans and LLMs always receive something.

Use of the LLM Affiliate service is governed by the provider’s terms. Please review them before generating a token:

  • Terms of Service: https://llmaffiliate.com/terms
  • Privacy Policy: https://llmaffiliate.com/privacy
  • Service provider homepage: https://llmaffiliate.com/

Installation

Automatic installation

  1. Go to Plugins Add New in your WordPress dashboard.
  2. Search for LLMAffiliate AI Traffic Monetizer.
  3. Click Install Now and then Activate.
  4. Go to Settings LLMAffiliate AI Traffic, generate a token, and complete onboarding/integration on LLM Affiliate.
  5. Optionally configure logging and detection threshold in Advanced Detection Settings.

Manual installation

  1. Upload the plugin to /wp-content/plugins/ using the folder name llmaffiliate-ai-traffic-monetizer (this must match the Text Domain header so automated checks and translations stay aligned).
  2. Activate the plugin via the WordPress Plugins screen.
  3. Go to Settings LLMAffiliate AI Traffic.
  4. Generate a token (click Generate Token) and complete onboarding/integration on LLM Affiliate.
  5. Optionally configure logging and detection threshold in Advanced Detection Settings.

FAQ

Does the plugin modify admin or API routes?

No. WordPress admin, login, REST API, and static assets are always bypassed.

What happens if the content service fails?

The plugin logs the failure (if enabled), adds an X-LLMAFFTM-Interceptor: fallback header, and allows WordPress to render normally.

How do signed overrides work?

Enable “Allow Signed Override” and configure an HMAC secret.

Then append:
?llm_profile=&llm_sig=

Signature format:
hash_hmac(‘sha256’, “|”, )

Is this plugin safe for SEO?

Yes. Googlebot and other search crawlers always receive original content, ensuring compliance with search engine guidelines.

Why does Plugin Check report a Text Domain mismatch?

If the plugin lives in a directory with a different name (for example llm-interceptor), some tools compare that folder to the Text Domain and show a warning. Use the directory name llmaffiliate-ai-traffic-monetizer (the plugin slug) under wp-content/plugins/—the same layout as the WordPress.org distribution ZIP.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“LLMAffiliate AI Traffic Monetizer” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.0

  • Initial release.

1.0.1

  • Prefixed plugin identifiers (options, hooks, scripts, classes) with llmafftm_ / LLMAFFTM_. Legacy llm_interceptor_* options are migrated on upgrade. Response headers use X-LLMAFFTM-*.

1.0.2

  • readme: point legal/privacy reference to the public https://llmaffiliate.com/ URL (verified).
  • Removed heredoc templates; AI Terms HTML and admin inline JS use output buffering so variables are escaped in normal PHP flow. JSON-LD built with wp_json_encode().

1.0.3

  • Text domain and settings screen slug aligned with the plugin repository slug: llmaffiliate-ai-traffic-monetizer.

1.0.4

  • AI Terms page stylesheet now uses the proper WordPress asset API (wp_register_style() + wp_enqueue_style() + wp_print_styles()) instead of a direct <link rel="stylesheet"> tag, per the WordPress Plugin Review Team’s guidance on correctly enqueuing CSS and JavaScript.

1.0.5

  • Added a dedicated == External services == section to the readme that fully discloses the LLM Affiliate cloud service (onboarding and enhanced-content render endpoints), the data transmitted, the conditions under which each request is made, and links to the service’s Terms of Service and Privacy Policy — per the WordPress Plugin Review Team’s third-party-service disclosure requirement.
  • Output escaping: every echoed variable in the plugin now flows through an appropriate WordPress escaping function. Proxied HTML documents (the enhanced-content response and the standalone /ai-terms page) are passed through wp_kses() with a full-document allow-list, which is exposed via the new filter llmafftm_allowed_full_html so the list can be extended without modifying plugin files. The JSON-LD structured-data block uses wp_json_encode() inline with the JSON_HEX_TAG|JSON_HEX_AMP|JSON_HEX_APOS|JSON_HEX_QUOT flags so it is safe to inline inside a <script type="application/ld+json"> tag.

1.0.1

  • Replaced remaining raw json_encode() calls with wp_json_encode() (onboarding POST body and suspicious-event debug log) per the WordPress Coding Standards preference for the WP-safe JSON encoder.
  • Replaced urlencode() in the enhanced-content URL builder with rawurlencode() so query-string values are encoded per RFC 3986, as recommended by the WordPress Plugin Review Team and WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode.
  • Verified publicly reachable Terms of Service (https://llmaffiliate.com/terms) and Privacy Policy (https://llmaffiliate.com/privacy) URLs referenced from the == External services == section of this readme.