Closed Mag8891 closed 5 months ago
You mean these commands ?
I can't get the --skip-delete function to remove old images though... I am not the only one I saw who reported it... See this topic.
@Beee4life no this is something completely different e.g. for a test environment I want to import pictures with a script, but some pictures may already exist in the db from previous test versions. In these cases I want to skip importing images that already exist.
Regeneration command is only for images that already exist.
Then your original post is incorrect. You ask if it's possible to : "Skip regenerating existing correctly sized thumbnails"
So yes, that is possible, with the --only-missing
parameter.
I think you need to undertake 2 actions: 1 import the images 2 regenerate (with --only-missing)
I'm not the OP, just having the 2nd issue too. But I guess I'll create a new card for my specific one
sorry my bad, overlooked it.
-Skip regenerating existing correctly sized thumbnails (faster). -Delete thumbnail files for old unregistered sizes in order to free up server space. This may result in broken images in your posts and pages.
These are options of Regenerate Thumbnails plugin. However, the author of the plugin recommends:
If you have command-line access to your site's server, consider using WP-CLI instead of this tool. It has a built-in regenerate command that works similarly to this tool but should be significantly faster since it has the advantage of being a command-line tool.
Unfortunately, WP-CLI doesn't have the second option.
It would be ideal if it could be added.
Meanwhile, an alternative with command line is to use the rm
command with some RegEx to delete specific sizes.
Hi is there a way to set up below commands with WP cli as well or is it set by default? I couldn't find it anywhere.
-Skip regenerating existing correctly sized thumbnails (faster). -Delete thumbnail files for old unregistered sizes in order to free up server space. This may result in broken images in your posts and pages.
Many thanks