How to Allow Contributor to Upload Images in WordPress?

Lately, I started accepting guest posts on Geekflare, and one of the first issues I countered about a registered user with a contributor role can’t upload images.

Are you in the same situation as I was?

Here is how I fixed it, and you can do it too.

Using Code

If you are comfortable editing the PHP file, then this is recommended.

Note: as a best practice, take a backup of the file before modifying it.

//Let Contributor Role 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'); }

If you don’t want to touch the file, then you can use the plugin method.

Using a WP plugin

The user role editor plugin will be handy to update the permission for the contributor role.

That should help contributors to add images to WordPress. I hope this helps.