How to optimize images that are not in Media Library

A usual WordPress installation has all media files stored in Media Library, and that’s where our image optimization plugin looks firstBut there is not such thing as usual WordPress installation, and we all know some cases when images are stored in other places than Media Library. In this short article, we will show you how to compress those images too, using ShortPixel image optimization plugin.

We took some beautiful images from Unsplash and put them in a custom folder called extra. These images are not visible in Media Library, they are not automatically optimized on upload, and they are not accessible to our Bulk processor.

Fortunately,  you could tell ShortPixel to look for images in other folders than Media Library. For this, you need to go to Settings / ShortPixel, and click on Advanced tab.

Additional media folders

Additional media folders field will do the trick. Click Select button and choose your folder with images. In our example,  it is the extra folder. 

Navigate to your folder

Select custom folder

Optimize images that aren't in Media Library

The magic is happening,  and your files are being compressed by ShortPixel.

Under the Media section from your WordPress dashboard you will notice a new menu item called Other Media. Click on it and see which images not included in Media Library were optimized by ShortPixel.

Please note that you need to go to Other Media page after you upload new images in your custom folders and click Refresh folders button.

Other Media section - Images outside Media Library

You could use the same approach for optimizing images in themes or plugins, or images from folders created by image gallery plugins or you could simply use WordPress as image optimization platform.


Compress files and generate WebP images

Please note that you can also choose to have WebP version of the files generated by ShortPixel when optimizing these images in your extra folders.

The option is in ShortPixel Settings – Advanced section:

WebP conversion

If you don’t know what WebP files are and why they are good for your site, here are a few references:
– Google:  A new image format for the Web
– WikiPedia: WebP
– ShortPixel blog: How WebP images can speed up your (WordPress) site

You could find a lot of quality documentations about WebP format, but these links are a good start.

Install ShortPixel and optimize images outside WP Media Library

Now that you know how to compress images which are not stored in your WordPress Media Library, and speed up your site even more, go ahead and install ShortPixel! 🙂

Articles: 42


  1. Hey, is there a way to compress only new images in a folder outside the media library?
    I have a folder with 40k images, new ones are added every week. But only the new ones should be compressed.

    • Hello!

      There are 3 ways in which you can accomplish that:

      1. You can use the exclude function. If you can find a pattern that is shared between all those images that shouldn’t be compressed, then you can exclude those.

      2. You can add the folder which is outside Media Library to optimization, optimize it, leave the automatic optimization ON, and then restore only those images that shouldn’t be optimized. Caveat: if you run the bulk optimization again, those images will be re-optimized.

      3. Optimize the images manually, do not use automatic optimization.

      There is no straightforward way to compress only the new images in a folder outside media library, but I hope you’ll find these options helpful. For further information, please send us a message at

      Best regards

      • Okay, thanks. Unfortunately, none of the options fits my use case. It would be perfect to have the date as a parameter in the exclusions. Maybe that’s an idea for the future.

        • You’re welcome! We are sorry to hear that our possible solutions didn’t help. We’ll send your suggestion to the development team.

          Best regards,

  2. Hi, on our site, we use the WPZoom Inspiro Theme. ShortPixel is working on all images on our site in serving Webp, EXCEPT for the Hero Image in the theme. How can I make ShortPixel serve the Hero Image as Webp? The hero image is easily the largest image on our Home page. Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *