Do you have guest writers on your WordPress site? If so, they’re most likely set to the contributor role. The problem with the default contributor role however, is that it does not allow the contributors to upload images or any other kind of media. This means they would have to write text only articles or contact you first if they must use images. This article discusses two ways you can get around this limitation without needing to promote the contributors to higher privileges.
When most people face the issue with the default contributors role just described, they usually just promote the contributors to the author role. This may not be what you want at all because the author role has a lot of other privileges you may not want your contributors to have. For example, authors can publish posts directly on your site without additional approval from you.
Here are two simple solutions:
Using Code: Modify The functions.php File
Locate the functions.php file of your current theme and add the following lines:
/* * Allows contributors to upload media. */ function add_theme_caps() { $role = get_role( 'contributor' ); $role->add_cap( 'upload_files' ); } add_action( 'admin_init', 'add_theme_caps');
You can extend or tweak that code however you want. For example, you can change the role to something else or the capability to something else as well. This is the code method for tweaking user permissions.
See the official WordPress reference on this for more information.
Using A Plugin: User Role Editor
There are multiple plugins available for editing user roles in WordPress. But I like User Role Editor because of how easy it is to use and the fact that it is quite popular (numbers matter!).
Just download, install and activate the plugin as usual and then proceed to your users screen. You will notice a new option is available below each user – “Capabilities”.
Click on the new “Capabilities” link. You will find a check box where you can give the user the permission to upload files.
The nice thing about this permission is that, while the contributor users are able to view existing images inside the media library (and insert any of those existing images into their own posts), they still cannot delete images uploaded by another user or an admin, for example. They can however upload new images and can delete the images they uploaded.
I’m not sure if contributors granted the upload_files permission can delete the images they uploaded after a post that uses the image has been published. That’s one thing I might need to look into later.
If you have other ways of allowing contributors to upload images in WordPress, please share using the comments section.
Hi good morning sir, I want upload file like GSM flash file but I don’t know how to do it.