KeyCDN
KeyCDN is a content delivery network with zone-based pricing and a public API. WP Media Cloud serves your media from your KeyCDN zone, purges replaced files automatically and shows bandwidth on the Dashboard. It works in front of every S3-type storage provider the plugin supports.
Before you start#
- A KeyCDN account.
- A storage provider set up in WP Media Cloud with a passing Health check, and files that are publicly readable at the bucket’s own address.
- Your KeyCDN API key.
Bunny Edge Storage and Cloudflare R2 have no CDN choice. Amazon S3 has no CDN card in Settings, so choose KeyCDN in the setup wizard.
Step 1: Create a KeyCDN pull zone#
In the KeyCDN dashboard, open Zones and click Add Zone:
- Zone Name: a unique name.
- Zone Type: Pull.
- Origin URL: your bucket’s public address, for example:
- Amazon S3:
https://[bucket-name].s3.[region].amazonaws.com - Wasabi:
https://s3.[region].wasabisys.com/[bucket-name] - Backblaze B2: your bucket’s public URL
- DigitalOcean Spaces:
https://[space-name].[region].digitaloceanspaces.com - Hetzner:
https://[bucket-name].[region].your-objectstorage.com
- Amazon S3:
Click Save. KeyCDN gives the zone an address such as [zone-name]-[hash].kxcdn.com.
Step 2: Find your API key#
Go to Account > API in the KeyCDN dashboard and copy the key. WP Media Cloud uses it to list your zones, purge replaced files and read bandwidth.
Step 3: Choose KeyCDN in WP Media Cloud#

- Go to Media Cloud > Settings and find your provider’s CDN card, for example Wasabi CDN.
- Choose KeyCDN.
- Paste your key into KeyCDN API Key and click Load zones.
- Select your zone in Zone. This saves the zone ID and sets the CDN URL to the zone’s address.
- Click Save Settings, then Update all media URLs under Apply to Existing Media.
Step 4: Check it works#

- Upload a test image in Media > Add New Media File.
- Open it in the Media Library and check the File URL starts with your KeyCDN zone address.
- Open the address in a browser and check the image loads.
Purging replaced files#
When an image optimizer or Enable Media Replace uploads a new version of a file under the same name, WP Media Cloud purges the old copy from KeyCDN automatically, with every image size. This uses the API key and zone you selected, and needs Auto purge CDN on replace on in Settings > Offload Behaviour (the default). See Automatic CDN purge.
Dashboard analytics#
With KeyCDN configured, the Dashboard shows:
- CDN Bandwidth: bytes delivered by the zone over the selected period.
- CDN Bandwidth, Last 7 Days: a daily chart; 7D, 14D and 30D change the period.
- Storage Used: KeyCDN does not report storage, so it comes from your storage provider where it reports it, or is counted from WP Media Cloud’s records.
With a custom S3-compatible endpoint, KeyCDN bandwidth is not read.
Configure with wp-config.php#
Replace <PROVIDER> with AWS, GCS, DO, WASABI, HETZNER, B2, S3 or S3COMPAT:
define( 'WPMC_<PROVIDER>_CDN_TYPE', 'keycdn' );
define( 'WPMC_<PROVIDER>_KEYCDN_API_KEY', 'your-api-key' );
define( 'WPMC_<PROVIDER>_KEYCDN_ZONE_ID', '123456' );
define( 'WPMC_<PROVIDER>_KEYCDN_ZONE_URL', 'yourzone-1a2b.kxcdn.com' );
define( 'WPMC_<PROVIDER>_CDN_URL', 'https://yourzone-1a2b.kxcdn.com' ); Media addresses are built from the CDN URL, so always set it. The zone ID is used for purging and bandwidth. Constants override values saved in Settings.
Troubleshooting#
- Media addresses still use the bucket: check that KeyCDN is selected and a zone is chosen in your provider’s CDN card. Save, click Update all media URLs, and clear your page cache.
- The zone returns 404: the zone’s Origin URL is wrong, or the bucket is not public. Open a file at the bucket’s own address first, then compare it with the Origin URL.
- API key not accepted: copy it again from Account > API. Keys are case-sensitive.
- The zone list does not load: check the API key, and that your server can make outbound HTTPS requests to
api.keycdn.com. - A replaced image still shows the old version: check Auto purge CDN on replace is on and a zone is selected, so its ID is saved.
- Dashboard shows no bandwidth data: check a zone is selected. A new zone shows data once it has served traffic. Also check you are on WP Media Cloud 1.2.0 or later.