How to Restrict Individual File Access to Specific Users & Roles

With our Access Restriction extension, you can restrict access to your entire website and protected files by IP addresses. What’s more, you can now allow certain user roles such as “Members” and “Subscribers” as well as specific users to access each and every protected file.


In this article, we will walk you through the section below:

How to Set Permission for each Protected File

While you can grant access to all your protected files by user roles under Prevent Direct Access Gold settings page, this extension allows you to do so for each and every protected file.

Grant Access to Specific Roles

Step 1: Once you’ve protected your file, click on “” under “Prevent Direct Access” column on Media page.

Step 2: Switch to the “File Access Permission” tab, select “Choose Custom Roles”. Then simply pick the user roles that you want to grant access to your private file.

Another way to give permission to specific user roles is to select under Grid View or while editing content.

Please keep in mind that the “Choose custom roles” option will become “Use default setting” – getting the default setting value, once the plugin is deactivated. They won’t be reverted to the previous values even if the plugin is re-activated.

Grant Access to Specific Users

From version 1.0.5, our extension supports a new feature that allows you to whitelist specific users from access restriction. It displays right below the “user roles” section and under PDA Gold configuration popup only.

  • Use default setting
    • Follow the default option on our settings page
    • Only available from version In the earlier versions, this option means “no users”.
  • No users
  • Choose custom users

Restrict individual file access permission: by username

It’s useful when you want to grant access to not all but specific users belonging to that role.

Only administrators and some custom users can access this protected file

Please note that:

  • You can select users by searching for their specific usernames.
  • In a Network, you can only search available users on that particular site, i.e. listed under its Users page, and not all users on your multisite.
  • Deleted users are not automatically removed from the select option until you select a duplicate username.
  • Unlike User Roles, Users option will disappear when you deactivate the extension. This means selected users won’t be able to access protected files until the extension is re-activated.
  • This function only works with PDA Gold version and above. So always update PDA Gold to the newest version and enjoy this feature.

How to Set Permission for multiple Protected Files

Give permission to specific roles

In case you need to set permission for multiple files simultaneously, you can do it quickly and easily by using “Assign Permission” bulk. Here is how you do it:

Step 1: Select the files which you need to set permission under Media Library List View.

Step 2: Navigate to Bulk Action field and select “Assign Permission”.

Step 3: Select which user roles you want to give permission and click “Apply”.

Please note that this setting just applies to the protected files.

Grant access based on users

At the moment, we haven’t provided a UI option to bulk assign file permission to multiple users. However, you can achieve it with some custom code.

Lasted updated on March 24, 2021