How to create a WordPress document library

September 9, 2020 38 comments

WordPress document library plugin

A WordPress document library plugin presents your documents in an easy-to-find format. It makes document library management easy so that you can keep things organized, share resources, create a resource hub or a publications database.

It’s surprisingly hard to find a good WordPress document library plugin. There are lots of WordPress file management and media library plugins for admin, but very few can create a front-end document library for users. The ones that do exist have poor ratings and a lot of negative feedback.

This is where Posts Table Pro comes in. In this tutorial, I’ll explain 2 methods for how to use Posts Table Pro for document management and your WordPress media library. Both methods offer a fantastic way to create a WordPress document library. Posts Table Pro, is, without a doubt, the best WordPress document library plugin.

WordPress document library plugin

Later, I’ll also share some tips on how to make your WordPress document library (or just parts of it) private and hidden from public view; how to allow your users to submit documents; and more.

WordPress document management: Step-by-step tutorial

First, watch me creating a WordPress document library using the first method described in this tutorial. Alternatively, keep reading for full written instructions:

Posts Table Pro – the perfect WordPress document library plugin

The Posts Table Pro WordPress plugin instantly creates interactive WordPress tables listing documents or items from your WP media library on one page. You can use it to list documents, PDFs, publications or any other type of document in a searchable, sortable table with filters. This makes it easy for people to find the documents they’re looking for and either read them online, or download a file.

Posts Table Pro
Create your WordPress document library today!

You can use Posts Table Pro to list any type of document on a WordPress website. This includes:

  • Any document file type PDF, DOC, XLS, PPT, EPUB, Google Docs & Sheets, video, etc.
  • Corporate documents Contact lists, data sets, documentation, financial spreadsheets, forms, how-to guides, handbooks, instructions, legal documents, license agreements, lists, manuals, policies and procedures, reports, stationery, templates, terms and conditions, white papers, worksheets.
  • Promotional documents Case studies, flyers, leaflets, marketing materials, Keynote or PowerPoint presentations.
  • Industry-specific documents Blueprints, manuscripts and sheet music, maps, signage.
  • Personal documents Downloadable kids activities, leisure guides, nutrition guides, recipes, treasure hunts.
  • WordPress document gallery You can display photos and videos in a WordPress video gallery using Posts Table Pro, but you can also display your documents in a document gallery layout!

Before we start, check out this review from a happy customer. Then we’ll go through the steps of setting up a document library using a choice of 2 methods. Finally, we’ll check out an example of Posts Table Pro in use for a WordPress publications library.

Really Useful WP Plugin, simple to configure & use
By Andrew Fawcett
After using SharePoint as a document repository for many years this super little plugin provided all the features we needed for our resource library. Straightforward to configure with well written documentation and help. Looking forward to exploring the more advanced features.

2 easy methods to create a WordPress document library

WordPress Document Library Plugin

Like what you see? Great! Next I’ll show you how to create a WordPress document library for your publications.

There are 2 ways to use Posts Table Pro to build a document library in WP. Choose the one that best suits the way you wish to store your documents:

  • Method 1 – Create a custom post type for your documents With this method, you’ll create a special ‘Documents’ area in the left hand side of the WordPress admin, and use this to store information about your documents as well as download links. The downloadable documents are stored in the media library, but you’ll have a dedicated area of the WordPress admin to manage each document. This makes your documents easy to manage because they’re not mixed up with other types of file in the media library (e.g. the images from your web pages and blog posts).
  • Method 2 – Display media library files directly in the document library With this method, you’ll display documents stored in the WordPress media library directly in the document library. Unlike method 2, you won’t have to create a separate ‘post’ to store information about each document.

With both methods, you can choose what information to display in the document library (summaries, file type, file size, category, etc.), and you can add links to download the document. Both methods support any file type, including PDF, JPG, DOCx, etc.

Choose Method 1 if you’d like a dedicated ‘Documents’ area in the WordPress admin where you can manage your documents. Choose Method 2 if your documents are already in the WordPress media library and you don’t want to have to create a separate post for each document.

Now you know which method to use to create your WordPress document library. Next, I’ll tell you how to set them both up.

Method 1 – Create a document library with a dedicated ‘Documents’ post type

To recap, Method 1 works like this:

  1. Storing documents on your website You’ll create a custom post type which will add a ‘Documents’ area to the WordPress admin. (You can call this whatever you like, e.g. ‘Resources’, ‘Publications’, etc.) – Jump to instructions.
  2. Adding documents to your library Next, you’ll create a ‘post’ for each document (either manually or using a WordPress import plugin). You’ll use this to store the document title and any additional information that you wish to display. If you’re adding downloadable documents, then you’ll upload the files to the WordPress media library and link to them from the post for each document. – Jump to instructions.
  3. Creating a document library Finally, you’ll use the Posts Table Pro plugin to list your documents in a beautiful WordPress document library on the front end of your website. – Jump to instructions.

Step 1. Decide how to store your documents in the library

Posts Table Pro doesn’t store your documents for you – you have WordPress for that. Posts Table Pro’s job is to create a library of documents added to your WordPress website.

I’m going to cover everything you need to know about:

  1. Creating a custom post type to store your documents
  2. Adding extra document data
  3. Storing documents as website content
  4. Storing downloadable documents

Remember, if you just want to display media library files directly in the document library, then you can switch to Method 2 instead. 

Posts, custom posts or pages?

The Posts Table Pro plugin supports standard WordPress posts, pages and custom post types. This means that you can create a WordPress document library using any of these methods:

  • Add each document as a post in the ‘Posts’ section of the WordPress admin.
  • Add each document as a standard Page in the ‘Pages’ section of the WordPress admin.
  • Create a custom post type called ‘Documents’, ‘Resources’ or similar. This means that there will be a ‘Documents’ or ‘Resources’ section in the left of the WordPress admin where you can store your documents.

Most people use a custom post type for their documents or resources, so that’s what we’ll do in this article. (If you’d rather use standard posts or pages, that’s fine – in step 3, simply select ‘post’ or ‘page’ from the Post Type dropdown on the plugin settings page.)

I’ll show you how to create a Documents custom post type using the free Pods plugin. I recommend Pods because you can also use it to create custom fields and taxonomies, which are perfect for storing extra data about your documents. However, you can use Posts Table Pro for WordPress document management, regardless of which plugin you use to store the documents. Other good options include Custom Post Types UI and Advanced Custom Fields. If you’re a WP developer, you can create a custom post type without using a plugin. But Pods is the only plugin I know that lets you create ALL the data you need with a single plugin!

Store extra data in custom fields and/or taxonomies

By default, your Documents post type will contain the same information as standard WordPress posts: title, content etc. But there’s lots of other information you might want to include in your WordPress document library. For example, you might want to divide it into categories, or store information about the publication date, file size or file type. You can store all this extra information in custom fields and taxonomies.

First, these tips will help you decide whether to store each piece of data as a custom field or taxonomy:

  • Custom fields Use these to store unique data about each item in your WordPress document library. For example if you’re using your document library to store internal publications, each one might have a unique document number. You would store the document numbers as a custom field.
  • Custom taxonomies Taxonomies are an opportunity to sort and organize data. Use these to store information that will apply to multiple documents in your library. For example, you might want people to be able to filter the document library to view documents from the year 2016. To do this, you would create a taxonomy called ‘Year’ and assign each document to the appropriate year.

You can also use standard WordPress categories and tags to store data about your documents. These also count as ‘taxonomies’ as each tag would be used for multiple categories and tags. The problem with these is that the built-in categories and tags will be shared across other content types, and not just your document library. For example, the same tags will be used for normal blog posts and documents. I recommend using custom taxonomies for these instead, as it keeps the data separate from the other parts of your website.

Finally, write a list of which custom fields and taxonomies you’ll need for your WordPress document library. Once you’ve done that, keep reading to learn how to create your Documents custom post type, plus the custom fields and taxonomies.

How to create a custom post type for your documents

When you create a custom post type to store the resources in your WordPress document library, it will appear as a separate link in the left hand side of the WordPress admin. You can call it anything you like, e.g. ‘Documents’, ‘Publications’, ‘Articles’ or ‘Resources’. You’ll add each document as a separate post in this section of the admin, and later display them as a document library.

  1. Go to Plugins Add New and install and activate the free Pods plugin.
  2. On the left of the WordPress admin, go to Pods Admin → Add New → Create New.
  3. Add New WordPress Custom Post Type PluginNext, you’ll see the ‘Add New Pod’ screen. Choose ‘Custom Post Type’ from the ‘Content Type (like Posts or Pages)’ drop down list.
  4. Choose a Singular and Plural label. This will appear on the left of the WordPress admin. For example, the Singular Label for a WordPress document library might be ‘Document’ and the Plural might be ‘Documents’.
  5. Click the ‘Next Step’ button.
  6. On the next screen, add as many custom fields as you like to the custom post type you just created. Remember – custom fields are for storing unique data about each document such as a document reference, file size or download link. Don’t use them for information that you want to be able to filter by – we’ll use taxonomies for this in a minute.
    Add custom fields to WordPress document library plugin
  7. Next, go to the ‘Advanced’ tab and scroll down to the ‘Supports’ and ‘Built-in Taxonomies’ sections. Tick any fields you plan to use for your custom post type. For example, tick ‘Featured Image’ if your WordPress document library needs an image column. People often create a document library with images for either a ‘File type’ icon or to upload an image preview of each document.
  8. Click ‘Save Pod’.

How to make your documents downloadable

Some WordPress document libraries add the documents as website content, rather than downloadable content. By this I mean you’d enter the content of your document within the main content area for your custom post. People would then view it online without downloading anything. If you use this method for your WordPress document management, you can skip ahead. Or, if you’re planning on including downloadable documents in your library, read on.

Your sortable document repository can contain various downloadable documents, including PDFs, Word docs and PowerPoint presentations.

Most people use a custom field to store a clickable link to the document. They then display this custom field as a ‘Download’ column in the WordPress document library. Here’s how to do it:

  1. Upload the document to the WordPress document library (Media > Add New) and copy the File URL.
  2. Create a custom field to link to the file. To do this, choose the WYSIWYG Visual Editor custom field type. When you start adding documents in a minute, use this field to add a clickable link to the downloadable File URL for each document.
  3. Add the custom field to the document library. I’ll tell you how to do this in step 3.

Tip: If your theme comes with styling for buttons, then you can also add a button to the custom field instead of a basic text link. Or, if you’re feeling creative, then you can even upload an image or icon and make it clickable!

Create direct document downloads with the Page Links To plugin

If you don’t want to bother creating a custom field for your downloadable documents, check out the Page Links To plugin. This free plugin lets people download the file simply by clicking on a title in the document library table.

It works perfectly with Posts Table Pro. It’s ideal if you want people to download directly from the table instead of accessing the single post page. They can simply click on any title in the document library and download the file immediately.

How to create custom taxonomies for your WordPress document library

So far, you have created an area to store items in your WordPress document library. You’ve also created custom fields for storing extra information about each document in the library. In step 3, you’ll be able to display them in your document library using Posts Table Pro. But before we do that, I’ll tell how you to create custom taxonomies for grouping and filtering within the document library.

  1. Create WordPress Custom Taxonomy PodsNavigate to Pods Admin → Add New and click ‘Create New’.
  2. On the ‘Add New Pod’ screen, choose ‘Custom Taxonomy (like Categories and Tags)’ from the dropdown list.
  3. Add a Singular and Plural Label for the taxonomy. For example, if you’re creating a taxonomy to categorize your document library then the singular could be ‘Document Category’ and the plural could be ‘Document Categories’.
  4. Click on ‘Next Step’.
  5. Don’t add any custom fields here – you’ve already added custom fields to the Documents post type. Instead, click on the ‘Advanced Options’ tab and find ‘Associated Post Types’. Select the Documents post type you created a minute ago.
  6. Click ‘Save Pod’.

Step 2. Add the documents to the library

Once you’ve created your Documents post type and all the fields you need, it’s time to add content to the document library. This is a similar process to adding standard WordPress posts:

  1. Go to your custom post type and create a new post for each document that you will be adding to the library.
  2. Add the document title as the main title at the top of the page.
  3. Add a short description in the area where you would normally add the post content. I recommend keeping this short if you will be displaying the description in your document library because that will let you display the full text without being truncated.
  4. Add any custom fields, taxonomies, images etc to store the data about your document.
  5. Hit ‘Publish’, and repeat these steps for each document.

Tip: If you have lots of documents to upload, then you can add them in bulk using a WordPress import plugin. The built-in WordPress importer doesn’t support extra data such as custom fields and taxonomies, so you’ll need a more advanced solution such as WP All Import.

View your document pages

If you try creating a document and click ‘View Post’, you can see what the single post page for your documents will look like. This is where people will be taken after they click on a link in your document library (depending on how you set it up). It will have a similar layout to your blog posts and won’t include your custom fields, taxonomies, or document download link.

If you don’t want to use this page, then I’ll tell you how to disable the links to it in a minute. Or if you do want to use the single document page, then you may wish to create a custom template for your documents post type. If you don’t know how to code a custom template, we’d recommend Codeable for small tasks like this.

Need professional assistance?
We've partnered with Codeable to provide our customers with expert help if required.

Step 3. Create your WordPress document library

Now it’s time for the fun bit: creating a WordPress document library to display your documents.

To do this, you’ll need the Posts Table Pro plugin. Once you’ve purchased, installed and activated the plugin, you can add your document library to any page of your website. Using a shortcode, the plugin will automatically display all your documents as an interactive table.

Posts Table Pro
List information from your WordPress website in a searchable table.

Configure your document library

In the knowledge base, there are dozens of options that let you configure your WordPress document library exactly as you like.

WordPress document library plugin settingsGo to the Posts Table Pro plugin settings page at Settings → Posts Table Pro. Read through the settings and choose the ones that are most suitable for your document library. To get you started, I’ll show you which ones to choose for most types of document library:

  • Post type – Select the post type that you created in Step 1.
  • Columns – Choose which columns to include in your document library. Add image,title,content:Download,tax:wpdmcategory,excerpt,date to show columns for featured image, document name, content (this column will be called ‘Download’), category, excerpt, and published date.
  • Shortcodes – Tick this box if you want to display clickable download links in the document library.
  • Links – This option controls what happens when someone clicks on the name of a document:
    • Leave this set to ‘all’ if you want users to be able to click through to a separate page for each document. For example, this is useful if you plan to include the full document content on your website, instead of as a download link.
    • Add ‘none’ if you want to disable the single document page. If you do this, then users will be able to click on the link to download the document, but won’t be able to visit the single document page.
    • Alternatively, if you’re using the free Page Links To plugin mentioned above, then this will automatically disable the links to the single document page. When someone clicks on a document in the document library, they will be taken straight to the download link and will never see the single document page.

Create a document library page

Next, create a new page and call it ‘Document Library’ or whatever you like. Add a [posts_table] shortcode to the page. This shortcode will list all your documents in an interactive document library, with all the options you chose on the plugin settings page.

You can edit the shortcode to list specific documents only, such as files from a specific category.

Depending on your settings and theme, here are some examples of what your WordPress document library might look like. This first example is a classic document library:

WordPress document library plugin with links

Or here’s a corporate document library:

Use the knowledge base to configure the document library to your heart’s content. WordPress document management, or creating a WordPress document gallery made simple! You can also jump to the Bonus Tips section of this tutorial for more advice on how to perfect your WP document library. This includes advice on how to add filters above the list of documents, how to create a private document library, how to track document downloads, and more.

Method 2 – Display media library files directly in a document library

To recap, method 2 takes documents from the WordPress media library and displays them directly in a WP document library on the front end of your website. You can add extra information about each document, but – unlike method 1 – there’s no need to create a separate post for each one.

The WordPress media library comes with several built-in fields for storing data about your documents. You can include these as columns in your table-based document library. The build-in fields are:

  • File name – you can display this with or without a link to download the file.
  • Image (if you are displaying images files) – you can display these with or without a link to download the file. Other file types (e.g. PDF) will just show the file name in this column.
  • Caption – a useful way to show a description or summary of each document.

If you want your WordPress document library to display additional information about each document, that’s fine too. I’ll also show you how to add extra custom fields, categories and taxonomies to the media library which you can include in the document library. For example, these are useful for displaying data such as the file type, size, add extra descriptions, or even add extra links, images, download icons or buttons.

Step 1 – List document files from the media library on the front end

First, I’ll tell you the quickest possible way to create a front end document library listing files from the WordPress media library. This will work with any file type, including PDF’s. Afterwards, we’ll customize it in more detail:

  1. Firstly, install Posts Table Pro on your WordPress site.
  2. Next, find the plugin settings page under Settings → Posts Table Pro.
  3. Paste in your license key and choose the settings for your WordPress document library. Most importantly, find the Post Type setting and select ‘Attachment’. This is the name of the built-in post type that WordPress uses for files in the Media Library.
  4. Now, create a new page under Pages → Add New, and add the shortcode: [posts_table]

View the page. Your WordPress document library will look something like this:

Front end WordPress media library filters

Alternatively, if your media library contains non-image files (e.g. PDF, XLS or DOCX) then it will look similar to this:

example of a basic front end media library

Step 2: Edit your document library columns

So far, the WP document library is using the default columns that come with Posts Table Pro. These are the file title, content (which displays an image for image files, or a filename for other file types), author, and date.

Not all of these are relevant for a document library. As a result, you should change which columns appear in the table. You can easily do this via the ‘Columns’ option on the Posts Table Pro settings page.

For example, adding the following to the Columns option will show columns for title and description. It will also rename the title column to ‘Click To View File’ and will rename the content column to ‘File Description’:

title:Click To View File,content:File Description

When you add the [posts_table] shortcode now, it will look more like this:

changing column titles

By default, users can click on the file name of a document to access the attachment page. The attachment page includes a link where users can download the document.

This isn’t very user-friendly because no one really uses the attachment page in WordPress, and it requires an extra ‘click’. Instead, I recommend letting people download files directly from the main document library page. If you’re using the Yoast SEO plugin then there’s a setting to disable the attachment page. Yoast have provided a helpful tutorial about how to set this up. (If you’re using a different SEO plugin, then you should check whether it has a similar setting):

Redirect WordPress attachment to media file

This disables the attachment post and lets people click on the document name to download it directly to their computer.

Step 3: Make your document library more flexible

In step 2, you learned how to list your media library files in a document library with the built-in fields. In this section, I’ll tell you how to add more flexibility by installing some free WordPress plugins. This will enable you to:

  • Categorise and tag your WordPress document library.
  • Create multiple tables, each listing different documents from the WordPress media library.
  • Display extra information about each document.
  • Add filter dropdowns above the document library to help people to find what they need more easily.
  • Add more eye-catching document download buttons, or even icons that users can click on to download the file.

Sound good? Keep reading and I’ll show you how to do all this.

Categorize your WordPress document library

WordPress doesn’t provide a way to structure the media library into categories or sub-folders. However, you can easily add categories by installing the free Media Library Categories plugin.

This is also handy if you just want to list specific file types, such as PDF’s.

  1. Install the plugin, then go to Settings → Media. Scroll to the bottom of the page and enter ‘mediacat’ as the ‘Custom taxonomy slug’.
  2. Next, go to Media → Categories and create as many categories as you like:
WordPress media library categories
  1. Edit each file in the Media Library and tick the appropriate category.

There are several ways you can use your document library categories:

  • Include a categories column in the document library. To do this, just add tax:mediacat to the list of columns on the Posts Table Pro settings page.
  • Add a tax:mediacat filter above the list of documents. This lets visitors view documents from a specific category.
  • Create a table listing documents from a specific category only. To do this, edit the page where you added the [posts_table] shortcode and expand it by adding the category slug: [posts_table term="mediacat:pdf"] (replace pdf with the actual slug of your category).


Add extra fields to the WordPress document library

Do you want to add extra information about your documents? You can easily do this by adding extra fields to the media library. Choose from:

  • Custom fields – these list unique information about each document. For example, if you wish to add an extra summary or description about each document, or show the file size or unique reference number, then you should use custom fields.
  • Custom taxonomies – these let you tag documents in a way that allows you to sort and filter the document library. For example, if you want visitors to be able to filter by year or file type then you should use a taxonomy.

The free Pods plugin lets you add custom fields and taxonomies to the WordPress media library. You can then use this in your front end document library.

How to add custom fields

  1. Install the Pods plugin.
  2. Click on the ‘Pods Admin’ link in the WordPress admin, then choose ‘Edit Pods’.
  3. You’ll see a list of all the post types on your site. Choose the ‘Media’ post type.
  4. On the next page, you can manage the custom fields for your WordPress media library. Click ‘Add Field’ and type a label and name for each custom field. In the example below, I created a custom field called ‘File Size’ with the label ‘size’. (Make a note of the label – you’ll need this in a minute.)
Add custom field to WordPress media library
  1. Click ‘Save Pod’.
  2. Finally, go to edit each document file in the media library. Your new custom fields will appear lower down the page. Add the extra information to them.

How to add custom taxonomies

  1. Go to Pods Admin → Add New → Create New:
create new custom post type
  1. Choose ‘Taxonomy’ from the ‘Content Type’ dropdown list. Choose a Singular and Plural Label (e.g. Year or File Type), then click Next Step:
custom post type name
  1. On the next page, find the ‘Advanced Options’ tab and scroll down to ‘Associated Post Types’.
  2. Tick ‘Media (attachment)’. This adds the new taxonomy to the WordPress media library.
  3. Lastly, click ‘Save Pod’.

Now when you edit a document in the media library, you’ll the taxonomy on the right. Use this to tag your documents with the extra information.

Display your custom fields and taxonomies

Once you’ve added your custom fields and taxonomies, you can start displaying them in your WordPress document library:

  1. Return to the Posts Table Pro plugin settings page (Settings → Posts Table Pro).
  2. Extend the list of columns in the ‘Columns’ option to include your custom fields and taxonomies:
    • Custom field column – add cf: followed by the custom field name (e.g. cf:size)
    • Custom taxonomy column – add tax: followed by the custom taxonomy slug (e.g. tax:year)

For example, your list of columns might be: title:Name,content:Image,excerpt,cf:size,tax:document_year

This will create a WP document library like the screenshot below. It has a title column (which I renamed to ‘Name’), a content column (which I named ‘Image’ and shows the image for image files, and the filename for non-image files), excerpt (which is the caption field from the media library), a custom field called ‘size’, and a custom taxonomy called ‘Document Year’.

WordPress front end media library example

In the previous screenshot, you can see a ‘Download’ button. This is a more advanced way to allow people to download a media library file.

It’s trickier to set up than simply letting people click on the file name to download the file. This is because it requires an extra step, as you need to manually add a download button for each file. You can also add it as a plain text link, or even upload an additional image or icon for visitors to click on. The instructions on how to add download buttons, links and icons are in this article of the Posts Table Pro knowledge base.

If you don’t want to do this, then I recommend keeping it simple and just allowing the filename column of the table to link to the file URL. This happens automatically and doesn’t require any manual work.

Bonus tips on perfecting your WordPress document library

By now, you’ve learned how to create a document library using either method 1 (create a custom post type) or method 2 (list media library files directly). Before we finish, I will share some tips on how to make your WordPress document library directly, whichever method you used.

Make it easier for people to find specific documents

Your document library comes with a search box at the top right. If you’re using the standard method of loading the table, then the search box looks at all the columns in the table. If you’re using the lazy load option (which lets you list unlimited files in the table without performance problems) then the search box will look at the title of each file.

Unfortunately it’s not possible to search the full content of the downloadable files or PDF’s that are linked to from the document library. As a result, it’s important to use categories and custom taxonomies to tag your documents and make them easy to find. You can then use these to add filter dropdowns above the list of documents. People can use these to quickly refine the list and find the document they’re looking for.

Use the filters option in Posts Table Pro to add these filters. For example, the WordPress document library in this screenshot has filters for Media Categories (created by the Media Library Categories plugin) and Document Years (a custom taxonomy created using Pods):

Front end WordPress media library filters

Create a private WordPress document library

Now, I’ll tell you how to create a private and hidden document library in WordPress. You can either password protect your document library, or restrict it specific groups of logged in users.

Option A – Password protected document library

You can hide your entire document library – or just specific parts of it – with the Password Protected Categories WordPress plugin.

Private WordPress document library.

It works by password protecting one or more categories within your WordPress document library. Users must enter a correct password to unlock the category and view the private documents inside it. Once they’ve unlocked a category, they can navigate within it and won’t need to re-enter the password for several days.

The benefit of this method is that you don’t have to create a separate user account for everyone who accesses your document library. For example, if you’re creating a document database for employees, then there’s no need for each person to have their own user account on your WordPress site. Instead, just give them a password to unlock the protected library without needing an individual login.

How to password protect your document library
  1. First, create the document library by following the instructions earlier in this tutorial. However, instead of adding your Posts Table Pro shortcode to a normal page in WordPress, you need to add it to your category archive template. This will automatically list documents in the table-based layout whenever someone visits your document category pages.
  2. Next, get the Password Protected Categories plugin. Install it using the instructions in the Getting Started email.
  3. Go to Documents  Categories. (If you can’t see this, then go back to the settings for your ‘Documents’ custom post type and make sure you have activated categories/taxonomies.)
  4. Create 1 or more password protected categories for the WordPress document library. Some tips:
    • If you want to create a completely private document library, create 1 password protected category and put all your documents within it. If you want to add sub-categories, that’s fine. Leave them set to ‘Public’ and they’ll automatically be protected with the same password as the main document library category.
    • If you just want to protect parts of your document library, that’s fine too. Structure it into as many categories and sub-categories as you like. Some of these can be set to public and others password protected.
  5. Now go to the main Documents list in the WordPress admin and categorize your documents as needed. Documents in password protected categories will automatically be protected with the same password as its category.
  6. Finally, create a login page for your users by adding the shortcode [category_login] to any page on your site. They can enter the password here, and it will direct them to the private document library category.

Option B – Restrict your WordPress document library to specific logged in users or roles

If you’d rather create a separate user account for each person who accesses your document library, then install the Advanced Access Manager plugin. Use it to restrict your WP document library to specific user roles, or even individual logged in users.

Use this method if you want the most secure option and are prepared to create a separate user account for each person who accesses the document library.

First, follow the above instructions to create a WordPress document library with Posts Table Pro. Once you’re done, this is how to make it private:

  1. Install the Advanced Access Manager plugin.
  2. Use the instructions in this tutorial to restrict the main document library page (and all the documents within it) so that only specific users or roles can access them.
  3. Create a user account on your website for each person who needs access (Users → Add New).
  4. Use a front end login plugin such as Theme My Login to create a user-friendly login page.
  5. Whenever someone logs into their account, they will be able to access the private WordPress document library.
  • For more granular control, you can create multiple user roles and show different documents to different users. Your main document library page will automatically show the correct documents for each logged in user.
  • If you don’t want to bother creating a unique user account for each person, that’s fine. Instead, you could create one user account and let people share a username and password. Obviously, this is less secure than having individual document library accounts.
  • Are you showing different documents to different people? If so, DO NOT tick the ‘Caching’ option on the Posts Table Pro plugin settings page. This will ensure that each user sees the correct documents, and not a cached version of the library.

How to sell documents

So far, I’ve assumed that you want to provide free access to your WordPress document library. But what if you want to sell printed or digital documents online? Fortunately, you can do that too.

The easiest way to create an e-commerce document library is to use our other plugin WooCommerce Product Table, instead of Posts Table Pro. The instructions for selling documents in this way are similar to the document library tutorial in the previous sections. The main differences are:

  1. Add each document as a WooCommerce product. This is instead of having a ‘Documents’ post type for storing documents or displaying files from the media library. In WooCommerce, choose the ‘Downloadable’ product type and upload the file that people will receive after purchasing the document. You can also add other information such as the price.
  2. WooCommerce Product Table has a different shortcode for listing your document products. You can read about all the options in this article.

Your WordPress document library will look similar to the other screenshots in this article. The difference is that they will actually be e-commerce products available for sale, with add to cart buttons.

Alternatively, you can use Posts Table Pro with other WordPress e-commerce plugins such as Easy Digital Downloads. Check out our separate tutorial on how to use Posts Table Pro to list products (including documents) with Easy Digital Downloads.

How to track document downloads

WordPress doesn’t have any built-in analytics to track the number of downloads from your document library. Instead, you can do this using analytics software, such as event tracking in Google Analytics.

For example, Moz have provided an excellent tutorial on How to Track PDF Traffic and Links in Google Analytics.

How to update a document without changing the URL

Sometimes, you’ll want to update a document in the library. This is an important part of your regular document management. Obviously, you want to make this process as simple as possible. How to do this depends on how you’ve added your documents:

  • Documents added directly to the content of a post (or custom post type). Edit the document post, replace the content with the new document, and click Update. The document will automatically update in your Posts Table Pro document library.
  • Downloadable documents in the WordPress media library. Alternatively, use the free Enable Media Replace plugin to replace documents in the media library without changing the URL. That way, you simply replace the file and don’t need to update any document library links.

Can users submit documents to the resource library?

A lot of websites list documents that users have submitted themselves. You can do this by using the Posts Table Pro WordPress document library plugin with Gravity Forms. We’ve published a separate tutorial on how to do this.

See a document library in action – RJ Lee Group publications library

WordPress document management

RJ Lee Group are an industrial forensics analytical laboratory and scientific consulting firm. Their staff make regular presentations and public in peer-reviewed journals, so they wanted a publications library on their website showcasing the firm’s work.

With over 300 publications, they needed a user-friendly and easy-to-search library.

They used Posts Table Pro to create a publications library listing their articles. The table displays 25 publications per page with pagination allowing users to view older documents. It includes columns for publication title, citation and date.

You can sort the document library by clicking on any column. The search box above the table lets you further navigate the publications in the list.

You can also view a document library in action on our demo page.

It’s time to set up the WordPress document library plugin

Now you know how to use the table plugin to create a WordPress document library! As you can see, Posts Table Pro is ideal as a WordPress document library plugin.

To get even more value for money, you can create tables for lots of other types of content too:

Posts Table Pro
Create your WordPress document library today!

Lastly, you can buy Posts Table Pro here. And if you like it, register as a Barn2 Media affiliate and get 30% discount for recommending our WordPress plugins! I hope you enjoy creating your WordPress document library with Posts Table Pro, the best WordPress document library plugin!

Katie Keith

An active member of the global WordPress community, Barn2 Co-Founder Katie loves collaborating with other plugin companies. Her articles have been published on high profile sites including WPTavern, Torque and IndieHackers. She oversees all plugin support and deals with 'Tier 2' support requests about how to use Barn2's plugins in advanced ways.


  1. Sheikh Pervez Hameed
    October 24, 2020 Reply

    This is a very informative article, yet I miss a specific requirement.

    Let's say I have uploaded three folders. Aug 2020, Sep 2020 and Oct 2020.

    Each of these folders contains user-specific bills.
    Let's say we have three users.
    David - membership number 1111
    Sarah - membership number 857
    John - membership number 6407

    Aug 2020 folder has the files:

    1111.pdf, 1111-det.pdf, 857.pdf, 6407.pdf, 6407-gh.pdf

    Sep 2020 folder has the files:
    1111.pdf, 1111-det.pdf, 857.pdf, 6407.pdf, 6407-gh.pdf

    Oct 2020 folder has the files:
    1111.pdf, 1111-det.pdf, 857.pdf, 6407.pdf, 6407-gh.pdf

    As you can see, the file names are the same. The folder names are different.

    Now, let's assume John logs in as a subscriber. His membership number is 6407. He navigates to the bill section where the display should show so the three folders and on clicking on any folder, only 6407.pdf & 6407-gh.pdf gets displayed to him.

    Sarah has simultaneously logged in as a subscriber and gets the display of 857.pdf

    David gets the display of 1110pdf and 1111-det.pdf

    Is this possible?

    • Edge
      October 27, 2020 Reply

      Hi, Sheikh. Thanks for your comment and interest in creating a WordPress document library using Posts Table Pro. I'm glad our article was helpful.

      Our plugin works by pulling the posts or custom post type data directly from your site's WordPress database and displays the exact values in columns of a dynamic table that you can filter, sort, and search. It does not restrict access to or the visibility of the posts and content displayed/listed in the table in any way.

      For what you would like to achieve, you can use the Advanced Access Manager plugin with Posts Table Pro to create tables with WordPress user specific content. Users will see different information depending on their role. For details, please see our other tutorial: Create WordPress tables with user specific content.

      Let me know if you have any other questions. You can also get in touch with us via our dedicated Support Center. Thanks!

  2. sam
    April 4, 2020 Reply

    After spending $69 still this plugin needs third party plugins and some complecated setup. why?????????

    • Debbie
      May 13, 2020 Reply

      I can certainly relate to Sam's comment. I think the point s/he is making has less to do with a specific issue and everything to do with the concept of paying for a premium plugin that costs the best part of $70 that STILL relies on the functionality of several other 3rd-party plugins - as listed in this detailed tutorial - to get a desired result.

      While I like the possibilities of Posts Table Pro, the idea of bloating my website with even more plugins (in addition to paying $69 for this one!) is a concern. Sam makes a valid point.

      Just my two cents...


      - Debbie

      • Katie Keith
        June 5, 2020 Reply

        Hi Debbie, thanks for your comment. Please note that the plugins that we recommend using with Posts Table Pro to create your document library are all free - so the only premium plugin that you need is Posts Table Pro. All the plugins we recommend for your document library are lightweight, developed by reputable WordPress companies, and will not bloat or weigh down your website. We have thoroughly tested them to make sure it is an excellent solution for creating a document library.

    • EJ
      April 17, 2020 Reply

      Hi, Sam.

      Sorry to hear you're having difficulty with setting up the plugin to meet the requirements on your site, some of which may be functions that are no longer a part of our plugin and hence the need to integrate with other plugins that provide that specific functionality.

      So that we may better understand your concern and assist you best, please could you describe the issue in more detail by filling up a technical issue for at our dedicated Support Center.

      Thanks in advance,

  3. Stephanie
    October 18, 2019 Reply

    If we were to store our Media Library files using Amazon S3 along with an S3 compatible plugin rather than through our budget host, would we be able to access the files in S3 via Post Tables Pro?

  4. Folorunsho Bamisaye
    September 19, 2019 Reply

    Where can one create user name and password on your website?

  5. Bamisaye Folorunsho
    September 18, 2019 Reply

    I need more explanation on this document. Moreover, is there nothing one can use the free version of this plugin for? Lastly, is there a comprehensive video for both free and pro.

  6. Bronwyn Parkin
    March 15, 2019 Reply

    Hello Katie, Thanks for the comprehensive instructions. You mention tags in passing. Do you add the tags to each document as you enter it? Then how do you filter for tags?

    • Katie Keith
      March 15, 2019 Reply

      Hi Bronwyn, there are 2 ways to add tags to your documents:

      1. You can use the tags that come with WordPress itself, and which will appear in a 'Tags' section on the right hand side of the Add/Edit Document screen. The only problem with this approach is that the same tags will be used for other content types such as blog posts, which you may not want.

      2. If you want a dedicated way to tag documents, then you can create a custom taxonomy and call it 'Document Tags' or similar. There are instructions for this in the above tutorial.

      Either way, you can add a tags (or taxonomy) filter dropdown above the document library by following the instructions on this page.

  7. Marzio
    February 15, 2019 Reply

    Hello, Nice post!

    I use a document managment plugin named wp-filebase but the table it use has not the same power.
    I was thinking if it is possible to use the "wpfb_file_category" taxonomy to create a table with your plugin.
    Do you think it is possible?

    Tank you

    • Katie Keith
      February 18, 2019 Reply

      Yes, this will be possible because Posts Table Pro supports custom post types and custom taxonomies, so you will be able to display this information using our plugin to create a more sophisticated table layout. You will need to figure out the name of all the custom fields and taxonomies used by the wp-filebase plugin so that you can display them as columns in the table.

    December 7, 2018 Reply

    Thanks for sharing.

  9. Vale
    October 21, 2018 Reply

    Very well explained,but how about the cpt archive pages? Since the table handles the list view of posts I assume that We don't need to create the archive-cpt.php ?

    • Katie Keith
      October 22, 2018 Reply

      By default, the archive pages will use the same template as your blog archives but you don't have to use these because you will be using a page with the table layout instead. So there's no need to create a dedicated archive template for your documents.

  10. Ian Renwick
    September 17, 2018 Reply

    Hi Katie,
    I have set the default custom filters, search box etc as per your demo and all working fine as a document library page.
    I then wanted to display - in a post - all related documents that are filtered by a tag, e.g. [posts_table tag = "lollie"]. This also works fine except I don't want the custom filters and search box for these instances.
    Is there a way to "hide" them but still retain the Posts Table Pro default settings for the main document library page?

    • Katie Keith
      September 17, 2018 Reply

      Hi Ian, there are shortcode options to hide elements such as the search box from specific table. This is a good alternative if you don't want to hide them globally on the plugin settings page. The instructions are here.

      • Ian Renwick
        September 17, 2018 Reply

        Hi Katie,
        Thanks for the quick response. All good except there wasn't an option to "hide" the default custom filters.

        • Katie Keith
          September 17, 2018

          Hi Ian, sorry for missing that bit. Here's a link to the documentation for the filters. You basically just need to add filters="none" to the Posts Table Pro shortcode.

  11. Ian Renwick
    September 17, 2018 Reply

    Hi Katie,
    Rather than downloading a pdf is it possible for it to be opened in a new tab. Ideally I would like to offer both options (Download or View).

    • Katie Keith
      September 17, 2018 Reply

      Hi Ian, yes you can do this. Create a WYSIWYG/visual editor custom field (e.g. using the free Advanced Custom Fields plugin) and display it as a column in your document library table. Add a clickable link and choose the 'Open in new tab' option. This will then work within the document library. (Make sure you tick the 'Shortcodes' option on the Posts Table Pro plugin settings page - this tells the plugin to display the clickable link instead of plain text.)

      • Ian Renwick
        September 18, 2018 Reply

        Hi Katie, I have been able to add and display a custom WYSIWYG field and for it to display a link. I can get it to open and preview a PDF from my media folder but can't seem to get it to do the same with a link to a PDF stored with Download Manager. I've tried using the same link that works to download the file, e.g. https://mydomain/?wpdmdl=191. Is this the correct approach or am I missing something?

        • Katie Keith
          September 18, 2018

          Hi Ian, the Download Manager links are controlled by that plugin, so you get less flexibility than if you simply add a direct link to the PDF in the media library to a custom field using the method we discussed earlier. If you want to open them in a new tab, then you'd need to hire a developer to write some custom code which would change the way the Download Manager links work - or you could just create a custom field and add the links manually that way.

  12. Hans Balmaekers
    August 24, 2018 Reply

    Thanks Katie- this may be the solution for our challenge. Help me understand - can we have our members pick interests via their profile page through a survey or so, which then will be saved with their profile but could be changed by them, and then show them content based on their interests?

    So, we would assign "tags" to docs/posts, and the user can select 5 tags, and then they get served a list of docs/posts that have those tags assigned?

    • Katie Keith
      August 26, 2018 Reply

      Hi Hans, you could use WordPress tags for this, or a custom taxonomy attached to your 'Documents' post type. However, you would need to hire a developer to do some custom development work to add the feature you need for members to be able to pick their interests via their profile page, save and edit these interests, and use their interests to dynamically create links for each member to create a table listing the documents matching their interests. It's easy to create tables listing documents with specific tags or taxonomy terms (instructions here) - the bespoke bit would be enabling members to select, save and edit their interests via their profile, as that's not part of our plugin. If you don't have a developer, then I highly recommend posting a job on Codeable as this is an excellent way to find a really good developer with the skills you need.

  13. Tom Martin
    July 18, 2018 Reply

    I have a site that contains separate pages for groups. Each group needs a document library specific to their group. Can I have separate pages with each having it's own, specific to that group, document library?

    • Katie Keith
      July 18, 2018 Reply

      Hi Tom, yes you can do this. Here's a link to the instructions for creating different tables, each one listing documents from a specific category, tag, custom taxonomy, etc. You can use any of these options to create separate pages containing a different document library for each group.

  14. Stepehn Walker
    June 6, 2018 Reply

    Is there a way to build a taxonomy specific list based on document_category?

    • Katie Keith
      June 6, 2018 Reply

      Hi Stephen, yes you can use the Posts Table Pro plugin to list documents with a specific taxonomy term only, including document_category. Please see the instructions for the term option in our knowledge base.

      • Stephen
        June 6, 2018 Reply

        Perfect. Thank you!

  15. Ricardo J
    May 9, 2018 Reply

    Great how to and great solution! However I'm looking for a solution where I can set user-level permissions to each document, so that each user will only see the documents that are his or public. Any ideas how to improve your solution so that it can match this requirement?

    • Katie Keith
      May 9, 2018 Reply

      Hi Ricardo, I don't know about user-level permissions but you can achieve something very similar by using Posts Table Pro with the free Groups plugin. Create a 'Group' for each user, assign the user to it, and restrict the document to that Group. Your Posts Table Pro document library will only show documents that the current user has access to.

  16. Chris Stinson
    March 27, 2018 Reply

    this is one of the best written 'how to's ' i have read. I like how you clearly layout the 'if you are doing this, then skip to next step' 'if you need to do this then read on' soooo many articles don't clearly lay that out and it can become confusing. well done

Please share your thoughts...

Your email address will not be published.