Faster image delivery. Optimize in seconds

WordPress Image Optimization with Cloudflare R2: Step-by-Step Setup

August 23, 2026

Cloudflare R2 WordPress setup: editorial illustration showing WordPress media files offloading to Cloudflare R2 storage with WebP and AVIF conversion
Home » Cloudflare R2 WordPress Setup

A Cloudflare R2 WordPress setup starts by installing Image Offload & Optimize and connecting your account. Your images are stored on the plugin’s hosted Cloudflare R2 storage, with no bucket or credentials to configure. The whole process takes under 10 minutes. Image Offload handles storage, file offloading, CDN delivery, and WebP/AVIF conversion. No code changes required.

Cloudflare R2 WordPress setup comparison: local server with heavy image load versus offloaded server with R2 storage handling media delivery

Key Highlights

  • Cloudflare R2 charges zero egress fees, so you pay nothing for bandwidth when serving images to visitors
  • A Cloudflare R2 WordPress setup through Image Offload requires no bucket or credentials to configure
  • Built-in WebP and AVIF conversion is included, which most competing plugins do not offer natively
  • The Agency plan costs $129/year for up to 25 sites, a fraction of what enterprise-grade offload plugins typically charge
  • Responsive delivery via <picture> tags and srcset works out of the box

Why WordPress Image Optimization Needs Object Storage

WordPress stores every uploaded image on your web server by default. That works fine for a single small site. At scale, though, it creates real problems: bloated server storage, slow delivery to international visitors, and mounting hosting costs as your library grows.

Moving images off your server to object storage solves all three. Cloudflare R2 has become a strong option for this. It is S3-compatible, charges no egress fees, and sits on Cloudflare’s global network. The missing piece is a WordPress plugin that connects everything without requiring custom code. That is exactly what Image Offload & Optimize does.

Why R2 Stands Out on Cost

Most object storage providers charge for both storage and bandwidth. AWS S3 egress fees, for example, accumulate quickly once you are serving thousands of images per day. Cloudflare R2 removes the egress cost entirely. You pay only for storage, which starts at $0.015 per GB per month, with the first 10 GB free each month.

For image-heavy WordPress sites, photographers, WooCommerce stores, and media publishers, that pricing model makes a meaningful difference. Because R2 sits on Cloudflare’s infrastructure, you also get low-latency global delivery without needing a separate CDN layer on top.

Cloudflare’s R2 pricing documentation covers the full breakdown so you can model your own costs before committing.

How to Connect WordPress to Cloudflare R2

The Cloudflare R2 WordPress setup involves five steps. Work through them in order.

  1. Create Your Image Offload & Optimize Account

    Sign up at app.imageoffload.com. No credit card is required on the free tier. Your images are stored on Image Offload & Optimize’s hosted Cloudflare R2 storage, so there is no bucket, API token, or cloud account to configure.Cloudflare R2 WordPress setup Step 1: create a free Image Offload account at app.imageoffload.com with no credit card required

  2. Install and Activate the Plugin

    1. In your WordPress admin, go to Plugins > Add New
    2. Search for Image Offload & Optimize
    3. Install and activate the pluginCloudflare R2 WordPress setup Step 2: install and activate the Image Offload plugin from the WordPress admin plugins page

  3. Connect Your Account

    1. In your dashboard at app.imageoffload.com, copy your API key
    2. Open the Image Offload settings panel in wp-admin
    3. Paste the API key into the API key field and save settings
    4. The plugin will run a connection test and confirm the site is linked to your accountCloudflare R2 WordPress setup Step 3: paste your API key from the Image Offload dashboard into the WordPress plugin settings to connect

  4. Configure Offloading Behaviour

    At this point, you need to decide whether to remove local copies of images after offloading or keep them as a fallback. Removing local copies saves server disk space, which is the whole point. However, keeping local copies during initial setup is safer while you confirm delivery is working correctly.
    For most sites, the right approach is to keep local copies for the first week. Confirm everything is serving correctly, then enable removal. That sequence avoids broken image URLs during a configuration problem.

  5. Test the Connection

    Upload a test image through the WordPress media library. Check the file URL. It should now point to the CDN (cdn.imageoffload.com) rather than your server’s wp-content/uploads directory. Confirm the image loads correctly in the browser before offloading your existing media library.
    If the URL still points to your server, confirm your API key is saved correctly in the plugin settings.Cloudflare R2 WordPress setup Step 5: verify your image URLs point to cdn.imageoffload.com CDN instead of your WordPress server

WebP and AVIF Conversion in Your Cloudflare R2 WordPress Setup

Offloading images to R2 reduces server load and bandwidth costs. Converting those images to WebP or AVIF compounds the performance gain. Modern formats can reduce file size by 30 to 80 percent compared to JPEG or PNG without visible quality loss. That means faster load times and lower storage costs at the same time.

Image Offload handles conversion on its managed servers on every tier, including free. There is no processing load on your host. WebP conversion is included on all tiers. AVIF is a paid-tier feature (Solo and above). The converted images are what get stored on the hosted R2 storage and served to visitors.

Responsive delivery happens automatically through <picture> tags and srcset attributes. Browsers receive the right image size and format for the device and viewport without any additional configuration on your part.

Image Offload vs WP Offload Media

WP Offload Media is the established player in this space. It works, it is stable, and it has a long track record. It also does not support Cloudflare R2. If R2 is your target storage provider, WP Offload Media is simply not an option. The integration does not exist.

Image Offload’s Agency plan covers up to 25 sites for $129/year, a fraction of what an unlimited-site license from an established competitor typically runs. Storage is fully hosted on Cloudflare R2. It includes native WebP and AVIF conversion, which WP Offload Media does not offer without a separate plugin.

The honest tradeoff: WP Offload Media has been around longer and has a larger user base. If you are already running it on S3 and it is working without issues, there is no urgent reason to switch. But if you are starting fresh or specifically want R2 with built-in image conversion, the cost and feature difference is hard to ignore.

Practical Recommendation

Start with the free tier to confirm your Cloudflare R2 WordPress setup works with your specific configuration before committing to a paid plan. The free tier gives you full hosted-R2 offloading and server-side WebP conversion. That is enough to validate the entire workflow at no cost.

Cloudflare R2 WordPress setup plugin comparison: Image Offload with native R2 support versus WP Offload Media limited to S3 storage

Once you have confirmed images are serving correctly from the CDN, upgrade to Solo ($49/year) for AVIF conversion on a single site, or Agency ($129/year) if you manage up to 25 sites from one dashboard.

Do not try to configure everything at once. Get the account connected, confirm delivery is working, then layer in conversion and optimization settings. Attempting to enable all features simultaneously is the most common reason people abandon the setup halfway through.

FAQ

How do I connect WordPress to Cloudflare R2?

Create an account at app.imageoffload.com, install Image Offload & Optimize on your WordPress site, then paste your API key into the plugin settings. Storage is fully hosted on Cloudflare R2. No bucket, API token, or credentials to configure. The process takes under 10 minutes and requires no code changes.

Is Cloudflare R2 free for WordPress image storage?

The first 10 GB of storage per month is free. Beyond that, R2 costs $0.015 per GB. Critically, egress (bandwidth) is free on R2, meaning you are not charged for serving images to your visitors. That is where costs accumulate quickly on AWS S3.

Does Image Offload & Optimize support WebP and AVIF conversion?

Yes. Conversion runs on managed servers on every tier, including free. There is no processing load on your host. WebP is included on all tiers. AVIF is available on Solo and above. Converted images are stored on the hosted R2 storage and served automatically.

How does Image Offload compare to WP Offload Media for Cloudflare R2?

Image Offload supports Cloudflare R2 natively. WP Offload Media does not. Image Offload includes built-in WebP and AVIF conversion. WP Offload Media requires a separate plugin for format conversion. Image Offload’s Agency plan covers up to 25 sites for $129/year.

Will offloading images to R2 affect my WordPress site’s performance?

It improves it. Images served from R2 via Cloudflare’s network load faster for international visitors than images served from a single-region web server. Removing image files from your server also reduces disk I/O and storage overhead, which benefits overall server performance.

Get Started

Image Offload & Optimize is free to install. The free tier gives you hosted Cloudflare R2 offloading and WebP conversion at no cost. That is a complete WordPress image optimization workflow before you spend a penny. When you are ready for AVIF conversion and to manage multiple sites from one dashboard, the Agency plan at $129/year covers up to 25 sites. Install Image Offload & Optimize from the WordPress plugin directory and have your first images serving from R2 today.