DesGTS
DesGTS

Reputation: 3

WordPress how to automatically resize uploading all images and delete original of image on server?

I want to all images that will be stored on server to be maximum 900px width.

Example: User uploads image with 3500px by 3500px, i need it auto resize for 900px and then delete original 3500px image from server. Thanks

Upvotes: 0

Views: 762

Answers (1)

Olivier
Olivier

Reputation: 122

To generate different sizes of images, you can add custom thumbnails that will be created when an image is uploaded. You can achieve this with a couple of lines of code in functions.php:

https://developer.wordpress.org/reference/functions/add_theme_support/

I'm not sure deleting the original is possible, as it's linked with the different thumbnails that are generated. A couple of tweaks in your template do however ensure the original isn't used.

Upvotes: 1

Related Questions