| 开发者 | huzaifaalmesbah |
|---|---|
| 更新时间 | 2026年10月17日 02:59 |
| PHP版本: | 8.1 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
media.yoursite.com) with Cloudflare, Amazon CloudFront, BunnyCDN or your storage provider's built-in CDN. Your visitors only see your brand.
Works with these cloud storage providers
wp-config.php instead, and the settings screen locks those fields.wp omnioffloader status.--concurrency moves many files at once, so big libraries finish much sooner.wp omnioffloader verify confirms every file is really in your cloud storage and fixes anything missing.omnioffloader/v1) and WP-CLI (wp omnioffloader) are available.
Filters: omnioffloader_cloud_providers, omnioffloader_object_acl, omnioffloader_attachment_key, omnioffloader_attachment_delete_keys, omnioffloader_should_offload_attachment, omnioffloader_use_async_upload, omnioffloader_should_apply_retention, omnioffloader_media_block_names, omnioffloader_log_provider_errors, omnioffloader_multipart_threshold, omnioffloader_transfer_concurrency, omnioffloader_bulk_failure_limit, omnioffloader_free_disk_space, omnioffloader_cpanel_quota_file, omnioffloader_check_folder_claim.
Actions: omnioffloader_before_offload, omnioffloader_after_offload, omnioffloader_before_restore, omnioffloader_after_restore, omnioffloader_transfer_heartbeat.
Full reference with examples: Hooks and WP-CLI.
Licensing note
This plugin includes the AWS SDK for PHP (Apache-2.0). It is compatible with GPLv3, which this plugin's "GPL-2.0-or-later" license covers.
Amazon S3, Cloudflare R2, DigitalOcean Spaces, Backblaze B2 and Wasabi each have their own setup. Any other S3-compatible storage (MinIO, Storj, OVHcloud, Linode, Scaleway and more) works through Any S3-Compatible Storage, where you enter the address and region from your provider.
https://media.yourdomain.com) or turn on the public r2.dev address, so visitors can see your files.https://<account-id>.r2.cloudflarestorage.com).us-east-1) and your CloudFront or CDN address. Leave the address empty to serve straight from S3.https://nyc3.digitaloceanspaces.com) and the region (nyc3).https://s3.us-east-005.backblazeb2.com) and its region (us-east-005).keyID and applicationKey.us-east-1).For Storj:
https://link.storjshare.io/s/<KEY>/<BUCKET>. Change /s/ to /raw/.https://gateway.storjshare.io as the Endpoint URL and us-east-1 as the region, and turn on Use Path-Style Endpoint. Add your keys and bucket name, and paste the https://link.storjshare.io/raw/... link as your Custom Domain / CDN URL.Most storage buckets don't show files to the public by default, and Cloudflare R2 has no public address at all until you add one. Connecting your own domain or a CDN to the bucket lets visitors see your media, and lets the CDN cache it close to them.
No. OmniOffloader changes image addresses as each page loads, so posts, pages, featured images and responsive images all keep working. Your post content is never edited, and you don't need to search and replace anything in your database.
No. The default, Retain Local Files, deletes nothing. The cloud simply becomes a second copy. Choose Smart Local Cleanup to remove only the extra sizes WordPress creates and keep every original, or Full Cloud Migration to free the most space. A file is only removed from your server after its cloud copy is confirmed.
It mostly matters when you move a lot of media at once: offloading your existing library, or Bring Back. It sets how many files move at the same time:
It depends on your server's connection to your storage, the size of your files, and how many image sizes your theme creates. A faster Transfer Speed finishes sooner if your server can handle it. Yes, you can close the tab: the job keeps running in the background. Only on hosts that block WordPress's background requests does the job need the Offload page to stay open. There, leave it open until it finishes, or use WP-CLI.
Yes, that's what Bring Back is for. It downloads your media to its original place on your server, checks that every file arrived, and then loads everything from your server again. Bring back one item, a set number, or your whole library. Your cloud copy is kept unless you choose to delete it.
It depends on what you chose to keep on your server. With Retain Local Files, everything is still on your server, so nothing changes. With Smart Local Cleanup or Full Cloud Migration, some or all files are only in the cloud, and they would stop showing. Run Bring Back before you deactivate in that case.
Go to OmniOffloader → Tools → Failed Items. You'll see each item with the reason it failed. Fix the cause (for example a lost connection, or a file that is missing on your server), then click Retry Failed Offloads. In Media → Library (list view), the Offload failed filter shows the same items.
Run wp omnioffloader verify from WP-CLI. It checks every offloaded file in your cloud storage and on your server, and lists anything missing. Add --repair to fix what it can: it uploads or downloads the missing files and never deletes anything.
A new policy only applies to new uploads at first. To apply it to media you already offloaded, go to OmniOffloader → Tools → Apply Retention Policy to Existing Media. Before any file is deleted from your server, its cloud copy is checked, and missing files are uploaded first. Switching to a policy that keeps more files downloads them to your server again.
Yes. With Retain Local Files, turn off Serve Media from Cloud in Settings. Your media is still copied to the cloud, but your site keeps loading it from your server. When your CDN is ready, turn it on and everything switches at once, with nothing uploaded again. Clear your page cache after the switch. (With the other two policies, files are removed from your server, so media always loads from the cloud.)
No. A copy has your live site's settings and keys, so without protection it could upload into your live bucket or delete files your live site still uses. OmniOffloader notices a copy and turns on Safe mode. It notices when:
localhost, .local or .test.define( 'OMNIOFFLOADER_SAFE_MODE', true ); (or false) to wp-config.php, or turn off Protect the live site when this is a copy in Settings.Yes, for example example.com, shop.example.com and blog.example.com. Install OmniOffloader on each site with the same bucket, keys and CDN address, and give each site its own folder in Settings → Custom Path Prefix (such as www, shop and blog).
Each site marks its folder, so two sites can't overwrite or delete each other's files. Settings won't let you pick a folder another site already uses. If the folder really belongs to this site (for example after a domain change), click This folder belongs to this site.
On Amazon S3, you can also give each site its own access key that only works in its own folder.
It stays in the old folder and keeps working. To move it into the new folder, use Tools → Move Media to the Current Folder, or run wp omnioffloader move --all. Within the same bucket, your storage provider copies the files itself, so nothing is downloaded to your server.
Yes. Add them to wp-config.php as constants named OMNIOFFLOADER_{PROVIDER}_{FIELD}, for example:
define( 'OMNIOFFLOADER_CLOUDFLARE_R2_KEY', '...' );
define( 'OMNIOFFLOADER_CLOUDFLARE_R2_SECRET', '...' );
These always win over saved settings, and the settings screen shows those fields as locked. Either way, your secret key is never sent back to the browser.
Only administrators. Other users upload and delete their own media as usual. With Mirror Delete on, deleting media also deletes its cloud copy.
Files over 64 MB are uploaded in parts, so a dropped connection only costs one part, and files over 5 GB work too. If your host still cuts a transfer short, that item is reported with the reason and the job moves on.
Yes. Progress stays live with LiteSpeed Cache, Breeze, Redis and Memcached. On your public pages, OmniOffloader only changes image addresses, and doesn't slow them down with extra database work.
Yes, site by site. Each site in the network has its own settings, keys and jobs. Only a network administrator can point a site at a private or local storage address. Multisite hasn't had a dedicated test pass yet, so please try it on a staging network first.
Yes. OmniOffloader → Tools lists every command with examples and copy buttons. The main ones:
wp omnioffloader offload --all offloads every local item.
wp omnioffloader restore --all brings everything back.
wp omnioffloader retention applies a changed retention policy to existing media.
wp omnioffloader move --all moves media into the current folder.
wp omnioffloader verify --repair checks every file and fixes what it can.
wp omnioffloader errors --retry retries failed offloads.
wp omnioffloader status shows what is running and your media counts.
wp omnioffloader stop stops the running job.
Every command that changes something supports --dry-run, so you can see what it would do first. Only one job runs at a time, so two jobs never touch the same files.
Yes. The first offload takes a while on a big library, since every existing file is copied to the cloud once. After that, new uploads are offloaded automatically, so there's nothing more to do. Jobs run in small steps, so memory use stays low however big your library is, and a stopped job continues where it left off. For the fastest results on a big library, use WP-CLI (see the next question).
Use WP-CLI on your server and move more files at once, for example wp omnioffloader offload --all --concurrency=32 (up to 64). Try a short run first with --limit=500. To keep a long job running after you close the terminal, start it like this:
nohup wp omnioffloader offload --all > ~/offload.log 2>&1 &
Check on it any time with wp omnioffloader status, and stop it with wp omnioffloader stop. Run the same command again to continue where it stopped. Step by step: Long runs and log files.
wp omnioffloader verify checks that every offloaded file is in your cloud storage and on your server. Add --repair to fix what it finds; it never deletes anything.wp omnioffloader errors lists media with errors, retries failed offloads (--retry) and clears old errors (--clear).wp omnioffloader status --format=json, for monitoring scripts.