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: Daily Maintenance Script
Create a cron job for automatic daily processing:
#!/bin/bash
# Daily media offload script
cd /path/to/your/wordpress/site
wp advmo offload --limit=50 --skip-failed
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
- Batch Processing: Use
--limit
for better resource management - Off-Peak Processing: Run large operations during low-traffic periods
- Skip Failed Files: Use
--skip-failed
to avoid wasting time on problematic files - 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.
Leave a Reply