English English French French Spanish Spanish German German
Geekflare is supported by our audience. We may earn affiliate commissions from buying links on this site.
Share on:

How to Allow Contributor to Upload Images in WordPress?

wp add media
Invicti Web Application Security Scanner – the only solution that delivers automatic verification of vulnerabilities with Proof-Based Scanning™.

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.

contributor-upload-media

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

user-role-editor

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

upload-files-capabilities

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

Thanks to our Sponsors
More great readings on WordPress
Power Your Business
Some of the tools and services to help your business grow.
  • Invicti uses the Proof-Based Scanning™ to automatically verify the identified vulnerabilities and generate actionable results within just hours.
    Try Invicti
  • Web scraping, residential proxy, proxy manager, web unlocker, search engine crawler, and all you need to collect web data.
    Try Brightdata
  • Semrush is an all-in-one digital marketing solution with more than 50 tools in SEO, social media, and content marketing.
    Try Semrush
  • Intruder is an online vulnerability scanner that finds cyber security weaknesses in your infrastructure, to avoid costly data breaches.
    Try Intruder