How to Allow WordPress Users to Delete Images and Files

How to Allow WordPress Users to Delete Images and Files

By default, WordPress is very, very careful about who can delete files in your site’s Media Library.

Only users in the “Administrator” role are able to delete images and files in your Media Library. Anyone who is in the Subscriber, Contributor, Author and Editor roles is not allowed to delete images.

However, on some sites you may want to allow other users to clean your Media Library. Perhaps you have private files, or just have a cluttered Media Library with too many files.

The solution to deleting files is to install the PublishPress Capabilities plugin.


Once both those plugins are installed, go to “Capabilties” in your WordPress admin area.

In the right sidebar, check the “Media” box under “Force Type-Specific Capabilities”. This will allow you control the permissions for the Media Library,

force type to allow people to delete WordPress images and files

In the top-right corner of the screen, load the user role that you want to customize permissions for. In this image below, I’ve chosen the “Editor” role (click here to read about Editors capabilities).

select role

In the center of the screen, you can now set your permissions. If you want to allow people in this role to delete anything in your Media Library, check all the boxes in the “Media” row.

delete WordPress images and files

Click “Save Changes” at the bottom of the screen.

It’s as simple as that. Now whenever a user in the “Editor” role goes to the Media Library, they’ll see a “Delete permanently” option for any file they see:

to delete WordPress images and files permanently

To make this work, check out the the PublishPress Capabilities plugin. At that site, you’ll find more on this topic, including this post: “Which WordPress Users Can Delete Files From the Media Library?

Instructor

  • Steve is the founder of OSTraining. Originally from the UK, he now lives in Sarasota in the USA. Steve's work straddles the line between teaching and web development.

0 0 votes
Blog Rating
Subscribe
Notify of
3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
HM

Steve, I am not sure about some of the information in this article. I am a WordPress admin and I recently added a new user with Editor role to add a few new pages. When I requested her to clean up the large number of images she added (most of which were not being used), she accidentally deleted most of the images from the Media Library. Suffice it to say, it took us some time and effort to get back to status quo. We don’t have any user plugins installed so we are using default WordPress functionality and it allowed this editor to delete the entire Media library!

JB

Any option to do this without a plugin?
Like other capabilities set in defining a role.
‘delete_posts’ => true,

3
0
Would love your thoughts, please comment.x
()
x