WordPress Users Can’t Edit the Details for Media Files

A PublishPress user wrote to us with question:

I have just installed your PublishPress Capabilities plugin, which is working almost perfectly. The problem that I'm having is that my user can upload images but can not edit the Alternative Text, Title, Description and Caption of the image, which I need the user to be able to do. How can I fix this problem?

This is not the first time we have had this question, so I'll explain the problem and solution.


The problem with editing media files

This situation often arises when you do these two things for a user role:

  • Remove access to Posts and Pages.
  • Give access to another plugin.

This image below is taken from the main PublishPress Capabilities screen. I have removed access to both Posts and Pages, but given this user access to WooCommerce Products, Orders and Coupons.

Post Editing Capabilities
Post Editing Capabilities

In this situation, this user will not be able to edit any of these fields for a media file:

  • Alternative Text
  • Title
  • Caption
  • Description
Cant Edit Media File
Cant Edit Media File

Why does this problem happen?

Normally, to edit the details for this media files, you need the edit_posts permission.

Even if you do have the edit_posts permission, you will only be able edit files that you have uploaded. You will also need the edit_others_posts permission to change the details for other users' files.

Those two permissions are shown in this next image:

Edit Posts WordPress
Edit Posts WordPress

Note: if you want to control who can upload media, use the upload_files permission.


The solution to editing media files

In most situations, the best solution is not to give users the edit_posts permission. This is because you have already decided that users should not be editing posts.

Here is a better solution:

  • Go “Capabilities” in your WordPress admin menu.
  • In the top-left corner, choose the user role you want to change.
  • Check the “Media” box under “Type-Specific Capabilities“.
  • Click “Update”.
Unique post type capabilities
Type Specific
Media capabilities in WordPress
Edit Media Capabilities

Author

  • Steve Burge

    Steve is the founder of PublishPress. He's been working with open source software for over 20 years. Originally from the UK, he now lives in Sarasota in the USA. This profile is generated by the PublishPress Authors plugin.

Leave a Reply

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