wp-cli / media-command

Imports files as attachments, regenerates thumbnails, or lists registered image sizes.
MIT License
44 stars 41 forks source link

A question about using "wp media import" command. #193

Closed 3douhao closed 7 months ago

3douhao commented 7 months ago

When using the "wp media import" command, why are image copies created? For example, if I run the command wp media import a.jpg, a-1.jpg is also generated. And the URL of imported a.jpg is like "https://domain.com/a-1.jpg". While using the built-in media upload button to upload, a-1.jpg is not generated. The URL of a.jpg is also normal. Is three a way to eliminate the generating of image copies? Thank you.

ernilambar commented 7 months ago

a-1.jpg is created when there is already a.jpg. That is default WordPress behaviour. Can you please try again disabling all plugins and also switching themes. It is possible that theme or plugin could be affecting the import hooks.

3douhao commented 7 months ago

a-1.jpg is created when there is already a.jpg. That is default WordPress behaviour. Can you please try again disabling all plugins and also switching themes. It is possible that theme or plugin could be affecting the import hooks.

Thank you very much for your reply. Just like you said, it is because there is already an a.jpg. So the imported image is renamed a-1.jpg.