1. Document Library Pro
  2. FAQ

Restricting access to the document library

There are many ways to restrict access to the document libraries that you have created using Document Library Pro, depending on your requirements. For example:

  • If you only use your WordPress site as a document library, then you may wish to make the entire site private.
  • If you're adding a private document library to your main company website, then you can restrict access to the documents while leaving the rest of the site public.
  • You may wish to create a document library that is part public and part private.
  • Perhaps you need to show different documents to different user groups (e.g. customers, employees, managers, etc.).

This article describes a wide range of options for restricting some or all of the document library.

Create a 100% private document library site

Some people create a completely standalone document library website, which is not used for any other purpose. If this applies to you, then you can make it completely private so that only people with the password can access the website at all.

There are 2 main ways to password protect an entire website:

  1. First, ask your hosting company if they offer .htaccess protection. If you use a managed WordPress host such as Kinsta then this is easy to set up.
  2. If that's not an option, then install the free Password Protected plugin on your WordPress site.

Once you have set up either of these options, people will be asked to enter a password when they try to access your document library website. Give the password to the people who require access.

Tip: Since the site is 100% private, you will probably also want to hide it from search engines. You can do this under Settings → Reading in the WordPress admin. 

Hide document categories behind password protection or user login

Our other plugin - Password Protected Categories - lets you password protect some or all of your documents.

  1. Install the plugin and activate your license key from the order confirmation email.
  2. Go to Documents → Categories.
  3. Edit one of the categories that you want to restrict access.
  4. Change the visibility to one of the following options:
    • Password protected - set one or more passwords which can be used to unlock the category. Once you've done this, create a central login page and add the shortcode [category_login].
    • Private - private categories and their documents are only visible to certain user roles. By default, private content only appears to logged in Administrators and Editors but you can use the free User Role Editor plugin to make it available to other user roles too, e.g. Subscribers.
  5. Repeat steps 3 and 4 for any other categories that you want to restrict. (You don't need to do this for sub-categories where you have already protected the parent category because they will automatically inherit the same protection as the parent category.)

When people visit the document library page, the documents in protected categories will not be visible. They must enter the password or login before they can see or access the documents.

Tip: If you're using private categories and wish to restrict access to the main document library page too, then you should edit this page and set the visibility to 'Private'.

Other membership plugins

In addition to the above, there are many plugins which you can use to restrict access to the document library. Document Library Pro works with most WordPress membership plugins.

For example, we particularly like the Advanced Access Manager plugin which lets you control who can access each part of your WordPress site, e.g. to specific users or roles. Paid Member Subscriptions is also excellent if you want to sell access to the document library.

Can I protect the downloadable files?

In general, no one can access files in the WordPress Media Library unless they have the direct URL. As a result, if you are using one of the above plugins to restrict access to your documents, then no one else will be able to access the downloadable files.

For an extra level of security, you can use the Prevent Direct Access (PDA) Gold plugin. We have provided a tutorial about how to use it with our Password Protected Categories plugin.

Related Articles

Still need help?
If searching the knowledge base hasn't answered your question, please contact support.