WP-CLI#
wp bb-media index [--restart] [--batch=200] [--hash] [--unattached] # index every attachment's files (resumes)
wp bb-media scan # files in uploads no attachment owns
wp bb-media status # counts, queues, server checks
wp bb-media lookup <url-or-path> # what the index knows about a file
wp bb-media verify [--fix] # the index against the disk and the metadata
wp bb-media hash [--originals] [--limit=<n>] [--sleep=<ms>] # SHA-1 for files that have none
wp bb-media usage [--restart] # where files are used: full scan
wp bb-media unused [--files] [--live] [--older-than=30] [--format=table|csv|json|ids]
wp bb-media where <attachment-id|url>
wp bb-media regenerate [<id>...] [--missing] [--budget=20] [--sleep=0] [--dry-run]
wp bb-media optimize [<id>...] [--all] [--recompress [--include-smushed]] [--remove] [--budget=20] [--dry-run]
unused and where only read. optimize --remove deletes only the copies BB Media writes (name.ext.webp,
name.ext.avif), and purges BB Cache afterwards.