Bunny CDN
Bunny CDN is a pull-zone CDN you put in front of your storage bucket. Once it is set up, WP Media Cloud serves your media from the pull zone’s hostname, purges replaced files automatically and shows bandwidth on the Dashboard.
Before you start#
- A Bunny.net 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, since the pull zone fetches them from there.
- Bunny CDN and Bunny Edge Storage are separate products. If you store your files in Bunny Edge Storage, the pull zone is chosen during storage setup and this page does not apply. This page covers Bunny CDN in front of Amazon S3, Google Cloud Storage, DigitalOcean Spaces, Wasabi, Hetzner, Backblaze B2 and other S3-compatible storage. Cloudflare R2 has no CDN choice.
Step 1: Create a Bunny CDN pull zone#
- In the Bunny dashboard, open CDN and click Add Pull Zone.
- Name: a unique name. It becomes part of the default hostname.
- 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] - DigitalOcean Spaces:
https://[space-name].[region].digitaloceanspaces.com - Hetzner:
https://[bucket-name].[region].your-objectstorage.com - Backblaze B2: your bucket’s public URL
- Amazon S3:
- Click Add Pull Zone. Bunny gives it a hostname such as
[zone-name].b-cdn.net.
Step 2: Add a custom domain (optional)#
- In the pull zone, click Add Custom Hostname and enter your subdomain, for example
cdn.example.com. - In your DNS, create a CNAME record from that subdomain to
[zone-name].b-cdn.net. - Bunny issues an SSL certificate once DNS has updated.
Step 3: Get your API key#
In the Bunny dashboard, go to Account > API Keys and copy your API key. WP Media Cloud uses it to list your pull zones, purge replaced files and read bandwidth.
Step 4: Choose Bunny CDN in WP Media Cloud#

In Settings (every provider except Amazon S3):
- Go to Media Cloud > Settings and find your provider’s CDN card, for example Wasabi CDN.
- Choose Bunny CDN.
- Paste your key into Bunny API Key and click Load zones.
- Select your pull zone in Pull Zone. The CDN URL is filled in from it; change it to your custom domain if you added one.
- Click Save Settings, then Update all media URLs under Apply to Existing Media.
Amazon S3 has no CDN card in Settings: choose Bunny CDN in the setup wizard (Settings > run the setup wizard).
Step 5: 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 pull zone hostname or custom domain.
- Open the address in a browser. The first request is slower while the edge cache fills.
Cache TTL and purging#
The default cache TTL is set in the pull zone under Caching.
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 the pull zone automatically, with every image size. This needs your Bunny API key in the plugin settings, and Auto purge CDN on replace on in Settings > Offload Behaviour (the default). See Automatic CDN purge.
To purge anything else, use Tools > Purge Cache for your pull zone in the Bunny dashboard.
Store downloads#
With Bunny CDN in front of an S3-type bucket, WooCommerce and Easy Digital Downloads secure downloads are signed links on the bucket’s own address, made with your storage keys. They do not go through the pull zone, so nothing needs setting up in Bunny. Leave Token Authentication off on this pull zone: it applies to every file in the pull zone, and your images would stop loading.
Bunny Token Authentication is only used when your files are in Bunny Edge Storage; see WooCommerce secure downloads.
Dashboard analytics#
With Bunny CDN selected and a pull zone chosen, the Dashboard shows:
- CDN Bandwidth: traffic delivered by the pull zone over the selected period.
- CDN Bandwidth, Last 7 Days: a daily chart; 7D, 14D and 30D change the period.
- Storage Used: from your storage provider where it reports it, otherwise counted from WP Media Cloud’s records.
Bunny stats are cached for 15 minutes. The refresh button fetches them now.
Configure with wp-config.php#
Replace <PROVIDER> with AWS, GCS, DO, WASABI, HETZNER, B2, S3 or S3COMPAT:
define( 'WPMC_<PROVIDER>_CDN_TYPE', 'bunny' );
define( 'WPMC_<PROVIDER>_BUNNY_API_KEY', 'your-api-key' );
define( 'WPMC_<PROVIDER>_PULL_ZONE_ID', '123456' );
define( 'WPMC_<PROVIDER>_PULL_ZONE_HOSTNAME', 'yourzone.b-cdn.net' );
define( 'WPMC_<PROVIDER>_CDN_URL', 'https://yourzone.b-cdn.net' ); Media addresses are built from the CDN URL, so always set it. Constants override values saved in Settings.
Troubleshooting#
- Media addresses still use the bucket: check that Bunny CDN is selected in your provider’s CDN card and the CDN URL is filled in, with
https://and no trailing slash. Save, click Update all media URLs, and clear your page cache. - The CDN returns 404: the pull zone’s origin is wrong, or the file is not at that path in the bucket. Compare the origin with your bucket’s public address, and open the file at the bucket’s own address.
- The CDN returns 403: the bucket does not allow public reads. See your storage provider’s guide.
- The CDN returns the wrong file or a stale cached version: check that Auto purge CDN on replace is on and your Bunny API key is saved. For files changed outside WordPress, purge them in the Bunny dashboard under Tools > Purge Cache.
- Images stopped loading after turning on Token Authentication: turn it off for this pull zone (see Store downloads).
- No pull zones in the list: check the API key, then make sure the pull zone exists in your Bunny account.
- Custom domain not working: check the CNAME points at the pull zone hostname and DNS has updated. The SSL certificate can take a few minutes after that.
- Dashboard shows no bandwidth: select the pull zone in Settings so its ID is saved. A new pull zone shows data once it has served traffic.