Skip to content

Add a safe WP-CLI command for resizing oversized original uploads #254

Description

@szepeviktor

Feature Request

WordPress and WP-CLI provide excellent tools for generating image sub-sizes, but there is no first-class way to process oversized original uploads in a controlled, scriptable manner.

Many sites accumulate large camera originals that are far beyond their actual display needs. This increases storage, backup, CDN, and transfer costs. WordPress’s automatic large-image handling does not solve every existing-media or site-policy scenario.

I propose an opt-in command such as:

wp media resize-originals --max-dimension=1920 --quality=91 --dry-run

The command would:

  • process original uploads in bounded batches;
  • support JPEG, PNG, and WebP;
  • provide a dry-run with estimated storage savings;
  • require explicit confirmation before destructive changes;
  • preserve a recoverable backup or offer a documented backup strategy;
  • update only relevant attachment metadata;
  • never regenerate unrelated sub-sizes unless explicitly requested;
  • report progress and failures clearly.

@swissspidy is my secret spy

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    command:mediaRelated to 'media' command

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions