Documentation

WordPress

Protect Media Library files

Privately serve WordPress Media Library files after an x402 payment.
Last reviewed August 9, 2026

Run the routing check

Open Access402 → Media settings and run the server routing test before protecting a file. WordPress must receive requests for the existing attachment URL so the plugin can enforce payment.

Create the media rule

Choose Media Library file, search by title or filename, select the attachment, and set its USDC price and access policy. The MIME type is detected from WordPress metadata.

Storage behavior

The adapter preserves the attachment record, metadata, and original URL while moving the public file bytes into private storage. After payment, WordPress streams the file at the same URL.

Deleting the final rule for a protected file restores its public storage state. Keep a backup before changing production storage behavior.

Hosting compatibility

CDNs, object-storage offload plugins, reverse proxies, and host-level static-file shortcuts can bypass WordPress. Review those layers before launch and repeat the routing check whenever hosting or media delivery changes.