How to restrict WordPress media library access to user’s own uploads

By default, WordPress allows authors/users to see all images uploaded to a WordPress site’s media library. This could be a problem if your site has users with individual images/galleries. This WordPress snippet will allow you to restrict WordPress media library access to user’s own uploads.

Instructions
Add this code to your WordPress theme function.php file.

Comments

Leave a Reply

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

Snippet Info

Tested with Wordpress v. 5.0

How to restrict WordPress media library access to user’s own uploads
4 (80%) 11 vote[s]
Please report broken snippets.
Report Broken Snippet
WP Engine