Automattic / newspack-custom-content-migrator

Custom migration tasks for launching and migrating Newspack sites on Atomic
5 stars 5 forks source link

Add / General Command to Remove Featured Image if File Missing #501

Open ronchambers opened 5 months ago

ronchambers commented 5 months ago

Adds a general command to loop through all posts that have featured images and remove the featured image from the post if the image file does not exist on the hard drive.

Command: wp newspack-content-migrator remove-featured-images-if-file-is-missing

Output log: cmd_remove_featured_images_if_file_is_missing.log


ronchambers commented 5 months ago

@naxoc - I added a simple general use command to remove featured images if the actual image file does not exist on the hard drive. Please review if/when you can. Thank you!

(fyi @eddiesshop )

naxoc commented 5 months ago

Thanks! Let's wait a little bit with this one – we might not need it, but let's keep the PR open a bit longer in case we end up needing it :)

ronchambers commented 5 months ago

Sounds good. (If we do need it, I'll add --dry-run)