Protect WordPress PDF Files From Downloads

While Prevent Direct Access Gold prevents your private files from being shared without your permission, Watermark WordPress Files helps you display protected PDF files in content and stops all download attempts at the same time.

Protect self-hosted PDF Files


Self-hosted PDF files refer to all files uploaded to your hosting server instead of external storage such as Amazon S3, Dropbox or Wasabi.

To protect your PDF files against downloads, simply follow our steps below.

Step 1: Embed your PDF files into content using our “Protected PDF” button in Classic Editor or “Protected PDF” block in Gutenberg Editor.

You can also use our shortcode as follows:

[pda_pdf_viewer id=2454 width="500" height="725"]

Step 2: Protect PDF files against direct access by our Prevent Direct Access (PDA) Gold plugin.

Simply tick the “Protect this file” checkbox and define file access permission under your file name before adding it into content.

Alternatively, you can protect files under Media Library first if it’s more convenient for you.

Once you’re done, no one including authorized users, can download your PDF files.

Multiple PDF viewers on the same page are now supported.

Protect PDF Files hosted on Amazon S3 bucket


Follow 3 simple steps below to protect PDF files hosted on Amazon S3 against downloads.

Step 1: Connect our PDA S3 Integration extension with your S3 bucket.

Step 2: Modify expiration time for S3 pre-signed URLs. It’s highly recommended to set a short expiration time, e.g. 5 seconds.

Step 3: Embed your S3 PDF files into content using our shortcode:

[pda_pdf_viewer s3_url="s3-link-of-your-pdf-file"]

Technically, when you protect S3 files by setting it private, they will be accessed directly by no one. To display them in content, our plugin needs permission to connect with your S3 bucket and automatically generate S3 signed URLs, which allows your users to see the file content in a period of time. The new S3 signed URL will be automatically generated and replaced the previous expired one. Therefore, your users can see the whole PDF without any interruption.

What’s more, by setting the expiration time too short, e.g. 5 seconds, you can stop most download tools from downloading your private files.

As of now, you can only use one single PDF viewer per page/post. If you insert more than one, only the first document will display correctly.
Lasted updated on September 19, 2022