Advanced Media Offloader WP CLI: Simply Bulk Offload Your Media to Cloud

wpfitter advmo wp cli bulk offload

Advanced Media Offloader now supports WP CLI, giving you command-line power to bulk migrate your entire media library to cloud storage—fast, reliable, and without the WordPress admin bottlenecks.

Whether you’re migrating a site with thousands of images, automating daily maintenance tasks, or troubleshooting specific upload issues, our new WP CLI media management tools provide the precision and control you need.

Complete WP CLI Usage Guide for Offloading media files to Cloud Storage

Before using WP CLI commands, ensure Advanced Media Offloader is installed and activated, and your cloud storage is configured and connected.

Basic Commands

Offload All Non-Offloaded Media

wp advmo offload

This command offloads all media attachments to cloud storage that haven’t been moved yet, making it perfect for migrating your entire WordPress media library to the cloud storage.

Offload Specific Attachments

Target individual media files by their attachment ID:

wp advmo offload 123

For multiple specific files, use comma-separated IDs:

wp advmo offload 142,256,389,501

Limit Files Per Operation

Control the number of files processed in a single operation:

wp advmo offload --limit=100

This processes only the 100 most recently uploaded media files.

Skip Previously Failed Offloads

Avoid re-processing files that previously failed to offload:

wp advmo offload --skip-failed

Continuing your offload process while bypassing files that need separate troubleshooting.

Advanced Combinations

Combine flags for maximum control:

wp advmo offload --limit=50 --skip-failed

This processes up to 50 recent files while skipping any with previous failures.

Real-World Usage Scenarios

Scenario 1: Initial Site Migration

When migrating an existing WordPress site to cloud storage.

# Start with a small test batch
wp advmo offload --limit=10

# If successful, process larger batches
wp advmo offload --limit=100

# Finally, process everything
wp advmo offload

Scenario 2: Automating the Media Offload Process

To automate the media offloading process, you’ll need to create a cron job that runs the WordPress CLI command at regular intervals.

Setting up the cron job:

  1. Open your server’s crontab by running crontab -e in your terminal
  2. Add the following line to schedule the offload process to run every 30 minutes:
*/30 * * * * cd /path/to/public_html && wp advmo offload

⚠️ Important: Make sure to replace /path/to/public_html with the actual path to your WordPress installation directory

Scenario 3: Offloading Specific Files

Ideal for targeting important files that need immediate offloading or testing individual attachments when troubleshooting issues.

wp advmo offload 1001,1002,1003

Performance Tips

  1. Batch Processing: Use --limit for better resource management
  2. Off-Peak Processing: Run large operations during low-traffic periods
  3. Skip Failed Files: Use --skip-failed to avoid wasting time on problematic files
  4. Monitor Progress: Watch output for any patterns in failures

Conclusion

WP CLI support adds command-line control to Advanced Media Offloader. Whether you’re migrating an existing site, managing ongoing uploads, or troubleshooting specific files, you can now handle these tasks efficiently from the terminal.

Have questions or feedback? We’d love to hear about your experience with the new WP CLI support. Share your use cases, automation scripts, or suggestions for future enhancements in the comments below.

One response

  1. Lionel Loeb Avatar
    Lionel Loeb

    Thanks that’s wonderfull to have a cli now. Someday can be good to have a paid option to get a WebP converter for the already uploaded files (R2 for me) and local files.

Leave a Reply to Lionel LoebCancel reply