• Skip to main content
  • Skip to primary sidebar

Technical Notes Of
Ehi Kioya

Technical Notes Of Ehi Kioya

  • Blog
  • Shop
  • Forums
  • Subscribe
  • About
  • Contact
MENUMENU
  • Blog Home
  • AWS, Azure, Cloud
  • Backend (Server-Side)
  • Frontend (Client-Side)
  • SharePoint
  • Tools & Resources
    • CM/IN Ruler
    • URL Decoder
    • Text Hasher
  • Linux & Servers
  • Zero Code Tech
  • WordPress
  • Musings
  • More
    Categories
    • Cloud
    • Server-Side
    • Front-End
    • SharePoint
    • Tools
    • Linux
    • Zero Code
    • WordPress
    • Musings
Home » WordPress » Two Ways To Allow Contributors To Upload Images In WordPress

Two Ways To Allow Contributors To Upload Images In WordPress

By Ehi Kioya 1 Comment

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”.

User Role Editor Upload Images WordPress

Click on the new “Capabilities” link. You will find a check box where you can give the user the permission to upload files.

User Role Editor Upload_Files WordPress

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.

Found this article valuable? Want to show your appreciation? Here are some options:

  1. Spread the word! Use these buttons to share this link on your favorite social media sites.
  2. Help me share this on . . .

    • Facebook
    • Twitter
    • LinkedIn
    • Reddit
    • Tumblr
    • Pinterest
    • Pocket
    • Telegram
    • WhatsApp
    • Skype
  3. Sign up to join my audience and receive email notifications when I publish new content.
  4. Contribute by adding a comment using the comments section below.
  5. Follow me on Twitter, LinkedIn, and Facebook.

Other Articles You May Like:

Filed Under: WordPress Tagged With: Permissions, WordPress

About Ehi Kioya

I am a Toronto-based Solutions Architect and Lead Software Developer of an outsourced team.

I run this technology blog, as well as this consumer products shop.

You can read more about me here, and connect with me via Twitter, LinkedIn, and Facebook.

If you want to collaborate or talk to me privately, send me an email using this form. But please note that I don't answer questions or provide support via email.

To share your thoughts or get help with any of my posts, drop a comment at the appropriate link.

Reader Interactions

Comments

  1. Ibrahim Bello says

    October 25, 2019 at 6:15 am

    Hi good morning sir, I want upload file like GSM flash file but I don’t know how to do it.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

426,009
Followers
Follow
30,000
Connections
Connect
15,217
Page Fans
Like

FROM   THE   SHOP

  • Rainbow Backlit Gaming Keyboard

    13% off! Rainbow Backlit Gaming Keyboard
    Rate this product:

    The Rainbow Backlit Gaming Keyboard gives your gaming rig a colorful makeover and lets you play even in the dark. Combined with a wired gaming mouse, it features 7 circular and colorful breathing effects as well as 19 anti-ghosting keys.

    $27.99 (as of Dec 5, 2019 - 4:39 pm) Check it out
  • Recently   Popular   Posts   &   Pages
  • Allowing Multiple RDP Sessions In Windows 10 Using The RDP Wrapper Library Allowing Multiple RDP Sessions In Windows 10 Using The RDP Wrapper Library
    This article explains how to bypass the single user remote desktop connection restriction on Windows 10 by using the RDP wrapper library.
  • Actual Size Online Ruler Actual Size Online Ruler
    I created this page to measure your screen resolution and produce an online ruler of actual size. It's powered with JavaScript and HTML5.
  • Get XML Document Nodes Recursively with C# Get XML Document Nodes Recursively with C#
    Here are two methods to get XML document nodes, child nodes and so on. The first method uses DOM. The second method uses LINQ to XML.
  • WordPress Password Hash Generator WordPress Password Hash Generator
    With this WordPress Password Hash Generator, you can convert a password to its hash, and then set a new password directly in the database.
  • How To Shrink Amazon EBS Volumes (Root Or Non-Root) How To Shrink Amazon EBS Volumes (Root Or Non-Root)
    In this article, I describe a technique to shrink Amazon EBS volumes. This is very useful if you ever mistakenly over-allocate your EBS.

FROM   BLOG   READERS…

  • Geoffrey Mureithi on 5 Old Web Development Trends That You Should Remove from Your SiteFlash is still a little bit relevant esp in playing videos, but then I would not sit in an actionscript class
  • Jesse Alama on Sorting Date And Time In XSLNice! It is indeed frustrating at times to work just with XSLT 1.0. Even if one has XSLT 2.0 or 3.0 available, one might have to use this kind of solu…
  • Philippe on Create or Change a Favicon in WordPressRealFaviconGenerator and its WordPress plugin (http://wordpress.org/plugins/favicon-by-realfavicongenerator/) do just that on auto-pilot. And more: it…
  • nynymike on How OAuth Can Make Your Web App Safer and More UsefulIf your goal is authentication, use the OpenID Connect profile of OAuth2 http://openid.net/connect If you make up your own profile, you'll probably sc…
  • Henry Mencken on The 4 Parts of Effective ContentYou write about very interesting things. You need an editor, or at least, a proofreader. Otherwise, keep up the good work. Best regards, Henry
  • Santi on Backup Website/Folders With Dropbox On Ubuntu ServerNote you have the definitions switched on top: "If it says x86_64 then download the 32-bit version..." Feel free to correct and delete my comment.
  • Hafiz Aziz on Setting Up A SharePoint Development MachineThanks Ehi for the post. This was immensely helpful.
  • Blog
  • Shop
  • Forums
  • Subscribe
  • About
  • Contact

© 2019   ·   Ehi Kioya   ·   All Rights Reserved
Privacy Policy