Is your website is slow because of the large size images that you uploaded in your WordPress website and wanted to resize every large image on upload automatically? Then you came to the right place.
Here we have posted the simple code snippets that will help you to reduce the large image size before upload. You just have to follow the below guide and soon your website will run fast with just by using few lines of code.
Yes you heard right, With only code we are going to complete the WordPress images resizing process and we won’t use any plugin for it.
Let’s do it.
WordPress Resize images before Upload
With this image resize function the image will be resize according to the large size in your media settings.
Below we have embedded the codes that you need to put in your WordPress theme. For that: copy the below code and paste it into your WordPress theme’s functions.php file.
After that, save the file.
Code to Resize image on upload
Now your WordPress automatically resize the image whenever you upload.
If you have any questions or opinion about this post, please let us know in a comment box. If this code helped you, please share it on social media website.