A WordPress document library plugin is a popular way to list PDF files or other documents in a structured format with download links. A good document library makes it quick and easy for people to find the items they need – for example, with search options and filters.
Surprisingly, there aren’t many good quality WordPress document library plugins around – free or premium. One of the most popular options is a WordPress table plugin called Posts Table Pro. While it’s not exclusively designed for listing documents, it has all the features that you need for a fully functional document library.
Today, I’m going to show you how to use the Posts Table Pro plugin to create a searchable WordPress document library with filters, download links, and extra data about each document. Your finished document library will be similar to this:
If you like what you see, keep reading and I’ll show you how to do it!
Who Needs a WordPress Document Library Plugin?
In my 8 years of designing WordPress websites, I’ve been amazed at how many people need an online document library. It’s one of the most common requests, up there with e-commerce and events management.
Here are some examples of how a WordPress document library can benefit your site.
Public Document Library
Many WordPress websites include a document library listing various types of publication in an easy-to-find format. This might be called something other than ‘document library’, such as ‘Resources’, ‘Downloads’ or ‘Knowledge Hub’. If it’s a way to store files or other types of document, then it’s a document library!
You can use a WordPress document library to provide any types of downloadable file that people will find useful. If you’re a charity then your document library might include publications and printable fundraising materials. If you’re a membership organization then your document library might include membership materials, such as downloadable logos and trust badges. An advice website might create a document library containing downloadable resources.
Database of Technical Specification Sheets
A WordPress document library is a good way of publishing technical documents or instructions for your products. For example, you can list the specification sheet for each document in a table with links to downloadable PDF’s. This can either be a standalone page on your website, a section of your knowledge base, or part of a WooCommerce website if you sell online.
Posts Table Pro has a sister plugin called WooCommerce Product Table, which lists products in a table view with links to downloadable spec sheets. Use this if you need to sell products as well as providing downloadable files.
Staff Intranet with Policies & Procedures
Lots of organizations need a simple way to create a staff intranet with downloadable policies and procedures. This needs to be available to all employees, both onsite and working remotely.
If you’re on a budget and don’t want an Enterprise-level solution like SharePoint, then a password protected WordPress document library is a neat option. You can add each policy document as a downloadable file (e.g. PDF, DOC or any other format), or publish the full text of the document directly on a web page.
You can restrict your document library from public view with the Password Protected Categories WordPress plugin. Just put all your policy documents in 1 or more password protected categories, and give the password to your employees. Use the same password to restrict the main document library page with the same password, and you’re good to go! This is much easier than a full membership plugin because you don’t need to bother with individual user accounts for each employee.
How to Build a WordPress Document Library
Ok, so now you know why a website might need to store and display files and documents. Next, I’ll show you how to create your own document library.
We’ll do this by creating a document library for a fictional membership organization. It will contain a range of documents to show you what’s possible with the WordPress document library plugin. We’ll also add extra features such as keyword search box, multiple filters, and extra columns of information about each document.
The document library will require two plugins: one for storing the documents in WordPress; and another for displaying them in a searchable document library on the front end of your website. I’ll tell you how to set them up next.
1. Create a Place to Store Your Documents
The first step is to create an area within the WordPress Dashboard for storing your documents.
I recommend using a custom post type for this. It’s easy to do, and will keep your documents separate from your pages and posts. It will add a dedicated ‘Documents’ section to the WordPress admin. This makes it easier to manage as the document library grows over time.
We’ll do this using Pods, a rapidly growing plugin for creating custom post types and other fields in WordPress.
Custom Fields or Taxonomies?
Before you start, it’s worth writing a list of the information that you plan to include in the document library. This will affect which fields you need for the Documents custom post type.
Your WordPress document library plugin can display any or all of the following:
- Standard fields that are available for all WordPress posts. This includes the post title, content editor, excerpt, date, author, featured image, categories, and tags. I normally recommend using these before creating custom fields or taxonomies. However, it’s worth knowing that your categories and tags will be shared across all the post types that use them (e.g. normal blog posts), so you might be better off with custom taxonomies instead.
- Custom fields. These are extra fields that you can use to store data about your documents. You can choose from various field types such as text, WYSIWYG editor and date. Use custom fields for information that you need to show in the document library, but which doesn’t need to be filterable. For example, use a WYSIWYG Visual Editor field to add a clickable download button or link to the document library.
- Custom taxonomies. Custom taxonomies are similar to categories in WordPress. You can use them to group and filter the items in your document library.
I decided to create the following fields for my fictional document library. Your list will probably be similar to this:
- Standard fields:
- Title – The name of each document.
- Content – For downloadable documents, I used this to add a brief excerpt or summary. For online documents, I added the full content of the document to this field and showed the first few words on my main document library page.
- Date – The ‘Published’ or ‘Last Modified’ date of each document.
- Featured image – An image or icon showing each file type.
- Custom fields:
- Download link – ‘WYSIWYG (Visual Editor)’ field type.
- Reference – ‘Text’ field type.
- Custom taxonomies:
- Categories – I decided to create a custom taxonomy to categorize my documents instead of using the built-in WordPress core categories. This let me create dedicated categories just for my documents.
- Year – This lets people filter the library for documents published in a specific year.
Write a list of fields and field types for your own WordPress document library. Once you’ve done that, it’s time to start building it for real!
Install the Free Pods Plugin
- Install and activate the free Pods – Custom Content Types and Fields plugin.
- Go to Pods Admin > Add New in the left of the WordPress Dashboard.
- Click ‘Create New’ and choose the ‘Custom Post Type’ option from the dropdown.
- Add a Singular and Plural Label which will be used for your Documents post type. For example, ‘Document’ and ‘Documents’.
- Next, you’ll be taken to a ‘Manage Fields’ screen. Click ‘Add Field’ to create any extra fields that you want to use for storing information about your documents.
- Now go to the ‘Advanced Options’ tab. Scroll down to the ‘Supports’ and ‘Built-in Taxonomies’ section and tick all the core WordPress elements that you need for your Documents. For example, if you need a Title, Editor, Featured Image, Excerpt, Custom Fields, Categories and Tags, then tick all these boxes.
- Save the Pod.
Now Create Custom Taxonomies
If you’re planning to use any custom taxonomies, then this is how to do it. If not, you can skip to the next section.
- Return to Pods Admin > Add New in the left of the WordPress Dashboard – but this time, click ‘Extend Existing’.
- Click ‘Create New’ and choose the ‘Custom Taxonomy’ option from the dropdown.
- Add the Singular and Plural Label for the taxonomy. (I used ‘File Format’ and ‘File Formats’.)
- On the next screen, go to the ‘Advanced Options’ tab and scroll down to ‘Associated Post Types’. Tick your Documents post type and Save.
- Repeat these steps for each custom taxonomy that you need for the document library.
2. Add Content to the WordPress Document Library
In the previous section, you created a custom post type with all the fields of information that you’ll need for your documents. Now, it’s time to add the actual documents.
- Go to Documents > Add New in the WordPress admin. (This is the custom post type you created in Step 1.)
- Add all the information for the document. This should be familiar to you, as it’s just like adding a regular blog post in WordPress.
- To add a link to download the document, you need to add it as a clickable link. This is the same as adding hyperlinks in WordPress, which is why I recommend using a WYSIWYG custom field for this. You can either add a simple link to the URL of the downloadable file, or if your theme comes with button styles then you can add a button. If you’re feeling clever, then you can even upload an image and link it to the file.
- Publish the document, then repeat the process for all the documents in your library.
Bulk Importing to the Document Library
If you have lots of documents to upload, then you can use a import plugin to do a bulk upload. This will save you a lot of time compared to adding each document manually.
You can populate the WordPress document library with any import plugin that supports custom post types, custom fields and taxonomies. If you do this, then you’ll need to create a CSV spreadsheet with all the information (including URL of the downloadable document) and import it to WordPress.
3. Create a Front End WordPress Document Library
Now comes the fun part, as this is where your document library really comes to life! We’re going to use the Posts Table Pro WordPress table plugin to list the documents in a neat table layout with all the information you added, plus search box and filters.
- Get Posts Table Pro and install it on your website.
- Create a new page for the WordPress document library plugin to list your documents. Call it ‘Document Library’, ‘Resources’, ‘Publications’, ‘Knowledge Base’, or whatever you like. If your theme comes with a full-width template, select this – it will allow more space for the information in the document library.
- Add the following shortcode to the page:
[posts_table post_type="document" columns="cf:reference,title,content,tax:document_category,date,image,cf:download_link" filters="tax:document_category,tax:year" shortcodes="true" links="terms"]
- Next, replace the sections in red as follows:
- post_type=”” – Add the correct Singular Label for your Documents custom post type between the double quotation marks. Mine was called ‘document’ but yours might be called something else
- columns=”” – The Posts Table Pro plugin comes with lots of column options which you can include in the WordPress document library. Use the documentation to list all the columns you need between the quotation marks. You can also add custom column headings – for example, to rename the ‘Title’ column to ‘Document Name’.
- filters=”” – Choose which filter dropdowns will appear above the document library. The example shortcode above has 2 custom taxonomy filters: document category and year. Yours will probably be called something different, so use the documentation to set your filters.
- Finally, Publish the knowledge base page.
How to Display Custom Fields and Taxonomies
As you’ll have noticed in the shortcode example above, you need to add a bit of extra syntax to show custom fields and taxonomies in the document library. Here are some notes to help you with this:
- Custom fields – You can add each custom field as a separate column in the document library. Add
cf:before the Custom Field Name to tell the document library plugin that it’s a custom field. For example, if your custom field is called ‘download_link’ then you need to add it as ‘cf:download_link’. To check the Custom Field Name, go to Pods > Edit Posts > [click on your Document Library custom post type] > Manage Fields > [click on the custom field].
- Taxonomies – You can add each custom taxonomy as a separate column, or as filter dropdowns at the top of the document library. Add
tax:before the taxonomy name, for example ‘tax:document_category’. The name of the taxonomy is the same as the Singular Label you added when you created the taxonomy back in Step 1. If you added the Singular Label as multiple words (e.g. ‘Document Category’) then the taxonomy name will use this with an underscore (NOT a hyphen) in between. You can check the Singular Label by going to Pods > Edit Posts > [click on your taxonomy] > Labels.
4. View the Document Library
Now, view the page you just created. The first draft of your WordPress document library will look something like this:
As you can see, the documents are listed in a neat table view with all the columns I added to the shortcode. There are filter dropdowns above the table so that people can quickly find the documents they want. There’s also a keyword search box. Users can click on a category to view documents from that category only. They can click on the Download link or button to access the file. Neat!
If any information is missing, then there’s probably an error in the shortcode or you’ve used the wrong name for your post type, custom fields or taxonomies. Check these and refer to the documentation until it’s working.
4. Finalize Your WordPress Document Library
By now, you’ve built a fairly impressive document library. All the documents are listed in a neat-looking table with search box and filters.
However, the Posts Table Pro table plugin is much more powerful than that. There are dozens more options that you can use to fine-tune the document library. Here are some that you might find useful, with links to the relevant parts of the documentation.
Choosing What Appears in the Document Library
- Create multiple tables listing different documents – In Step 3, I showed you how to create a 1-page document library listing all your files. If you prefer, you can list different documents on different parts of your site. For example, you might like to create a multi-page document library with a different category per page.
- Change how the documents are ordered – By default, the WordPress document library plugin will list the documents with the most recent first. There are lots of other ways to sort the document library, such as alphabetically by title.
- Show or hide different elements – There are lots of options to show, hide or move the sections above and below the document library, such as the search box and pagination buttons. I recommend removing any elements that aren’t crucial. For example, if you’ve added filters above the list of documents then you can make it look tidier by hiding the page length option.
Behind the Scenes
- Lazy load for faster page load times – If you have lots of documents, then you can improve the performance of your WordPress document library by enabling the lazy load option. This loads 1 page of the document library at a time, instead of loading everything all at once. When users click on the pagination links at the bottom, the next page of documents will load.
- Mobile-responsive options – Your WordPress document library will be 100% responsive and mobile-friendly straight out of the box. The columns in the table of documents will automatically resize to fit different screen sizes. If there’s too much information to fit on the screen, then the least important columns will be hidden. People can see the hidden columns by clicking on a + icon. Posts Table Pro has various options to change how the document library adapts to smaller screen sizes, for example by opening hidden content in a lightbox instead.
- Links – In the example shortcode above, I disabled all the links from the document library to the single post page for each document. I’d recommend this for most WordPress document libraries because the download links is available directly in the table, so there’s no need for people to click elsewhere. If you want to use the single document page, then you can do so using the Links option.
It’s surprisingly easy to create a professional-looking WordPress document library. This tutorial has provided everything you need about how to use create a document library with Posts Table Pro and Pods. You’ve learned which plugins to use, how to store your documents, and then how to list them in a searchable document library – including extras such as a keyword search and filters.
I’d love to hear how you get on with building your own document library. Please add your comments below.