WordPress Plugin
Complete guide to the TransX402 WordPress plugin — set up IDRX paywalls on your WordPress site without writing any code.
Overview
The TransX402 WordPress plugin enables site owners to monetize content with IDRX micropayments — no coding required. Just install the plugin, enter your API key, set prices in IDR, and toggle paywalls on individual posts or pages.
This is the first x402 plugin in the WordPress ecosystem — no other x402 WordPress plugin exists yet.
Requirements
- WordPress 6.0+
- PHP 8.0+
- A TransX402 account with an API key (register at dashboard.transx402.com)
Installation
From WordPress Admin
- Go to Plugins > Add New in the WordPress admin
- Search for "TransX402 Paywall"
- Click Install then Activate
Manual Upload
- Download the plugin ZIP file from GitHub releases
- Go to Plugins > Add New > Upload Plugin
- Select the ZIP file and click Install Now
- Activate the plugin
Configuration
Main Settings
Go to Settings > TransX402 in the WordPress admin:
| Setting | Description |
|---|---|
| API Key | TransX402 API key (ipk_sandbox_... or ipk_live_...) |
| Default Price (IDR) | Default price for paywalled content (e.g., 5000) |
| Preview Length | First paragraph / First 200 words / Custom excerpt |
| Paywall Style | Overlay / Inline / Blur |
| Custom Message | Custom message on the paywall |
| Enable for | Posts / Pages / Custom post types |
Note: Wallet address, network, and facilitator URL are configured on the TransX402 dashboard — the plugin only needs the API key. This keeps the WordPress setup minimal.
Per-Post/Page Configuration
In the post/page editor sidebar, you'll see the TransX402 metabox:
| Setting | Description |
|---|---|
| Enable Paywall | Toggle to enable paywall for this content |
| Price (IDR) | Override the default price (optional) |
| Preview Content | Custom preview text (optional) |
How It Works
For Visitors (Frontend)
- Visitor opens a paywalled article
- Sees the article preview (first paragraph or excerpt) plus the paywall overlay
- Clicks "Pay with IDRX"
- Connects wallet (MetaMask, Coinbase Wallet, etc.)
- First time only: approve Permit2 for IDRX (one-time, clearly explained)
- Signs the payment authorization (gasless, no ETH needed)
- Article unlocks immediately
- Return visits to the same article are free (payment remembered via localStorage and verified on-chain)
Content Gating
The plugin hooks into WordPress's the_content filter:
This means your premium content is secure — it cannot be accessed by disabling JavaScript or viewing the HTML source.
Paywall Styles
Overlay (Default)
Content blurred behind a centered payment card. This is the most popular choice.
Inline
Paywall card appears inline after the preview content. Suitable for layouts that need a more integrated look.
Blur
Full content is visible but blurred, with a floating payment button. Creates a strong "teaser" effect.
WordPress REST API Endpoints
The plugin registers several WordPress REST API endpoints:
GET /wp-json/transx402/v1/content/:postId
Returns full post content after payment verification.
Required headers:
Verification flow:
- Check transaction hash against the TransX402 API (
/verify/:txHash) - Verify the payment recipient matches the site's wallet
- Verify the payment amount matches the post's price
- Return the full post content
GET /wp-json/transx402/v1/config
Returns the site's TransX402 configuration for the JS library:
GET /wp-json/transx402/v1/post/:postId/requirements
Returns payment requirements for a specific post (x402 format):
Payment Verification and Access
After payment, the reader's access is stored in two places:
- Browser localStorage —
transx402_paid_{postId}= transaction hash (instant, no server round-trip on return visits) - Server-side verification — When fetching content, the transaction hash is verified against the blockchain/facilitator API
This means:
- Return visits are instant (localStorage check)
- Clearing browser data requires re-verification (but payment is still on-chain, so a "restore purchases" flow is possible)
- Different devices require the same wallet to sign a free verification message
Compatibility
| Component | Support |
|---|---|
| WordPress | 6.0+ |
| PHP | 8.0+ |
| Editor | Gutenberg, Classic Editor |
| Themes | Astra, GeneratePress, OceanWP, and other popular themes |
| WooCommerce | Not required, but compatible |
| Caching plugins | WP Super Cache, W3 Total Cache (paywall overlay is JS-rendered, full content fetched via API) |
| SEO | Preview content is indexable by search engines. Full content is behind an API call. |
Testing with Sandbox
- Enter a sandbox API key (
ipk_sandbox_...) in the plugin settings - The plugin automatically connects to the sandbox environment
- Make test payments using free test IDRX
- Once satisfied, switch to a production API key (
ipk_live_...)
No need to change any other configuration — just swap the API key.
Security
- Full post content is never in the initial HTML — it's fetched via REST API after payment verification
- Payment verification happens server-side (PHP calls the facilitator API)
- Wallet address validation on admin settings save
- Nonce protection on admin forms
- REST API endpoints use WordPress nonce + payment verification
- No sensitive data stored in the WordPress database (no private keys, no payment signatures)