Home / Docs / Advanced Operations / WP-CLI Command Reference
Advanced Operations

WP-CLI Command Reference

Complete terminal reference for Clockwork Offloader Pro WP-CLI commands: high-speed bulk offloading, verification, and automated background jobs.

Overview

Clockwork Offloader Pro includes a comprehensive WP-CLI command suite designed for DevOps engineers, agency webmasters, and high-volume WordPress sites. Running offloading operations from the command line prevents PHP web worker timeouts, memory exhaustion, and HTTP gateway errors.

1. Bulk Offloading Media (wp clockwork-offloader offload)

Offload all media library attachments and their generated thumbnails to Amazon S3:

# Offload all attachments on the current site
wp clockwork-offloader offload

# Offload attachments across EVERY site in a WordPress Multisite network
wp clockwork-offloader offload --all-sites

# Force re-uploading and verifying files that were previously marked offloaded
wp clockwork-offloader offload --force

# Customize batch size (default: 50 attachments per batch)
wp clockwork-offloader offload --batch-size=100

# Perform a dry-run without uploading or deleting local files
wp clockwork-offloader offload --dry-run

2. Verification & Integrity Audits (wp clockwork-offloader verify)

Verify that every media attachment registered in your WordPress database actually exists in your Amazon S3 bucket:

# Check integrity on the current site
wp clockwork-offloader verify

# Verify all sites in a multisite network
wp clockwork-offloader verify --all-sites

# Automatically re-upload any attachments found missing from S3
wp clockwork-offloader verify --fix

3. Restore Media to Web Server (wp clockwork-offloader restore)

Need to migrate away from AWS or copy attachments back to your local server filesystem for staging? Pro includes a bi-directional restore engine:

# Download all offloaded files from S3 back to wp-content/uploads/
wp clockwork-offloader restore

# Restore all sites in a multisite network
wp clockwork-offloader restore --all-sites

4. Check System & Storage Status (wp clockwork-offloader status)

Output active S3 connection state, bucket name, total offloaded media count, and reclaimed server storage in megabytes:

wp clockwork-offloader status
Automation with Cron: You can schedule offload verification via system crontab:
0 3 * * * /usr/local/bin/wp clockwork-offloader offload --all-sites --path=/var/www/html > /dev/null 2>&1