How Can I Resize WordPress Image Programmatically

I would like to resize the WordPress image programmatically via my custom WordPress plugin

You can use default WordPress function wp_get_image_editor

0 0 vote
Article Rating
Subscribe
Notify of
guest
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Chibuike
2 years ago

Thanks for the code snippet it saved me many hours.

I needed to resize uploaded custom profile images for a membership website we are building and the images are uploaded into a custom folder. This code really helped, I adapted it to our use case: upload the image, resize & save a new copy, them delete the original image to save space.