9 March 2022
Do you want to allow contributors to upload images on your WordPress site?
If you want to welcome guest post submissions and product reviews, you must allow users to contribute images. However, you might not want to grant them access to your WordPress admin area.
In this post, we’ll show you how to securely allow contributors to upload images to a WordPress site without giving them admin access.
In case you’re unfamiliar with WordPress user roles, there are five of them:
An administrator can modify any post and add and delete themes/plugins and other users, including other administrators.
Site owners should preferably have an admin role because they have complete control over the blog.
As the term suggests, an editor gets full access to all of your site’s content. It can create, edit, and delete any post or page, but they don’t have access to the site’s theme, plugins, or other settings.
An author has complete control over the articles they have written. It can create, edit, and delete their posts.
However, they cannot manage comments on other authors’ posts or perform site-related tasks such as modifying site settings, editing themes, or installing plugins.
A contributor has a lot of limitations. It can only create a post; they can’t publish it or even attach media files to it.
They don’t have access to any of the site’s settings, themes, plugins, or other information.
Subscribers are users who do not have any actual power. They are unable to create, edit, or change any posts. Except for their profiles, they have no access to the admin section.
They can only view the articles they provided and change their passwords and profiles.
There are two ways to achieve this:
This method is ideal for those familiar with theme files who don’t want to install yet another WordPress plugin.
Add the following code snippet to your active theme’s functions.php file: //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');
}
There are various plugins available for editing user roles in WordPress. But I like User Role Editor because of how easy it is to use and quite popular.
Follow the steps below to allow users with the Contributor role to upload images to their blog posts.
All of the above methods will result in contributors having the Add Media option on their WordPress dashboard and uploading images, videos, and other media types to their articles.
Using the above option only allows contributors to upload image files to the WordPress dashboard. They don’t have access to any additional features only available to Authors and Admins.
We hope you found this tutorial to be helpful.
For more, check out these other helpful resources:
Lastly, follow us on Facebook and Twitter to stay updated on the latest WordPress and blogging-related articles.