Free E-Course: Create an online document library
This page contains a complete online course created by Barn2's Co-Founder Katie Keith. It will teach you everything you need to know about how to add a document library to any website - either as a standalone website or intranet, or as part of your main company website.
- No technical expertise needed.
- We'll use the free WordPress content management system, plus the Document Library Pro plugin.
- Fully featured, with everything you need for a document library. You'll learn how to set up your overall WordPress website, add and import documents, list them in a searchable database, manage documents, make them private, and add multimedia content such as embedded audio and video.
- Ideal for people in charge of their company website, or web developers working on behalf of clients.
With nearly an hour of video tutorials, plus full written instructions (and a certificate at the end!), you'll be ready to start listing documents today.
Lesson 1: About this course - You're in the right place!
Welcome to the free e-course on how to create an online document library. This course is for you if you want to create a document library where people can search for files and access documents online, whether they are:
- Downloadable documents
- Documents embedded into your website
- Documents on a third party website such as Dropbox or Office 365
You'll learn every step of the process including how to set up a WordPress website (if you don't already have one), or how to add a document library to your existing company website.
If you're already using WordPress then you can skip the 'Getting Started' section of the course, and skip straight to the lessons about adding the document library.
The document library is really flexible and I'll talk you through the different ways that you can add and display documents. I'll also tell you about some extra tools that you can use to enhance your document library further, such as making it private so that only certain people can access it.
Let's get started - I hope you enjoy the course.
Co-Founder, Barn2 Plugins
Lesson 2: Create a basic WordPress website
To do this course, you need a WordPress website. If you already have one then you can click 'Mark Complete' and skip straight to the next lesson - or if you don't have a website yet, keep watching.
In case you don't know, WordPress is a platform for building website. It's the biggest web building platform in the world, and about 1/3 of all websites globally are powered by WordPress.
WordPress makes it really easy for you to manage your website because you can easily add pages and other content without needing any technical knowledge. That's why WordPress is an excellent basis for any type of website.
Instead of showing you how to install WordPress directly, I'll recommend a web host which will come with WordPress pre-installed on it. That makes it a bit easier for you. This lesson is about buying a domain name, which will be your website address, and adding a web host that has WordPress on it.
1. Buy a domain name
Your domain name is your website address. If you already own one then you can edit the DNS settings for your existing domain name and point it to your WordPress website so that when people type that into their web browsers or look for it on the internet, then they will view your website with the online ordering that you have set up on it.
If you haven't got a domain name yet, then you can go to any website that sells domain names such as Namecheap.
2. Sign up for web hosting
Once you've got a domain name, you also need web hosting. This actually keeps your website on the internet. We recommend a manage WordPress host called Kinsta, which we use for all the Barn2 websites. Kinsta is great because it makes everything easy for you. It automatically installs WordPress for you and it has loads of extra features like:
- Daily backups, so you can very easily roll back to your latest backup if anything ever goes wrong.
- Free staging sites where you can test out any changes without affecting your live site.
Kinsta has various plans. Most people doing this course would be fine with their Starter plan which is just $30/month. If you want to go even cheaper then there are cheaper hosts, and we would recommend Siteground. However, with a managed host like Kinsta that specializes in WordPress, the whole process will be easier for you and your website will load faster and generally be more reliable and easier to manage. Standard hosts like Siteground are perfectly good and will keep your website online no problem, but I would say go for Kinsta because it's that much easier for you. That's why we use them.
Sign up to a hosting plan with Kinsta and once you've done that, they will give you a Dashboard. If you're using a different host then just follow their instructions. This is how to do it in Kinsta.
3. Create a WordPress site
- In the Kinsta Dashboard, click on the 'Sites' link on the left, and then on the 'Add Site' button in the top right corner.
- This opens a window which you'll use to create the general settings for your website, and also install WordPress:
- Leave the 'Install WordPress' option ticket and this will install WordPress for you.
- If you already have a domain name then enter it there, for example mywebsite.com. If not, don't worry - Kinsta will create a temporary website address for you and you can get a proper one later.
- Add a website name.
- Choose the location that is nearest to where your customers are based. For example, if you're in the UK and targeting the US market then you should choose a US data center. If you're in the UK and targeting the UK market then choose 'London, UK' and so on. This affects the speed of your website. If the website data center that stores the data for your website is nearer to your customers then it will load more quickly.
- The WordPress site title, username and password are only used for you to load into the WordPress Dashboard and won't be seen by your customers. You will use the username and password to log into the WordPress admin area.
- Enter your email address, which will be used for admin-related notifications such as new comments if you have comments enabled on your site; information about errors; etc.
- Choose a language.
- Ignore the multisite option unless you specifically want that.
- Ignore the 'Install WooCommerce' option because we will do that later in the course along with some extra steps to make it easier for you.
- Tick 'Install Yoast SEO' because this will help with your search engine position.
- Next click 'Add Site'. Kinsta will then set up your website, which will then appear on your list of sites.
- Now, click on the site in the Kinsta Dashboard. This displays information about the website. You don't need to know most of this, but if you already have a website address then you'll need to add a domain to the 'Domains' section, if you didn't do this in the setup process.
- You need to point your domain name to the website in order for it to work at that address. To do that, go into the 'Info' tab in Kinsta and copy the Site IP Address to the clipboard. You need to enter this into the DNS settings for your domain. I recommend that you look at the documentation or ask for help from your domain name company to find out exactly what the record should say. Tell them that you want to point your name to the website at the IP address you just copied. They will help you to get this set up so that when people visit it, that domain name will show your website.
4. Log into the WordPress admin
To log into your WordPress website, go to your domain name followed by /wp-admin, for example https://mywebsite.co.uk/wp-admin. If you don't have a domain yet, then you can find the temporary website address in the 'Domains' section of Kinsta. You should then enter the username and password that you chose when you created the site a minute ago. You can then start adding information to your website!
Lesson 3: Choose a theme
Once you've got your overall WordPress website setup, it's time to install a theme. If you've already got a theme set up on your website, then you can click 'Mark Complete' and skip to the next lesson, otherwise keep reading.
A WordPress theme controls how your website looks. There are thousands of themes available, and you can use any theme that is listed as being compatible with WooCommerce.
For this course, I'm going to use the free Storefront theme which is the official theme from the company behind WooCommerce itself. It's really good because it has the features you need without any extra bulk or unnecessary features to confuse you. It's a nice clean design and we use it for all our plugin demos. If you like the idea of Storefront but don't know how it looks then you can use one of its child themes to change the design. Alternatively, you can go to any theme company website or a marketplace like ThemeForest, and get a theme from there.
You can use any theme you want. Find one you like the look of, and use that. Whatever theme you choose, it will work with everything else in this course. Just make sure it says that it's compatible with WooCommerce. Most themes are, but it's worth making sure.
Install a theme
- Log into the WordPress admin for your website.
- Go to Appearance → Themes and click 'Add New'.
- You'll see an 'Upload Theme' option. If you bought a premium theme, then upload the zip file here. Otherwise, type the name of the free theme that you want to search for, e.g. 'Storefront'.
- Click 'Install' and then 'Activate'.
- When you go to the front end of your website, you'll see a very basic version of the theme. You can then customize it. Most themes either have a theme options panel in the WordPress admin, or you can customize it under Appearance → Customize.
- For the Storefront theme which I'm using for this course, there are lots of options in the Customizer. You can go through each section and configure them as needed, for example adding your company name to appear at the top of your website or uploading a logo; uploading a site icon which will appear at the top of the browser tab; changing details such as the header, link and button color to match your company branding.
Save your changes. In the next lesson, we'll start creating pages and a menu to go across the top of the website.
Lesson 4: Add your main pages and menu
Next I'm going to show you how to create the basic navigation structure for your website, before we start adding more advanced features such as online ordering. In WordPress it's really easy to add content to your website. You can do really nice things with text, images and different layouts just using WordPress as it comes.
- In the WordPress admin for your website, go to Pages → Add New.
- Add a title to the top of the page.
- Add some content which will appear on the page. You can use the Gutenberg editor, which is the name of the page builder that comes with WordPress itself. You can use this to add lots of different types of blocks and common layouts such as headings, paragraph text, images, bullet lists, multiple column layouts, and more. To add a block, click the little + icon and choose from the different options.
- Publish your page in the top right hand corner, and then click 'View Page' to check it on the front end of your website.
- To set the page as your homepage, go to Settings → Reading and select it as the homepage from the list of static pages.
- Also on Settings → Reading, it's a good idea to temporarily tick the 'Search Engine Visibility' box to hide the site from search engines while you're working on this. However, it is essential that you remember to disable this when the site goes live!
- Go to Pages → Add New and continue adding as many pages as you like, for example your 'About' and 'Contact' pages.
Add a navigation menu
When you've added some pages, it's time to add a navigation menu which will allow people to find their way around your website. Most themes display this across the top, but some display it elsewhere such as on the left hand side.
- Go to Appearance → Themes.
- Click 'Create Menu' and select the display location to make sure it appears in the correct place on your website. Your theme may have multiple locations where menus can appear.
- You will see a list of pages on the left. Select the ones that you want to add to the menu, and click 'Add to Menu'. This will move them to the right.
- On the right, drag and drop to re-order the items in your menu. You can also indent menu items under other menu items to create dropdown lists in your menu.
- Once you've installed WooCommerce later in this course, you will be able to see more options on the left so that you can add products, categories etc. to the menu.
- Click 'Save Menu' to publish it on your site, then view your website to see what it looks like.
As we go through the course, we'll start adding more links to your menu so that it grows over time and creates a comprehensive navigation structure for your website.
Create your document library
Lesson 5: Install Document Library Pro
Once you've got your overall WordPress website set up, it's time to start adding a document library to it. I'll show you how to do that now. We'll need the Document Library Pro plugin for this.
- Buy the plugin, then check your email.
- Download the plugin zip file from the email, and copy the license key to your clipboard.
- In the WordPress admin, go to Plugins → Add New and click 'Upload plugin'. Select the zip file that you downloaded from the email.
- Click 'Activate Plugin'.
- Go to the plugin settings page at Documents → Settings.
- Paste the license key that you copied in step 2, and click 'Activate'.
- Document fields:
- On the 'General' tab at Documents → Settings, you can choose which data you want to store about each document. Adding documents in Document Library Pro is very similar to adding pages and posts, and each document comes with all the standard fields such as the title, featured image, content and excerpt. Some of these are optional, so you can untick any that you don't want to use.
- If you like, then you can also create custom fields and taxonomies for storing extra data about each document. For example, you could create a 'Publisher' field.
- On the 'Document Libraries' tab at Documents → Settings, you can choose how your documents are displayed in the front end of your website. You can see documentation for an explanation of each setting. For now, I will explain the most important options:
- Folders - Choose whether to list all your documents in a single table, or whether to structure them into collapsible folders based on their category.
- Columns - You can choose which columns of information to include in the documentation. Find the full list of available columns here.
- Document links - These settings let you control how people will access your documents, for example whether to include a button, text link or file type icon in the 'link' column of the document library. You can read about all the link options here.
- Lazy load - Enable lazy load if you have lots of documents in each table on your site. This prevents any performance problems, so you can list many thousands of documents without any issues.
- Search filters - You can have multiple filter dropdowns above the document library table, which people can use to quickly find particular documents based on information such as categories and tags. I recommend adding filters if you have lots of documents, and hiding them if you have a smaller number.
- Design - The document library automatically adapts to suit your theme and looks good out of the box. If you want to customize it further then these options allow you to change details such as the colors and borders.
- Once you have finished, click 'Save' at the bottom of the page.
In the next lesson, you'll learn how to start adding documents - either by adding the manually, or by importing them in bulk.
Lesson 6: Adding & importing documents
Once you've installed the Document Library Pro, plugin, it's time to start adding documents. There are several ways to do this, to make it as easy as possible for you. You can:
- Add each document manually along with all the data you wish to display about that document.
- Select existing files from the WordPress Media Library (e.g. PDF's, Word documents or any file type), and convert them into documents to display in the library.
- Use drag and drop to upload multiple files at once and automatically convert them into documents.
- Prepare a CSV file using any spreadsheet software such as Microsoft Excel, add all the data about the documents, and upload them to your document library.
But before we start adding documents, we need to think about how to organize our document library in the first place. We can do this with categories and tags.
At the most simple level, you can take a fixed percentage discount off the price for every product. This is done per role:
- Go to Documents → Categories in the WordPress admin.
- Add as many categories as you like - just add the name (which will appear on your website) and the slug (which will be used behind the scenes).
- To create multi-level or nested category structures, select another category as the 'Parent' category.
You can also organize documents using tags. For example, you might use tags to allow users to filter by the type of document, such as 'Spreadsheets', 'Videos', etc. You can add tags directly on the 'Add Document' page, or you can add them centrally like this:
- Go to Documents → Categories in the WordPress admin.
- Add as many tags as you like. You will then be able to select them when adding and importing documents.
Add documents manually
This is probably the most common way to add documents:
- Go to Documents → Add New.
- Add the document title.
- Add some content in the big field below the title. This will appear on the single document page if you're using that, and it will also appear in the 'content' column of your document library if you are using this column. This is a really useful space because you can add any type of content here. You can add text, images, and embed other types of content such as YouTube videos or audio players.
- Add a summary if you are including an 'excerpt' column in the document library.
- Select categories and tags, as required.
- Document link - there are 3 options:
- Leave this set to 'None' if you are using the content field to display the full content or an embed of the document.
- Choose 'File upload' if you want users to be able to download the document to their computer. You can then upload a file of any type which is supported by your WordPress installation. (Ask your web host if you need to add files that aren't currently supported.)
- Select 'Custom URL' if you want to link to another website, for example if you're linking to another web page or if you're hosting a document externally, such as on Dropbox or Office 365.
- File size - Once you have saved or published the page, then the file size will be calculated automatically if you have used the 'File upload' link option. If you are linking to external documents then you can add the file size manually.
- Featured image - This appears in the 'image' column of the document library if you have added this column, and in the right hand column of the single document page. Most document libraries don't use images in this way, but you can use it to display an image or custom icon if you wish to do so.
Finally, click 'Publish' to add the document to your library.
Converting Media Library files into documents
All the documents which can appear in the library are listed in the 'Documents' section of the WordPress admin. If you already have files in the WordPress Media Library that you wish to include in the document library, then you can easily convert them into documents:
- Go to the 'Media' section of the WordPress admin.
- Make sure you're on the list view and not the grid view. To switch views, use the blue/grey icons to the top left of the list of media files.
- Tick the checkboxes to select the files that you want to add to the document library.
- Open the 'Bulk actions' dropdown and click 'Add to document library'.
- You will then see a success message with a link. Click on this to view them in the list of Documents. You might want to edit each document to add extra data and change the filenames to something more readable.
Drag and drop files to the document library
- Go to Documents → Import.
- You'll see the drag and drop file upload at the top of the page. Either drag and drop files from your computer into this space, or click to browse for the files you wish to upload.
- Once you have uploaded the files, you can view them in the 'Documents' section of the WordPress admin. Again, you might want to edit each document to add extra data and change the filenames to something more readable.
Upload documents in bulk from CSV
This is the most advanced way to add documents, but it is also an excellent time-saver if you have a large number of documents to import. If you've got up to a couple of dozen then I'd generally recommend adding them using one of the other methods, but if you have 100's, or 1,000's of documents then you should definitely use the CSV method. As well as allowing you to upload the files easily, it lets you add all the data about each document so you don't have to manually add the document name, content, excerpt, etc.
- Go to Documents → Import.
- Click the 'Import CSV' button.
- Select a CSV file. (Use the sample CSV from the plugin knowledge base to find details of the required format for your CSV file.)
- On the next screen, select how each column from your CSV file should map to the fields in the document library. If you use our sample CSV file then it will probably guess these correctly, and you can make any changes to make sure it is right.
- Run the importer.
- Finally, view your documents to make sure everything has imported correctly.
In the next lesson, you'll learn how to list documents in the front end of your website.
Lesson 7: Displaying documents
Once you've installed the Document Library Pro plugin and started adding documents, you can list them on the front end of your website - whether this is just for staff members and colleagues to see, or for the wider plugin.
The default Document Library page
When you installed the plugin, a page was created for you. To find it, go to 'Pages' in the WordPress admin, find the page called 'Document Library' and click 'View'. By default, the page will list your documents with the settings that you chose on the Document Library Pro settings page. Depending on your settings, the documents will be listed in either a table or grid layout:
You can go back to the settings page and make changes to get your document library exactly how you want it. You might also want to make some changes to the wider setup of the Document Library page. For example, if your theme has added a left or right sidebar then you may wish to change to a full width template to allow more room for the documents. You can find out how to do this by checking the documentation for your WordPress theme.
If you go to the 'Edit' screen for your main Document Library page, then you'll see that a shortcode has been added to the page: [doc_library]
This lists all your documents by default. You can add the shortcode anywhere you like on your site - not just to this one page. You can also edit the shortcode to create multiple tables, each one listing different documents.
For example, you could create a different table for each category, with the category name as a heading above. To do that, you add the category option to the shortcode: [doc_library category="finance"]
This is useful if you want to create multiple document libraries, for example to list different documents on different pages of your site.
Use the plugin documentation to learn about all the shortcode options which you can use to customize each individual table on your site.
Lesson 8: Restricting access to the document library
When you have an online document library, you might want some control over who can access the documents.
Some document libraries are open to the public, and they might list information such as publications, resources, documentation, or other types of document that everyone can see on your main company website. Other document libraries are more private, for example part of an intranet which only staff and people within an organization can access.
In this lesson, you will learn how to restrict parts of your document library, or how to make your entire document library private. When you use Document Library Pro to create your document library, you can use it with various other plugins to restrict access. These aren't built into the plugin because it depends on your requirements. There are many different access restriction WordPress plugin that you can use alongside your document library. These are all discussed in our knowledge base article. This shows you how to:
Create a completely private website
Imagine that you want to have a website that is only used for the document library. You're not using it as your main company website - you've just created a WordPress site and added a document library to it. To do this, I recommend using the free Password Protected plugin. This makes it really easy to create a completely private website.
- In the WordPress admin, go to Plugins > Add New.
- Choose a password.
- Give the password to everyone who needs to access your document library website.
Hide some or all of your document categories
You can also hide categories in your document libraries, either using password protection or user login. I'll explain what these two options mean:
- Password protection - This means giving people a password which they can use to unlock either parts of or the whole document library. They don't need an account on your website - they just have the password. You can create one or more passwords to give to your users.
- User login - If each user has their own account - i.e. their own unique username and password - then you can avoid making them enter multiple passwords by automatically unlocking the protected categories when they log into their account.
You can do both these things with the Password Protected Categories plugin. This is another Barn2 plugin and works well with Document Library Pro. It lets you create protected categories for your documents. You can put some or all of your documents within a protected category so that only people with the right credentials can access them.
Setting up Password Protected Categories
- Get the Password Protected Categories plugin.
- Copy your license key and download the plugin zip file from the confirmation email.
- In the WordPress admin, go to Plugins → Add New, upload the plugin zip file and activate the plugin.
- Now go to Settings → Protected categories and activate your license key.
- You might want to leave the 'Show protected categories' option unticked in order to fully hide the protected categories and their documents from the public parts of the site. However, if you want to list documents publicly but only allow specific people to be able to access the single document page or download them, then you can enable this option.
- If you're planning to use password protection instead of individual user accounts, then you can edit the 'Login Form' options as needed. (If you're not using password protection then you can ignore these because with user login, users will log into their account using the built-in WordPress login form instead.)
- Click 'Save Changes'.
- Go to Documents → Categories and add or edit a category. Now you'll see some visibility options, which have been added by the Password Protected Categories plugin. Edit each category that you wish to protect and set one of the following visibility options:
- Password protected - Add one or more passwords.
- Private - Private categories use the WordPress function which allows you to make pages or posts private. The Password Protected Categories plugin has simply extended this to categories. When you mark a category as private, it (and its documents) will only be visible to people who are logged into their account and have a user role which has access to private content. By default, this is Administrators and Editors. If you're using private categories then you will probably want to extend this to other roles, which you can easily do by installing the free User Role Editor plugin. For example, you could give people with a 'Subscriber' role the ability to view private content. You could also create a dedicated role (e.g. 'Staff') for people who will access the private documents.
As you can see, it's easy to restrict access to your documents. Document Library Pro also works with most WordPress membership plugins, such as Advanced Access Manager. For example, if you wanted different logic, or if you already have a private area on your website that was created using a particular membership plugin, then this is likely to work with the document library too.
Lesson 9: Embedding audio & video
When you're using the Document Library Pro plugin to create an online document library, you don't just have to list documents - you can list any type of restrict. You also don't just have to provide downloadable documents. Instead, you can add documents with links to third party websites (e.g. if they're hosted on a site like Dropbox or YouTube); and you can embed them directly into your website depending on the file type.
In this lesson, I will show you how to create an audio or video library using the Document Library Pro plugin, with embedded audio and video which people can watch and listen to directly on your website.
You can either do this instead - or in addition to - allowing people to click a button to download the audio/video file. This is a great option if you want people to be able to watch or listen to multimedia content online without being able to download it.
- Go to Settings → Document Library and enable the 'Shortcodes' option. This tells your document library to render any content such as audio and video players which you are embedding in the list of documents.
- Scroll to the end of the page and click 'Save changes'.
- Now Add or Edit a document that you want to add an embedded audio or video player to. To show you how to do both, I will show you how to embed an audio file which is hosted directly on your website; and a video file which is hosted on YouTube:
- On the 'Add/Edit Document' screen, go to the main content field and click the 'Add Media' button. (Note: If you're using a different page builder such as the Gutenberg editor or a plugin like Divi Builder or Elementor, then you can add an audio or shortcode block instead.)
- Upload an audio file, such as an MP3.
- Click 'Open' and then 'Insert into document'.
- WordPress will automatically convert the file into a fully functional audio player. When you view the single document page, you will see the audio player in the main content area.
- If you want people to be able to download the audio file to their computer, then you should also use the 'Document link' option to select the audio file.
- I recommend hosting videos on a third party video hosting services such as YouTube or Vimeo because this saves space on your web hosting account, and is also more accessible because they will automatically convert the videos to the correct format for each user's device.
- Go to YouTube/Vimeo and copy the URL of the video.
- In the WordPress admin, Add/Edit a document and paste the video URL onto a new line within the main content field, and then press Enter. WordPress will convert this into a proper video player.
- If you like, then you can also add the video URL to the 'Document link' field so that people can easily click through to view the video on YouTube/Vimeo.
- Click 'Update'. When you view the single document page, you will see the video player in the main content area.
- If your document library includes a 'content' column then the embedded audio and video players will also appear within the 'content' column of the table of documents.
You can read more about how to do this in the plugin knowledge base.
Lesson 10: Managing the document library
Once you've got a document library, you'll want to make changes over time - for example, to update documents, add new documents, and generally to keep it organised.
The 'Documents' section of the WordPress admin lists all your documents. You can easily click on any document and edit it, in exactly the same way as when you edit pages or posts in WordPress. Change any of the documentation as required and click 'Update'. This will immediately update your front end document library, so the changes will go live in real time.
Replacing downloadable files
If you want to replace a file, there are two ways to do this:
Upload a new file
On the 'Edit Document' page, you can simply upload a new file which will be used as the document link. The original file will remain in the WordPress Media Library, but will no longer be linked from the document library.
If you will be updating documents regularly or are concerned about version control, then you might want a way to physically replace/overwrite the original file. You can do this with a free plugin called Enable Media Replace.
- Go to Plugins → Add New.
- Search for 'Enable Media Replace'.
- Install and Activate the plugin.
- Now go to the 'Media' section of the WordPress admin and find the file that you want to update. Click on it.
- You will see a 'Replace' button. Click on this and follow the on-screen instructions to overwrite the original file with the new one.
- You don't need to make any changes to the document in the 'Documents' section of the WordPress admin. The download link will be updated automatically.
This means that you will only have one version of the file in the Media Library. As a result, you can avoid any confusion in future. It also helps to save space on your web host.
Categories and tags
I recommend regularly updating your document categories and tags. This helps to ensure that it is easy to find documents as you add more and more to the library. This will keep it well organized well into the future.
Further reading: Learn more about managing documents.
Conclusion and next steps
And that's it! Congratulations on completing the course on how to build a document library in WordPress. You can download a certificate from this link (please note that the certificate is just for fun and is not certified by any official training bodies).
You've learned how to:
- Set up a complete website in case you didn't have one already.
- Install the Document Library Pro plugin.
- Add documents and display them on your website for people to see.
The next step is to put everything from this course into practice and set up your own document library. For further information on extra things you can do that weren't covered in the course, you can look at the plugin knowledge base and documentation.
If you have any questions, feel free to get in touch. We offer full support with all our plugins.
When you're ready, get Document Library Pro and start setting it up!