How to Create a WordPress Document Library

A WordPress document library presents your documents in an easy-to-find format. It makes WordPress document management easier for you to keep things organized, share resources within your organization, create a knowledge hub or a publications database. Your WordPress document library might be public, or you can keep it private and available to specific people only.

WordPress document library plugin

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 how to use Posts Table Pro for document management and your WordPress media library. This is a fantastic way to create a WordPress document library.

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.

WordPress document management: Step-by-step tutorial

First, watch me creating a WordPress document library using the 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 displaying your WordPress 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!

GET THE PLUGIN

Before we start, I’ll show you an example of Posts Table Pro in use for a WordPress publications library.

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 to list in the library, they needed a user-friendly table that makes it easy to find a specific publication.

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.

Each column can be sorted, and a 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.

WordPress media library plugin

Create a WordPress document library

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

In the following 4 sections we’ll cover:

  1. Storing documents on your website
  2. Adding documents to your library
  3. Creating a document library
  4. Making your document library private

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. If your documents are already stored on your website and you’re ready to create your WordPress media library, you can skip ahead to step 3.

If not, carry on reading as 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

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 mediausing 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, that’s fine – in step 3, you just need to remove post_type=”documents” from the Post Table Pro shortcode examples in this article. To use pages, just add post_type=”page” to the shortcode instead.)

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 WordPress developer, you can create your 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 custom 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’.

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 and taxonomies.

If you’re planning to add the content of each document directly to your website, instead of requiring people to download a file, then people can use this page to view the full content. However, most WordPress document libraries provide downloadable documents and don’t require a separate page for each document. There are 2 easy ways to disable this:

  • Use the links option in Posts Table Pro to disable links to the single document page.
  • Use the free Page Links To plugin to link each document directly to the download URL. 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.

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.

WordPress plugin customizations service

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.

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 – 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’ to the Links field 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.
  • Filters – If you’ve included filterable columns in the document library such as categories or tags, then select ‘Show based on columns in table’. This will add filter dropdowns for those columns at the top of the document list. If you want to add filterable data that isn’t included in the table, then choose ‘Custom’ and list the filters here. For example, adding tax:wpdmcategory,tags will add filter dropdowns for document category and tags.

Create a document library page

Next, create a new page and call it ‘Document Library’ or whatever you like. Click the ‘Insert Posts Table’ toolbar icon:

Insert Posts Table icon in the toolbar

This will 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:

WordPress document library plugin with links

wordpress-document-library-downloads

Use the knowledge base to configure the document library to your heart’s content. WordPress document management made simple!

4. Create a private WordPress document library

Lastly, 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.

Further reading: Check out our full tutorial on how to create a private WordPress intranet for your organization.

Option B – Restrict your WordPress media library to specific logged in user groups

If you’d rather create a separate user account for each person who accesses your document library, then the Groups plugin is a good option. Use this free WP plugin to create a ‘Group’ of all users who can access the document library.

Once you’ve followed the above instructions to create a document library with Posts Table Pro, this is how to make it private:

  1. Install the Groups plugin.
  2. Create a Group for everyone who will access the WordPress document library. Or if you want different people to see different documents, create more than one Group (e.g. Managers and Employees).
  3. Restrict the main document library page and all the documents within it so that only users from the correct Groups can access them.
  4. Create a user account on your website for each person who needs access. This should be a ‘Subscriber’ account so they won’t have privileges to edit your website. Add each user to one or more Groups, depending on which documents they have access to.
  5. Use a front end login plugin such as Theme My Login to create a user-friendly login page.
  6. Whenever someone logs into their account, they will be able to access the private WordPress document library. They’ll see the documents for their Group, which will be hidden from everyone else.

Tips:

  • 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 for each Group, and let people share a username and password.
  • Do not tick the ‘Caching’ option on the Posts Table Pro plugin settings page. This will ensure that each user sees the correct documents for their Group, and not a cached version of the library.

5. Bonus tips on WordPress document library management

Before we finish, I’ll give you some extra tips on easy document management for your WordPress site.

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.

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!

GET THE PLUGIN

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!