Cloudflare R2 media offload for your WordPress site
What the R2 module does
Six settings decide where your media lives and how it gets there.
Connect your own bucket
Enter your Account ID, Access Key ID, Secret Access Key and bucket name. Add a public URL if you serve files from your own domain.
Send new uploads by itself
Switch on Auto Offload New Media, and each file you upload goes to your bucket on its own. There is no extra step to remember.
Serve files from R2
Switch on Enable URL Rewrite, and your pages load each image and file from R2 or your CDN address instead of your server.
Delete local copies safely
Delete Local Files removes a file from your server only after R2 answers with HTTP 200. Until then, the local copy stays.
Choose Fast or Complete
Fast mode sends the full size of each image only. Complete mode also sends every smaller size that WordPress made from it.
Bulk sync older media
The Bulk Sync Media tab moves the files you uploaded before. A background sync also runs every hour, in batches of 1 to 50 files.
What Cloudflare R2 media offload does
Every image, video and file you upload to WordPress is stored on your web server. As the media library grows, it takes disk space, and every visit asks that one server for the files. Cloudflare R2 media offload moves those files to your own bucket in Cloudflare R2.
R2 is a store for files of any size, a kind of object storage. Your pages keep working as before. Once the address rewrite is on, they simply load each file from R2 or from your own CDN address, so your server has less to send.
How to set it up
First, create a bucket in your Cloudflare account and an access key that may write to it. Then open the R2 settings in the plugin. Enter the Account ID, the Access Key ID, the Secret Access Key and the bucket name. If you serve files from your own domain, add it as the public URL.
Next, choose the upload mode. Fast mode sends the full size of each image only, which keeps the bucket small. Complete mode also sends every smaller size WordPress made, so every size your theme asks for is served from R2. When the details are saved, switch on the options you want.
What happens to your older media
New uploads are only part of the story. Most sites hold years of images before Cloudflare R2 media offload is switched on. The Bulk Sync Media tab moves those older files to your bucket, so the whole library ends up in one place.
You do not have to watch it. A background sync also runs every hour and moves files in batches. You choose the batch size, from 1 to 50 files, so a busy server is never asked to do too much at once.
Keeping your files safe
With Cloudflare R2 media offload, removing local copies frees disk space, but only when it is safe. Delete Local Files removes a file from your server only after R2 has answered with HTTP 200 for it. If the bucket does not confirm a file, the local copy stays where it is.
You can also leave that option off and keep both copies. Your pages are then served from R2, and your server still holds a full copy of the library. If you have a question about your setup, open a ticket in the Support Center, and a person will reply.
Key takeaways
- Cloudflare R2 media offload moves your WordPress media to your own R2 bucket.
- New uploads can go to R2 by themselves, and older files move with Bulk Sync Media.
- Pages can load each file from R2 or your own CDN address.
- Local copies are removed only after R2 confirms each file.
Frequently asked questions
Do I need my own Cloudflare account?
Yes. The files go to a bucket in your own Cloudflare account, and you enter its access key and bucket name in the settings.
Are my local files deleted?
Only if you switch on Delete Local Files, and then only after R2 has confirmed each file. With it off, your server keeps a full copy.
What about the media I uploaded before?
Use the Bulk Sync Media tab to move it. The hourly background sync also moves older files in small batches.
Questions about moving your media?
Tell us how large your media library is and where you want it served from. We will help you set up the bucket and the module.

