Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip existing and delete unregistred in WP cli ? #111

Closed
Mag8891 opened this issue Jun 11, 2019 · 6 comments · Fixed by #199
Closed

skip existing and delete unregistred in WP cli ? #111

Mag8891 opened this issue Jun 11, 2019 · 6 comments · Fixed by #199

Comments

@Mag8891
Copy link

Mag8891 commented Jun 11, 2019

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

@Beee4life
Copy link

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.

@kkmuffme
Copy link

@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.

@Beee4life
Copy link

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)

@kkmuffme
Copy link

I'm not the OP, just having the 2nd issue too. But I guess I'll create a new card for my specific one

@Beee4life
Copy link

sorry my bad, overlooked it.

@dademaru
Copy link

dademaru commented Sep 9, 2021

-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.

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

Successfully merging a pull request may close this issue.

5 participants