Categories: Tutorials

How To Allow Contributors To Upload Images In WordPress

If you have a multi-author WordPress site, you’ve probably noticed that users with the “contributor” role are unable to upload media.

That means your contributors can’t add images or videos to their own blog posts, which is inconvenient to say the least.

Fortunately, it’s pretty easy to customize user roles in WordPress.

In this tutorial, we’ll cover two ways to enable media uploads for contributors:

  1. Add a code snippet: If you’re comfortable editing your theme files, you can allow your contributors to upload media by pasting a simple function into your functions.php file.
  2. Use a WordPress plugin: If you’d rather not edit your site files, you can get the job done with a WordPress plugin.

How To Allow Contributors To Upload Images Without A Plugin

This method is great for people who feel comfortable editing their theme files, and who would prefer not to install yet another WordPress plugin.

Open up your current theme’s functions.php file, and add the following snippet:

//Allow Contributors 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');
}

Note: I recommend using a child theme to avoid having your changes overwritten by a future theme update.

How To Allow Contributors To Upload Images With A Plugin

If you’d prefer to use a plugin, User Role Editor is for you.

Install and activate the plugin, then go to Users > User Role Editor in your WordPress dashboard.

At the top of the page, select the Contributor role from the drop-down menu. Then check the box next to upload_files.

Click the Update button, and then your contributors will be able to upload media to your site.

As you can see, User Role Editor has lots of other options to help you manage your site’s user roles. You can learn more about WordPress user roles here.

If you have any questions, please feel free to leave them in the comments below!

Brad Merrill

Brad Merrill is the CEO of Merrill Media and Editor in Chief of GigaPress.

View Comments

  • Maybe it's better like this:
    //Allow Contributors to Upload Media
    add_action('admin_init', 'allow_contributor_uploads');
    function allow_contributor_uploads() {
    if ( current_user_can('contributor') && !current_user_can('upload_files') ){
    $contributor = get_role('contributor');
    $contributor->add_cap('upload_files');
    }
    }

    So it won't load the "wp_get_current_user" before the actual function it's loaded :)

  • thank you work

  • Thanks, the code worked for me.

  • Thanks for the tutorial, I was searching for this manual method.
    I used a child theme as you've suggested.

Recent Posts

Is Wix a WordPress Site? Understanding the Difference

If you’re exploring website builders, you may wonder, “Is Wix a WordPress site?” or even,…

16 hours ago

How to Get to WordPress Dashboard:Quick Access Guide

Are you missing out on the full power of your WordPress site because you’re not…

3 days ago

How to Add Facebook Pixel to WordPress Site: (Easiest Way)

Are you looking to track visitors on your WordPress website, optimize ad performance, and increase…

1 week ago

Is WordPress Easy to Use for Beginners? A Comprehensive Guide

If you’re wondering, “Is WordPress easy to use?” you’re not alone. Many beginners want a…

2 weeks ago

How to Add Shortcode in WordPress: A Beginner-Friendly Tutorial

Shortcodes are an essential part of WordPress. Allowing users to quickly add dynamic content to…

2 weeks ago

How to Embed Facebook Video in WordPress: A Comprehensive Walkthrough

Learning how to embed Facebook video in WordPress can take your site’s content to the…

3 weeks ago