Contributor have not grant to upload media files? in WordPress.

Contributor have not grant to upload media files? in WordPress.

The user role  Contributors in wordpress have not the grant for media upload.So if we try to upload an Feature image by Contributor User it shows an error “Http Erro”.

This works well for all users that have the upload_files capability, which includes the Administrator, Editor, and Author roles.

The upload files  grants  full rights to edit and delete any uploaded media. So the contributor have not granted this feature.

WordPress is not quite sophisticated enough provide the required fine-grained permissions control on file and media management operations, which many other CMS.

For this reason, if you try to upload a Featured Image to your post when logged in as a user with the Event Contributor role, they will receive an HTTP Error.


I searched many article over there but when I needed  to build the news site. It is  strictly require the contribution role with adding media file  [Audio, Video, Images ] with restriction of other media file delete.


Finally i get the solution. It save my time and with full requirement. This is the adding capability when the Contribution log in.  Keep this code into function.php page and get the effects. Add the admin initialization hook to the theme function.


Solution : 

* Add the capability of Contributor
* It just gives the adding of media and slecting others added media file
* Prevents the delete of other media file .
if ( current_user_can(‘contributor’) && !current_user_can(‘upload_files’) )
add_action(‘admin_init’, ‘allow_contributor_uploads’);

function allow_contributor_uploads() {
$contributor = get_role(‘contributor’);

/* Give the upload capability role to this user*/


Share this Story:
  • facebook
  • twitter
  • gplus

Leave a comment

Facebook Comment