Prevent Direct Access Lite Version

Prevent Direct Access plugin provides a simple solution to prevent Google and other search engines from indexing and unwanted users from accessing your files without permission.

Protect WordPress Media Library File Uploads

Prevent Direct Access (PDA) is designed to protect your media files such as images (PNG, JPEG), documents (PDF, DOCX, PPTX), audios, and videos (MP4, MP3) that you upload to your website, via either Media library or Pages/ Posts.

Once protected, only the files’ author can access them directly. Unauthorized users will be redirected to a No Access page when attempting to view and download these files.

Currently, the Lite version allows you to protect up to 9 uploaded files only. Check out our Gold version which offers unlimited protected files and many other advanced features.

Installation

  1. Under your WordPress admin dashboard, click Add New under Plugins
  2. Search “Prevent Direct Access” in the repository
  3. Click Install Now

NGINX Support

Since version 2.7.3, Prevent Direct Access supports both Nginx and Apache servers.

While our rewrite rules are inserted automatically for Apache servers, you have to implement these rules manually for Nginx servers.

Follow the steps below to make our file protection to work properly in your Nginx site.

  1. Copy the rewrite rules shown on Prevent Direct Access settings page
  2. Find your website’s Nginx config file which is often located at /etc/nginx/site-available or /etc/nginx/conf/site-available (if you’re using Arch Linux)
  3. Paste the copied rules in the server block
server {
	location / {
		...
	}
	#Put our rewrite rules here, i.e.
	rewrite wp-content/uploads/_pda(\/[[email protected]\/&+-]+)+\.([[email protected]\/&+-]+)$ "/index.php?pda_v3_pf=$1&is_direct_access=true&file_type=$2" last;
	rewrite private/([a-zA-Z0-9-_.]+)$ "/index.php?pda_v3_pf=$1" last;
}

Restart your Nginx server. Our Prevent Direct Access should be now working on your website.

Plugin Walkthrough

Here’s how to activate and use our Prevent Direct Access (PDA) Free version.

  1. Once you’ve installed our plugin, click Activate

  2. Go to Media to protect your files

You can choose to protect files either in List View or Grid View.

Media Library Gird View

  1. Click on a file that you want to protect, and then tick Protect this file checkbox
  2. After being protected, the file will be highlighted with a red border
  3. Simply untick Protect this file checkbox if you want to unprotect the file.

Please note that if you get stuck with “Protecting…” status, it might be because the file that you want to protect does not exist or you have reached the maximum number of protected files in Lite version (9 files).

You can switch to Media List View to see the error message.

Media Library List View

  1. Choose List View option under Media Library

  2. A new column named Prevent Direct Access will be created by our plugin. To protect a specific media file, simply click on Configure file protection and click on Protect this file

  3. Once a file is protected, the plugin will automatically generate a private URL containing random strings for users to access the private file directly. You can copy the private URL to clipboard and paste it on their browsers or email by clicking on the Copy to clipboard button.
  4. If you want to unprotect the file, simply click on Unprotect this file

  5. As the Lite version offers protection for a maximum of 9 files only, an error message will display when you try to protect more than 9 files.

You can refer to our FAQ for more information.

Lite version Limitations

  • The default File Access Permission (FAP) of all protected files is set to its author
    • Even admin users who are not the file’s author cannot access the file directly
  • You cannot auto-generate or customize new Private Download Link with our PDA Lite
    • You can’t set or edit its Download Limit and Expiry either. As a result, anyone can access the Private Download Links without any restriction.

Refer to the complete features comparison between our PDA Gold vs Lite version.

Lasted updated on February 24, 2021