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 postsA post is a type of content in WordPress, a popular open-source content management system used for creating an... More, which is inconvenient to say the least.
Fortunately, it’s pretty easy to customize user rolesIn WordPress, a user role is a set of permissions that determines what actions a user can perform on a website... More in WordPress.
In this tutorial, we’ll cover two ways to enable media uploads for contributors:
- Add a code snippet: If you’re comfortable editing your themeA WordPress theme is a set of files that determine the design and layout of a website. It controls everything ... More files, you can allow your contributors to upload media by pasting a simple function into your
functions.php
file. - Use a WordPress pluginA plugin is a software component that adds specific features and functionality to your WordPress website. Esse... More: 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 dashboardIn WordPress, the Dashboard is a central hub for managing a website's content and settings. It is the first sc... More.
At the top of the pageIn WordPress, a page is a content type that is used to create non-dynamic pages on a website. Pages are typica... More, select the Contributor role from the drop-down menuIn WordPress, a menu is a collection of links that are displayed as a navigation menu on a website. Menus are ... More. 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 commentsComments are a feature of WordPress that allow users to engage in discussions about the content of a website. ... More below!