Besides Amazon S3 and Cloudflare R2, Amazon S3 Storage can connect experimentally to Backblaze B2, Wasabi and DigitalOcean Spaces. These providers have no fields in the settings: you set the provider, endpoint and keys with a short PHP snippet, and support for them is best effort.
To follow this page, you should be comfortable adding code snippets to your WooCommerce store. Using Cloudflare R2? It’s built in, so follow Connect Cloudflare R2 instead and don’t use a snippet.
When you’d use this
- Your files already live with Backblaze B2, Wasabi or DigitalOcean Spaces.
- You want to try one of these providers before committing to it, and you’re comfortable checking the results yourself.
How to use it
1. Gather your provider’s details
You need a bucket, an access key pair that can list buckets and read and write files, the provider’s region, and its S3 endpoint:
| Provider | Keys | Endpoint |
|---|---|---|
| Backblaze B2 | Application key ID and application key | https://s3.<region>.backblazeb2.com (the region is part of your bucket’s S3 endpoint, such as us-west-004) |
| Wasabi | Access key and secret key | https://s3.<region>.wasabisys.com |
| DigitalOcean Spaces | Spaces access key and secret | https://<region>.digitaloceanspaces.com |
Your provider’s documentation lists its regions and endpoints. Create your buckets with the provider: the plugin can’t create them for you.
2. Choose the experimental provider setting
Go to WooCommerce » S3 storage, set Cloud service provider to User defined (experimental), and click Save changes. The credentials and endpoint fields disappear, because the snippet supplies them. Until you add the snippet, the page shows: "You have selected to use an experimental cloud service provider. This is an advanced setup that requires utilizing specific WordPress filter hooks."
3. Add the snippet
Add this snippet with your own values in place of the text in angle brackets. The first filter names the provider: backblaze, wasabi or digitalocean. The second passes the region, endpoint and keys to the storage client. This example is for Backblaze B2:
add_filter( 'woocommerce_amazon_s3_client_cloud_service', fn() => 'backblaze' );
add_filter( 'woocommerce_amazon_s3_client_args', function( $args ) {
return array_merge( $args, [
'region' => '<your region>',
'endpoint' => 'https://s3.<your region>.backblazeb2.com',
'credentials' => [
'key' => '<your application key ID>',
'secret' => '<your application key>',
],
] );
} );
The same snippet is kept up to date in our public snippets library.
4. Choose a bucket and test
Reload WooCommerce » S3 storage. With an experimental provider, the plugin doesn’t test the connection, so the remaining sections show whether or not the snippet works. Choose your bucket under S3 bucket (an empty list means the keys or endpoint are wrong), tick Enable if you want automatic offloading, and save.
Then save a downloadable product and check its S3 status. Automatic offloading works only when your bucket’s region code is in the plugin’s Default region list (see the list). If the file shows Failed, upload your files with the provider’s own tools and link them with the S3 shortcode, including bucket and region in each shortcode.
Common issues
A file shows Failed
With Debug mode on, the log shows "Failed to get region for bucket". The plugin doesn’t recognize your provider’s region code, so it can’t offload to that bucket. Link your files with the S3 shortcode instead, with bucket and region in each.
The bucket dropdown is empty
The plugin couldn’t list your buckets. Check the keys, region and endpoint in the snippet, and that the key is allowed to list buckets. Turn on Debug mode and look for "Failed to list buckets" under WooCommerce » Status » Logs.
Downloads fail with SignatureDoesNotMatch or 403 Forbidden
The region or endpoint doesn’t match the bucket, or the key pair is wrong. Copy them again from your provider and update the snippet.
I need more detail in the logs
Tick Debug mode in the settings. For the raw requests to your provider as well, add this line for a short time, then remove it, because it logs a lot of data:
add_filter( 'woocommerce_amazon_s3_client_debug_mode', '__return_true' );
Something still doesn’t work
Experimental providers may not support every feature. Contact our support team with your site URL, the provider and what you see; we’re glad to help where we can and to hear what would make your provider work better.
