View Categories

WP-CLI Support for reGenerate Thumbnails Advanced

RTA includes WP-CLI support, which allows you to manage thumbnail regeneration directly from the command line.

You can view all available commands by running wp help rta

Currently, RTA provides three WP-CLI commands: wp rta regenerate / clear / status

Regenerate #

Regenerates image thumbnails based on the settings configured in your WordPress admin area > Tools > Regenerate Thumbnails.

wp rta regenerate [--onlyFeatured] [--startDate=] [--endDate=]

Options

--onlyFeatured
Regenerates thumbnails only for featured images.

--startDate=<date>
Processes images uploaded on or after this date (inclusive).
The date must be compatible with strtotime, for example 2024-01-31.

--endDate=<date>
Processes images uploaded on or before this date (inclusive).
The date must be compatible with strtotime, for example 2024-01-31.

Examples

Regenerate thumbnails for all images using the current plugin settings:

wp rta regenerate

Regenerate thumbnails only for featured images:

wp rta regenerate --onlyFeatured

Regenerate thumbnails for images uploaded after a specific date:

wp rta regenerate --startDate="2024-02-01"

Regenerate thumbnails for images uploaded before a specific date:

wp rta regenerate --endDate="2024-01-31"

Regenerate thumbnails for featured images uploaded within a specific date range:

wp rta regenerate --onlyFeatured --startDate="2024-01-01" --endDate="2024-01-31"

Clear #

wp rta clear

Clears the current processing queue and stops any ongoing regeneration.

Status #

wp rta status

Displays the status of the current thumbnail regeneration process, if one is running.