Nowadays, PDF has become a standard file format for many important documents. Many people have used PDF files to create and share their knowledge and stories with others across different platforms, systems, and devices while maintaining a more consistent layout compared to other document file formats such as Docx and Odt. As the most popular CMS on earth, WordPress allows you to upload and share your PDF files as well. The thing is, it can’t guarantee your PDF files will be safe once published.

Why You have to Protect PDF Files?

There are many reasons why you want to protect your WordPress PDF files. One of the main reasons is for commercial purposes. If you’re running an online business selling ebooks, for example, it’s certain that you want to stop non-members from downloading and sharing your ebook files for free. In many cases, you also want to protect your original content, digital assets, ideas, inventions, intellectual work and such. You definitely don’t want people to exploit and take advantage of your skills and hard-to-produce products. Last but not least, there are some personal and private documents that you just don’t want them to be made public.

Depending on your needs and circumstances, there are many different ways to protect and stop unwanted users from accessing your PDF files. Here are 7 ways you can protect WordPress PDF files. Let’s dive in.

Protect PDF Files Indirectly

One of the most common ways to share your documents with others is to embed their file URLs directly on your content.

Once you’ve uploaded and inserted your PDF files into a WordPress post or page, you can then restrict its access to indirectly protect these files inside the content. Let’s take a look at 3 different ways you can do so.

#1 Password Protect WordPress Page

This is the easiest way of all. You can just set a password to protect your post/page content against unauthorized direct access using a WordPress default feature. You don’t even have to install any extra plugins.

How to password protect your WordPress post/page:

  1. Create a new WordPress page or post under your admin panel as usual
  2. Edit Visibility in the right-hand menu from Public to Password protected
  3. Enter your password and Update the page/post

The drawback is you can set only one password per post/page. So if someone reveals the password, others will be able to access your content and PDF files. A workaround is setting multiple passwords per post/page using this Password Protect WordPress Page plugin.

#2 Automatically Expire & Change Post/Page URL

Another simple method yet offers more security to your WordPress content is to use Protect WordPress Pages & Posts plugin. This plugin basically blocks the original URLs of your page/post against the public and search engines. In return, it enables you to create a new “private” URL for you to access or share the post/page with others. You can create as many as private URL as you want as well as expire these links by clicks and dates.

Better yet, if you’re using this with Private Magic Links extension, you can embed these private pages/posts directly on your content and let it do the magic for you. Your WordPress page/post URL will expire in a preset time, say every 1 minute. Once expired, a new private URL will be automatically created and so on.

Unauthorized users will just see a 404 error page when accessing protected pages as their URLs will expire and keep changing in a very short amount of time. It’s a simple yet quite effective way of stopping people from sharing your WordPress pages and posts content with others. The plugin comes in useful especially when you want to protect public-facing pages such as “contact us” and “thank you” page from abuse.

How to block post/page URL using Protect WordPress Pages & Posts:

  1. Get and install Protect WordPress Pages & Posts plugin under WordPress admin panel
  2. Go to WordPress Pages/Posts
  3. Click “Protect this page” under “Protect Your Pages” column then “Auto-generate new link”

That’s all. Now your page content is blocked against both search engines and the public.

#3 Restrict Private Content Access to Member Only

This is a more advanced and complex method but comes in handy if you have a membership or e-commerce website in place. In this case, you will probably want to create a member only section where only your paid members or customers are allowed to access your private content and documents.

What you need to do is simply install and use a membership plugin. Ultimate Member stands out among all available WordPress membership plugins thanks to its simple logic and UI.  

How to restrict private content access to members using Ultimate Member:

  1. Install and activate Ultimate Member plugin under WordPress admin panel
  2. Create a new WordPress page/post
  3. At the bottom of the page, you’ll find “UM Content Restriction” section.
    Simply choose who can access this content.

Protect PDF Files Directly

Although your WordPress pages or posts are protected, all 3 methods above don’t really protect your uploaded PDF files. In other words, when you attach your PDF files to those protected pages and posts, they’re still accessible to the public. So in case people can somehow find the file URLs through search engines or sharing, they can just download and steal your PDF files.

This scenario happens often when your members who can access and download PDF files from “Member Only” page share them with their friends. These folks would then likely to share them with even more people especially when your content is great. As the result, more and more people will be able to access and download your private PDF documents even though they’re not a member of your website.

In order to resolve this problem, you have to not only protect your content but also block and restrict PDF file URL access directly so that unauthorized users won’t be able to access your PDF files, in any circumstances. Let’s take a look at the following solutions.

4. Protect PDF Files with Passwords

When you want to allow specific users to download PDF documents but still keep them private from the public, simply set a password to protect your PDF files. Simple Download Monitor plugin makes this entire complex process simple.

How to password protect PDF files:

  1. Download and install Simple Download Monitor plugin
  2. Click “Add new” under Downloads under your WordPress dashboard
  3. Enter the file details
  4. Upload the file you want to protect and insert them to page
  5. Edit Visibility in the right-hand menu form Publish to Password protected.
  6. Enter the password and click Publish
  7. Copy the Shortcode and manually insert it into a new or existing Page or Post. Alternatively, you can click SDM Download Button on your content editor to open SDM Downloads Insert Shortcode tab. Simply input “Download Title” and “Insert SDM Shortcode” once done.

Similar to the first method, the major disadvantage is you can only set one password per file.

5. Block Search Indexing and Restrict PDF file URL Access to Logged-in Users

What if your users reveal or share their passwords with others? There must be a better and more comprehensive way to protect your WordPress file uploads in general and PDF files in particular. And there comes Prevent Direct Access Gold. The plugin essentially blocks the PDF file URLs against the public and unwanted users. Those without permission will be redirected to the 404 error page if they try to access your WordPress PDF file uploads.

What’s more? Prevent Direct Access Gold prevents Google and other search engines from indexing your protected PDF files so that your private PDF files won’t be indexed nor appear on search results. This removes the probability that someone could possibly pick up your PDF file URL from a Google search.

How to block and restrict PDF file URL access to certain user roles:

  1. Download and install Prevent Direct Access Gold
  2. Upload the private PDF file that you want to protect into WordPress Media library.
  3. Tick “Protect this file” under Prevent Direct Access Gold tab (right-hand menu).

6. Expire PDF File URLs In Every 5 Seconds

Another way to protect your PDF files is to expire their URLs in a short amount of time say 5 seconds. This helps stop your members from downloading and sharing your PDF files with others. The file URL will likely expire by the time it’s shared.

We highly recommend “Private Magic Links” plugin as it works magically for both WordPress page/post and file URLs. Simply embed your file URL into your content as normal. The plugin will take care of the rest. First, it converts the original file URL into a private one, which is not indexed by Google, then expires the link in a preset time. After a period of time say 5 seconds, the plugin automatically creates a new one to replace the expired link and so on.

#7 Use a PDF Viewer to Embed & Protect PDF Files

Last but not least, you can use a WordPress PDF viewer plugin to embed your documents directly into website content. In other words, your subscribers and paid members have to go to your website to view the PDF files instead of just getting direct download links, which they can copy and then share them with others.

These PDF viewer plugins provide your visitors with a simple but elegant viewer, and at the same time, prevent them from sharing and downloading documents. For example, PDF Embedder, one of the most popular WordPress PDF viewer plugins with more than 100,000 active installs, enables you to embed your PDF files into virtually any WordPress pages or posts. Its premium version adds on a secure option that makes it much more difficult for users to download the original PDF document.

How to embed PDF file directly into content using PDF Embedder plugin:

  1. Download and install PDF Embedder plugin.
  2. Upload the PDF file that you want to protect into WordPress Media library
  3. Select and insert a PDF file into your page/post using “Add Media”. Once selected, a shortcode is generated by PDF Embedder that displays your chosen PDF file content directly on your WordPress page or post.

Wrapping Up

There are many ways to protect WordPress PDF files. You can either block these PDF file URLs directly or restrict access to WordPress post/page that contains these documents. There are 3 common ways to prevent direct access to your content, namely, password protecting, expiring and changing their URLs and restricting their access using a membership plugin. The main drawback of these methods is your attached PDF files are actually not protected. As a result, people could still access and share these private PDF documents.

The other and arguably better solution is to block direct file access to these PDF documents. You can protect your PDF file downloads through password with Download Monitor Plugin. Better yet, use Prevent Direct Access Gold plugin to protect your PDF files more comprehensively. It not only blocks direct access to your private PDF files but also blocks search indexing so that people won’t be able to find your PDF files on Google search results.

To conclude, it’s highly recommended that you use these 2 methods together for better security: restrict access to your content, and at the same time, protect your attached PDF files. You can use Ultimate Members to create a membership website and Prevent Direct Access Gold to protect your PDF files. Alternatively, if you don’t need a membership site, use Protect WordPress Pages & Posts plugin instead.

Elena Taylor

Elena loves writing and blogging. She'll never let a day pass by without writing a new blog post. Unfortunately, no one reads her WordPress blog. So, she ends up devoting herself to making WordPress a better place.

This Post Has 18 Comments

  1. Kristof Loyens

    Thanks Helena very good explanation and a thorough good read. This helped alot.


    I’m really loving the theme/design of your blog.
    Do you ever run into any browser compatibility problems? A number of my blog readers have complained
    about my blog not working correctly in Explorer but looks great
    in Safari. Do you have any suggestions to help fix this

    1. Nicolas Lecocq

      Hello, can you open a support ticket please?
      Send me the blog url where you see a problem on different browser and we will look into this 🙂

  3. Connie

    Another necessary step: Protect the PDFs from being modified or printed or… the PDF programs offer features to protect the files and that should be noticed as well ;=)

  4. Ana

    I’m using the theme oceanwp. I haven’t been able to find out how to modify the presentation of the form that allows you to pass on to a “password protected page”. The theme is very flexible, so I think there must an easy way to do this, could you point me towards the right direction please? By the way, I’m using the “Core Extensions Bundle”. Many thanks

  5. Trevor Jordan

    Thank you for your thorough and most helpful article on protecting PDFS. May I ask a, probably very silly, question? Does any of your methods protect PDFs where the file’s URL is already in the Google search databank so a Google search bypasses my password protected site? Or must I first change their folder location in wp-content/uploads?

  6. Elena Taylor

    Hello Trevor. First of all, thank you so much for your kind words. Really appreciate it 🙂

    To answer your question, yes if you protect your PDFs with Prevent Direct Access Gold, it will block search indexing of these files. Google will remove them from their search results when crawling your website in a few days’ time.

    You don’t have to change its location. In fact, no matter where you try to hide the files, Google and others would still be able to find, index and access them. So the solution is to protect and not to hide.

    Meanwhile, you can quickly remove your indexed files from Google search using Google URL Removal Tool.

  7. Crooz

    Hi Elena, thanks for posting this helpful article. Can you help me resolving following problem?
    There is a contact form on my website. When a user fills the form and click send button, a pdf link is sent along with email message to that user. I want to expire that link for that user only after some days (say 7 days) of that email. And when second user does the same, link should be expired for second user also after same no of days.

    1. Elena

      Hi Crooz,

      I’m sorry for the late reply as I didn’t get any notification on your comment.

      To answer your question, yes it’s possible to achieve exactly what you want. Can you please drop an email to Prevent Direct Access Team – hello(at), with the contact form plugin and email platform you’re using? They will advise you accordingly.

      Hope it helps.

  8. Vellu

    Hey Elena! Thanks for good article it really helps me. In my website user can buy membership that now allows him to download pdf files. Is there anyway to prevent downloading this pdf files but user can print these pdf documents. That prevents users to share those documents to others. Thanks for help.

  9. William Kent

    Thanks very good explanation and a thorough good read.
    This helped alot !!

  10. peter

    i wish more writers would explore the value of CopySafe PDF. i’m implementing them; so few even know about it.

  11. teresesanford

    I do accept as true with all of the ideas you have presented in your post. They are very convincing and can definitely work. Nonetheless, the posts are too quick for newbies. May just you please lengthen them a bit from subsequent time? Thanks for the post.

  12. lawrenceguevara

    Simply want to say your article is as surprising. The clearness for your submit is just great and that i can think you are knowledgeable in this subject. Well along with your permission let me to seize your feed to keep up to date with forthcoming post. Thank you 1,000,000 and please keep up the rewarding work.

  13. elmerzimmermann

    Thanks for this marvellous post, I am glad I found this website on yahoo.

  14. otisswartz735

    I’m writing to let you be aware of of the superb discovery our daughter experienced viewing your web site. She mastered several pieces, not to mention how it is like to have a great giving mood to make the rest really easily know precisely selected tricky subject matter. You undoubtedly exceeded my expectations. Many thanks for coming up with such necessary, trusted, edifying not to mention fun tips about that topic to Tanya.

  15. tabithadick0

    It’s going to be finish of mine day, however before ending I am reading this great article to improve my know-how.

  16. alvarooctoman0

    I’m still learning from you, but I’m improving myself. I definitely enjoy reading all that is posted on your website.Keep the aarticles coming. I enjoyed it!

Leave a Reply