Knowledge Base

Hi, How can we help?

Quick Start: Cloudflare R2

This detailed guide will walk you through the entire process of integrating Cloudflare R2 with Offload  Media. We will cover how to create and configure an R2 bucket, generate API tokens, and adjust the plugin’s settings.

Follow these steps to successfully set up Cloudflare R2 with your offload media plugin.

Step 1: Log in to Your Cloudflare Account

Log in to your Cloudflare account and navigate to your Cloudflare Dashboard.

Step 2: Create a Cloudflare R2 Bucket

In the Cloudflare Dashboard, scroll down the left sidebar to find R2 Object Storage, then click on it.

From there, click on the “ Create Bucket “ button to begin the process of creating your bucket.

Step 3: Configure Bucket Settings

Next, enter a unique and recognisable name for your bucket.

Leave the other settings at their default values, and click “Create Bucket” to complete the process.

Note: Will be using the bucket name when configuring the plugin. 

Step 4: Cloudflare Bucket Public URL

Once the bucket is created, go to settings, and scroll down to the “Public Development URL” section on your bucket’s details page.

Click “Enable” to grant access to your public development URL, allowing anyone to view the bucket contents via the R2.dev link.

Then, A pop-up will appear, asking you to type “allow” to grant permission.

You will get the Cloudflare Bucket Public development URL from here. Dont forget to copy the URL as it is needed while configuring the ‘ CDN / Custom End Point URL ‘ of the plugin.  

Step 5: Create Cloudflare Access Key & Secret Key

For creating Access key and secret key, return to your Cloudflare Dashboard >> navigate to R2 Object Storage Overview, click on “ Manage API tokens “ from the window .

This will redirect you to the R2 API page. Click the “ Create Account API Token “ button to begin creating your API token

Step 6: Configure API Token Settings

An  API creation page will appear, where you’ll need to configure the settings for your API.

Start by assigning a name to your API. In the Permissions section, select “Admin Read & Write“.

Finally, click the ”  Create Account API Token “ button.

Step 7: Retrieve Access and Secret Keys

Here, you will find the Accound ID, Access Key and Secret Key. Be sure to copy them right away, as you will not be able to access this page again later

Configure Plugin

Step 1: Navigate to the Configuration Page

After successfully installing the plugin, go to the WordPress admin dashboard and select: Offload Media >> Configure

Step 1: Choose Your Cloud Service

On the service selection page, choose “ Cloudflare “ as the Storage Provider you want to configure.

If you need additional help during setup, a link to the documentation page is provided for your convenience.


Step 2:Configuring Connection method

a) If you select the first option (defining the access key and secret key in wp-config.php), your R2 credentials will be stored in wp-config.php, keeping them secure and out of the database.

You can configure this by adding  the following lines to your wp-config.php, replacing the placeholders with your actual access key, secret key, and account ID:

define( ‘ACOOFM_SETTINGS’, serialize( array(

    ‘provider’ => ‘r2’,

    ‘access-key-id’ => ‘your-access-key’,

    ‘secret-access-key’ => ‘your-secret-key’,

    ‘account-id’ => ‘your-account-id’,

) ) );

b) If you choose the second method (“I understand the risk, but I’d like to store access keys in the database”), you will need to enter the credentials from your Cloudflare R2 account, typically including your Access Key, Secret Key, Account ID, and Bucket Name.

Note: If your Account ID looks like 7de1234a588187060ff5f50ff69c4bde525.r2.cloudflarestorage.com, remove the .r2.cloudflarestorage.com part and use only 7de1234a588187060ff5f50ff69c4bde525.

After entering the credentials, click “ Continue “ to verify them.

Step 3: Verify and Save Configuration

Here, you need to choose “I already have an R2 bucket “ as the “ Create or Choose Bucket “ option and then enter the bucket name that we created earlier. Once done..Click verify

Once the credentials are verified: If successful, you’ll see a confirmation screen.If verification fails, you’ll have the option to go back and edit your credentials easily.

Click “ Save and continue “ option to complete the setup.

Congratulations! You’ve successfully configured the Offload Media plugin with Cloudflare R2. Your media files are now ready to be seamlessly offloaded to your cloud storage.

Customer Support

If you have questions about our plugin(s), are experiencing issues with any of our plugin