Title: WP-CLI Regenerate Thumbnails Specific Date Range
Last modified: October 26, 2025

---

# WP-CLI Regenerate Thumbnails Specific Date Range

 *  [WP SITES](https://wordpress.org/support/users/wordpresssites/)
 * (@wordpresssites)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/wp-cli-regenerate-thumbnails-specific-date-range/)
 * After migration i noticed some product images are blank but the original is still
   ok so i need a command for May – August 2024 using [https://developer.wordpress.org/cli/commands/media/regenerate/](https://developer.wordpress.org/cli/commands/media/regenerate/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [WP SITES](https://wordpress.org/support/users/wordpresssites/)
 * (@wordpresssites)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/wp-cli-regenerate-thumbnails-specific-date-range/#post-18695499)
 * Without doing anything, they now display on the shop page but on the backend,
   they are blank. I wonder if it has anything to do with Jetpack?
 *  [Faisal Ahammad](https://wordpress.org/support/users/faisalahammad/)
 * (@faisalahammad)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/wp-cli-regenerate-thumbnails-specific-date-range/#post-18695651)
 * Hi,
 * You can use the following code to forcibly regenerate thumbnails for the specific
   date range you mentioned. After regeneration, if an image is still blank on the
   server, delete the blank or corrupted images and regenerate again to see if that
   helps.
 *     ```wp-block-code
       wp media regenerate --yes $(wp post list --post_type=attachment --post_mime_type=image --post_status=inherit --after=2024-05-01 --before=2024-08-31 --format=ids)
       ```
   
 * Regarding the Jetpack issue, you can open a support ticket on the [plugin’s support](https://wordpress.org/support/plugin/jetpack/)
   page so they can investigate further and resolve it for you.
 *  Thread Starter [WP SITES](https://wordpress.org/support/users/wordpresssites/)
 * (@wordpresssites)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/wp-cli-regenerate-thumbnails-specific-date-range/#post-18695654)
 * Thank you. There are too many to delete. I have tried but no luck so i will contact
   Jetpack.
 *  [Faisal Ahammad](https://wordpress.org/support/users/faisalahammad/)
 * (@faisalahammad)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/wp-cli-regenerate-thumbnails-specific-date-range/#post-18695670)
 * Before contacting Jetpack, there’s actually a way to delete all the generated
   thumbnails and start fresh, which often fixes corruption issues. You can use 
   this command:
 *     ```wp-block-code
       wp media regenerate --yes --only-missing $(wp post list --post_type=attachment --post_mime_type=image --post_status=inherit --after=2024-05-01 --before=2024-08-31 --format=ids)
       ```
   
 * The –only-missing flag will skip images that already have thumbnails, but if 
   you want to force delete and regenerate everything, you can manually remove the
   thumbnail files first.
 * Actually, the cleaner approach is to use this two-step process. First, remove
   all the generated thumbnail files for that date range by running this command:
 *     ```wp-block-code
       find /path/to/wp-content/uploads/2024/05 /path/to/wp-content/uploads/2024/06 /path/to/wp-content/uploads/2024/07 /path/to/wp-content/uploads/2024/08 -type f -regextype posix-extended -regex '.*-[0-9]+x[0-9]+.(jpg|jpeg|png|gif)' -delete
       ```
   
 * Just replace `/path/to/wp-content/uploads/` with your actual uploads path. This
   finds and deletes only the resized versions (like image-300×300.jpg) but keeps
   your originals safe. Then run the regenerate command from before.
 * If you’re not comfortable with the find command, the regenerate command alone
   should overwrite any corrupted thumbnails anyway. Give it a shot before reaching
   out to Jetpack support.
 * Also make a **complete backup** of your website before running the regenerate
   or delete command so you can restore it to the previous state if anything goes
   wrong.
 *  [https://jetpack.com/resources/how-to-back-up-your-wordpress-site](https://jetpack.com/resources/how-to-back-up-your-wordpress-site)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘WP-CLI Regenerate Thumbnails Specific Date Range’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [Faisal Ahammad](https://wordpress.org/support/users/faisalahammad/)
 * Last activity: [7 months, 2 weeks ago](https://wordpress.org/support/topic/wp-cli-regenerate-thumbnails-specific-date-range/#post-18695670)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
