Lately, I started accepting guest posts on Geekflare, and one of the first issues I countered about a registered user with a contributor role can’t upload images.

Are you in the same situation as I was?

Here is how I fixed it, and you can do it too.

Using Code

If you are comfortable editing the PHP file, then this is recommended.

  • Login to your WordPress server or if on shared hosting then go to cPanel >> File Manager
  • Traverse to the theme folder and add the following in functions.php file

Note: as a best practice, take a backup of the file before modifying it.

//Let Contributor Role to Upload Media
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');
    $contributor->add_cap('upload_files');
}
  • Save the file and test by logging as a contributor role. You should see the “Add media” button or ability to upload the images.

If you don’t want to touch the file, then you can use the plugin method.

Using a WP plugin

The user role editor plugin will be handy to update the permission for the contributor role.

  • Go to WordPress admin and install >> activate the plugin

  • Navigate to Users >> User role editor
  • Select role as a contributor
  • Select “upload_files” from list of the capabilities and click update

That should help contributors to add images to WordPress. I hope this helps.