Skip to main content
The Xenarch WordPress plugin detects AI bots on your site, returns HTTP 402 with x402 payment terms, and serves the page once the bot has paid. Pricing, gating and the receiving wallet are set in the Xenarch dashboard. The plugin enforces them.

Requirements

  • WordPress 6.0 or later
  • PHP 7.4 or later
  • A wallet on Base to sign in to dash.xenarch.dev with

Installation

The plugin is not in the WordPress.org plugin directory yet, and no packaged release is published. Build the zip from the xenarch-plugins repository (Node.js is needed for the admin UI):
The script writes xenarch-<version>.zip to the wordpress folder. Upload it under Plugins > Add New > Upload Plugin and activate it.

Setup

  1. Go to Settings > /xenarch in WordPress admin.
  2. Click Connect with Xenarch. You are sent to dash.xenarch.dev.
  3. Sign in with your wallet, confirm the domain, and you return to WordPress with the site paired. The plugin stores the site token for you.
  4. On the plugin’s settings tab, review the gate toggle, bot categories, pricing and the receiving wallet. The same settings are shown in the dashboard.

Features

Bot detection

The plugin matches known AI bot signatures in six categories. New sites start with these defaults: Toggle categories on or off and override single bots (allow or charge) in the dashboard.

Pricing rules

  • A default price for every page. New sites start at $0.001.
  • Path rules, for example /premium/* at $0.01.
  • Free paths (price $0).
Prices range from $0 to $1 per request.

Receiving wallet

Payments go to your account’s receiving wallet, which starts as the wallet you signed in with. If you link more wallets to your account, you can pick which one receives gate revenue on the plugin’s settings tab. A newly linked wallet becomes eligible after a 24-hour cooldown.

What passes through

  • Human visitors always pass.
  • Logged-in users and admin pages are never gated.
  • Search crawlers (Google, Bing and others) pass free.
  • Social preview bots (link unfurlers) pass free.
  • Bots that paid pass after the payment is verified.

Discovery documents

The plugin serves /.well-known/pay.json (pay.json v1.2) and /.well-known/xenarch.md (payment instructions in Markdown) from your dashboard settings. No manual file is needed.

Bot activity

Detection events are sent to the Xenarch platform and shown in the dashboard. The plugin keeps no local bot log table.

How it works

  1. Request comes in. Admin pages, logged-in users and /.well-known/ paths are skipped.
  2. If the request carries X-Xenarch-Gate-Id and X-Xenarch-Tx-Hash, the plugin verifies them with POST /v1/gates/{gate_id}/verify and serves the page on success. Verified pairs are cached for 5 minutes.
  3. If the request carries a standard x402 X-PAYMENT header, the plugin settles it through the platform (POST /v1/gates/{gate_id}/settle-x402) and serves the page on success.
  4. Free paths, disabled gating, 404 pages and static assets are served.
  5. Otherwise the plugin classifies the visitor: empty User-Agent, known bot signature, search crawler, HTTP client library, browser proof, header scoring for browser-like agents, or unknown non-browser traffic.
  6. Allowed categories and bots are served. Suspicious browser-like traffic gets a browser check page (HTTP 403).
  7. Everything else gets HTTP 402 with the gate body and discovery headers: Link (pointing at pay.json and xenarch.md), X-Pay-Json and X-Xenarch.
  8. The bot pays USDC to your wallet through an x402 facilitator and retries with proof of payment. The page is served.