Create Beautiful Responsive Photo & Video Galleries For Your Site in Minutes

Envira Gallery Blog

Digital Photography Tips, Tutorials and Resources

How to Automatically Delete Images When a Gallery is Deleted in WordPress

How to Automatically Delete Images When a Gallery is Deleted in WordPress

Written By: author avatar Waseem Abbas
author avatar Waseem Abbas
    

Do you want to fully remove images from WordPress whenever a gallery is deleted? To save time, you may want to completely delete a photo gallery with all the images in one fell swoop. In this article, we will share how to automatically delete images when a gallery is deleted in WordPress.

By default, WordPress stores all the graphic content in its media library. (You can go to Media » Library to see all your images and other media.) If you delete a default WordPress gallery, it won’t delete the images from your media library.

Since many of you requested for the option to completely delete images when a gallery is deleted, we added this feature to Envira Gallery.

Here’s what you need to do to automatically delete images when a gallery is deleted in WordPress:

  • Step 1. Install the Envira Gallery plugin
  • Step 2. Change the settings to delete images on gallery deletion
  • Step 3. Delete your image gallery and all its images!

Ready to get started? Let’s go!

Step 1: Install Envira Gallery

First thing you need to do is install and activate Envira Gallery plugin.

You can do this by going to Plugins » Add New and search for ‘Envira’. It will show you the option to install the Enivra Gallery plugin.

Install Envira Gallery Lite

In the next step, go ahead and activate the plugin to start creating beautiful image galleries.

Activate Envira Lite Plugin

Upon activation you can go to Envira Gallery » Add New and create a new image gallery.

For more details on what you can do with your Envira Gallery image galleries, check out our guide on how to create an image gallery with thumbnails in WordPress. For now, though, we’ll focus on how to delete an image gallery with all of the images attached to it.

Step 2: Change the Settings to Delete Images on Gallery Deletion

Now you can go to Envira Gallery » Settings and scroll down to look for the option to delete images on gallery deletion.

Simply change the settings to ‘Yes’ at the Delete Image on Gallery Deletion dropdown (By default, it is No).

Delete Images When a Gallery is Deleted

Go ahead and save your settings.

Step 3: Delete Your Image Gallery and All Its Images

Now, anytime you delete a gallery, all of its images will be removed from your media library.

However, if the similar images that are used in this gallery are also used in the other image galleries, then those images will not be deleted from the media library.

We hope this article has helped you to learn how to delete images when a gallery is deleted in WordPress. You may also want to check out our guide on how to allow users to download gallery images in WordPress.

If you like this article, then please follow us on Facebook and Twitter for more free WordPress tutorials.

author avatar
Waseem Abbas

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how Envira Gallery is funded, why it matters, and how you can support us.

author avatar
Waseem Abbas

The Best Drag and Drop WordPress Gallery Plugin

Envira Gallery: Create, Showcase, and Sell Your Work – Trusted by 150k+ Sites.

Enter the URL of your WordPress website to install

Please enable JavaScript in your browser to complete this form.

Upgrade to Envira Gallery Pro

Unlock even more powerful features designed to make your galleries even more beaituful.

Video Galleries

eCommerce

Social media Sharing

Adobe Lightroom

And much more!

Popular on Envira Gallery Right Now!

How to Create a Beautiful Masonry Image Gallery in WordPress

How to Create a Beautiful Masonry Image Gallery in WordPress

Facebook14TweetLinkedInPin1 Are you looking to showcase your photography or image…
Polished and Protected: How to Watermark WordPress Images

Polished and Protected: How to Watermark WordPress Images

Facebook20TweetLinkedInPin Are you wondering how to add a watermark to…

Add A Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.


Copyright © [#this year :%Y] Envira Gallery, LLC. Envira Gallery is a trademark of Envira Gallery, LLC.