WordPress plugin that uploads existing Media Library video attachments to Cloudflare Stream and serves ready videos through the Cloudflare Stream player.
This is an independent project. It is not affiliated with, endorsed by, or sponsored by Cloudflare, Inc. “Cloudflare” and “Cloudflare Stream” are trademarks of Cloudflare, Inc., used here only to describe compatibility.
- WordPress 6.5 or newer
- Tested up to WordPress 7.0
- PHP 8.1 or newer
- A Cloudflare account with an active Stream subscription
- A scoped Cloudflare API token with Account → Stream → Edit or Account → Stream → Write permission
- Lists local WordPress video attachments in
Media → Cloudflare Stream. - Uploads selected videos to Cloudflare Stream by URL-copy first.
- Falls back to server-side direct upload for files under 200 MB when URL-copy fails.
- Stores Stream UID/status metadata on the WordPress attachment.
- Non-destructively syncs existing Cloudflare Stream videos back to matching WordPress video attachments when metadata or a unique exact title/filename match identifies the local attachment.
- Deletes selected Cloudflare Stream videos from the plugin dashboard, individually or in bulk, while keeping the original WordPress media attachments.
- Self-managing WP-Cron status polling while videos are processing.
- Optional automatic frontend replacement for Gutenberg video blocks, WordPress
[video]shortcodes, local<video>HTML, and direct local video-file links when the matching Stream video is ready. - Manual shortcode:
[voffloadcfs_video id="123"]or[voffloadcfs_video uid="VIDEO_UID"]. - Non-destructive Cloudflare connection test.
- Structured dashboard with workflow overview, setup status pills, action descriptions, and clearer destructive-action styling.
- Setup checklist in the WordPress dashboard collapses after a successful connection test and can be reopened with one click.
- Dashboard footer displays the current plugin version, copyright attribution, and GPLv2-or-later license notice.
- Does not delete local files; remote Cloudflare Stream deletion is available only through explicit delete actions with confirmation.
The plugin needs three Cloudflare values. In WordPress, go to Media → Cloudflare Stream → Settings. The same checklist is shown there.
Use the Cloudflare Account ID for the account where Stream is enabled. You can find it in the Cloudflare dashboard URL and account overview.
Create a scoped API token. Do not use the Global API Key.
Recommended token setup:
- Open Cloudflare Dashboard → Manage Account → API Tokens.
- Create a custom token.
- Add the account-level permission
Account → Stream → Edit. In some Cloudflare screens the equivalent permission is shown asAccount → Stream → Write. Upload, sync/reconnect, status refresh, and remote deletion use this scoped Stream permission. - Scope Account Resources to the single Cloudflare account that owns the Stream library.
- Do not add DNS, Zone, Workers, Cache Purge, or Global API Key permissions. They are not needed.
- Copy the token immediately after creation. Cloudflare shows the token secret only once.
For better security, store the API token outside the database by adding this to wp-config.php:
define( 'VOFFLOADCFS_API_TOKEN', 'xxx' );When this constant is set, the plugin uses it and does not write the token to the WordPress options table.
The Customer Code is the CODE part in:
customer-CODE.cloudflarestream.com
To find it, open Cloudflare Dashboard → Stream → Videos, open any uploaded video, and copy the embed/iframe code. You may paste the bare code, the full customer subdomain, the iframe URL, or the full iframe snippet into the plugin setting; the plugin extracts and stores only the code.
- Install and activate the plugin.
- Go to
Media → Cloudflare Stream. - Enter Account ID, API token, and Customer Code.
- Run
Test Cloudflare connection. If the test succeeds, the setup checklist collapses automatically and can be reopened by clicking the checklist heading. - Select videos and click
Upload selected. - Wait until Cloudflare marks the videos ready. The plugin can then replace matching local video output automatically.
- To remove a remote Stream copy later, use
Delete from Cloudflarefor one video row or select multiple rows and use the bulk delete button. The local WordPress media attachment remains.
If videos already exist in Cloudflare Stream because you used an earlier unpublished build, click Sync existing Cloudflare Stream videos or select rows and click Reconnect selected from Cloudflare. As a final fallback, paste a Stream UID and attach it to one selected WordPress video. Reconnection is non-destructive and uses stored metadata first, then exact unique title/filename matches for the current site.
The dashboard intentionally separates remote Cloudflare actions from local WordPress media management:
- Upload creates a remote Stream copy and keeps the local WordPress attachment.
- Refresh reads Cloudflare processing status and now attempts safe reconnect when the local UID is missing.
- Reconnect links existing Stream videos back to local attachments when there is a safe metadata or exact unique filename/title match.
- Delete from Cloudflare removes only the remote Stream asset and clears local Stream metadata. It does not delete the WordPress media attachment.
- Clear local Stream metadata removes the local mapping only. It does not contact Cloudflare.
By WordPress attachment ID:
[voffloadcfs_video id="123"]
By Cloudflare Stream UID:
[voffloadcfs_video uid="VIDEO_UID"]
Optional attributes:
title— accessible iframe title.aspect— aspect ratio aswidth/height, for exampleaspect="16/9".
Run a PHP syntax check:
find voffload-cloudflare-stream -name '*.php' -print0 | xargs -0 -n1 php -lBuild an installable ZIP:
bash bin/build-zip.shThe build script creates dist/voffload-cloudflare-stream.zip.
The WordPress.org plugin directory uses readme.txt in SVN trunk to find the Stable tag; that stable tag must point to a matching folder under /tags/. Keep the version in voffload-cloudflare-stream.php, readme.txt, and the SVN tag folder synchronized.
GPL-2.0-or-later. See LICENSE.
Recommended repository topics: wordpress-plugin, wordpress, cloudflare, cloudflare-stream, video, video-hosting, streaming, media-library, media-offload.