How to clean up a large WordPress Media Library safely

A Media Library cleanup should not depend on keeping a browser tab open for every attachment. On a large library, processing everything in one request can run into execution-time or memory limits. Splitting the work into smaller requests helps, but the job also needs a saved position and a way to avoid duplicate workers.

SEO Media Manager Pro 1.3.0 uses Action Scheduler for existing-library jobs. Here is how to approach a large cleanup, what the saved job protects, and what it does not.

Choose the library you actually want to process

Before starting, decide whether the rules apply to every attachment. A site can contain photographs, PDFs, SVGs, audio and documents with different naming conventions. A photograph rule that removes all numbers may be unsuitable for an annual report or a numbered episode.

Use the file-type filter to narrow the complete library or a custom selection. Check a small sample from that group first. Keep the database backup available: cancellation is a way to stop further work, not a rollback of completed changes.

Review the rules before the job starts

Use the editable live preview to check representative filenames, including dates, abbreviations and unusual characters. Save the rules before starting the job. The job takes a settings snapshot, so changing the settings afterwards does not change the rules already captured for it.

Existing-library processing starts from each original filename without the extension. It does not keep reformatting a previously transformed title. The job also captures its library boundary, excluding new uploads added afterwards.

Understand the background queue

Action Scheduler is a WordPress job queue also used by WooCommerce. Instead of asking one request to process the entire library, SEO Media Manager Pro schedules bounded workers of up to 20 attachments and stores progress between them.

Action Scheduler claims and a product-level expiring lock prevent duplicate workers from processing the same job concurrently. An interrupted worker can leave a lock temporarily, so recovery is designed around that lock rather than starting overlapping jobs immediately.

This is not a promise that every host will finish at the same speed. File counts, database performance, other queued work and scheduling all affect completion. The plugin does not need the settings screen to stay open, but the server still needs to execute scheduled requests.

If progress appears to stop

  1. Return to the Batch processing screen and read the saved status. Do not infer a failure just because an open screen stopped refreshing.
  2. Check whether WordPress scheduled work is running. Sites with WP-Cron disabled need an alternative cron runner.
  3. Review recent results for item-level failures. The summary retains the most recent 100 results, not a permanent record of every attachment.
  4. Allow recovery to resume the existing saved job. Avoid repeated restarts or changing the rules mid-investigation.
  5. If you need to stop, cancel the job and wait for the current worker to finish. Inspect already processed attachments before deciding what to do next.

A browser refresh, a cancellation request and a database restore are different actions. Only the restore can put previously changed metadata back to its backed-up state. Keeping that distinction clear is more useful than treating every stalled screen as a failed batch.

Review metadata rather than just the completion message

Open representative processed attachments after the job completes. Check the title and the extra fields you enabled. Original files are not renamed or modified, and this workflow does not rewrite every image already embedded in post content.

Try the rules and editable preview with SEO Media Manager Free for future uploads. The live demo shows saved workflow results. For setup and recovery controls, use the plugin guide. If you are deciding whether Pro fits your backlog, compare the available plans.

Filed under: