How to upload and manage PDF files in WordPress
Are you looking for an easy way to upload PDF files to WordPress and display them on your website? In this tutorial, I'll take you through a step-by-step guide on how to add PDFs to WordPress and display them in a searchable library on your site, complete with embedded PDFs.
Did you know that around 73 million new PDFs are saved daily? While WordPress itself provides ways to upload PDFs to WordPress, not everyone knows how to use them. The built-in methods are also only suitable for displaying on PDF file at a time.
For sites that need to upload multiple PDFs, it's better to install a plugin that provides better ways to add PDF files to WordPress and display them in a searchable format on the front end.
Keep reading to learn how to use the Document Library Pro plugin to build simple or extensive WordPress PDF libraries. You'll discover how to:
- Add PDF to WordPress either individually, via drag and drop, or via bulk upload from a CSV file.
- Create a searchable, filterable WordPress PDF library for your website visitors or team members.
- Embed PDF's into your PDF library so that people can read them online without having to download anything.
- Structure PDFs into categories and tags for easy management.
- Enable version control for your uploaded PDFs.
- Store PDF files in the WordPress Media Library or on a third party system like Dropbox or Google Drive.
- I'll also tell you how to upload individual PDFs to WordPress without a plugin.
The end result will look something like this:
Before jumping into the step-by-step guide, let’s first answer this question:
Why upload PDFs to WordPress?
PDFs are the perfect format to share files with your website visitors. That's because they work on any device, unlike other formats like Word or PowerPoint. As a result, it makes perfect sense to add PDFs to WordPress and display them on your website.
When we talk about how to upload PDF to WordPress, we need to make it clear where the PDFs will be stored. There are two options for this:
- Upload PDFs to the WordPress Media Library. This means that they will be stored in the uploads folder of your main web hosting account.
- Add PDFs to a third party file hosting server such as Dropbox, OneDrive, Google Drive or Amazon S2. This is a good option if your PDFs are already hosted outside of WordPress, or if you don't have much space on your web hosting account.
The benefits of uploading PDFs to WordPress are the same wherever you store them behind the scenes. The instructions in this tutorial for managing and displaying PDF files will work for both methods.
The only consideration is that if the PDFs are hosted elsewhere, the users won’t be able to see them in a lightbox or the PDF viewer. Lightbox preview is only possible when you upload PDFs to the WordPress Media Library, so your users will have to download the PDFs instead.
Method 1: How to upload PDF files in WordPress without a plugin
If you just have 1 or 2 PDF files to upload to WordPress, then you can do this without a plugin. These can either appear as basic text links or embedded PDF files within the content of a page or post.
If you need an organized way to display multiple PDFs then I recommend using the Document Library Pro plugin. We'll cover this in Method 2 of this tutorial.
How to embed an individual PDF in a WordPress page or post
- Go to edit any page or post on your WordPress site which uses the block editor.
- Click the + icon and find the 'File' block.
- Click 'Upload' and add the PDF to WordPress.
Tip: If you're not using the Gutenberg block editor, then your chosen page builder plugin (e.g. Elementor or Divi Builder) will have a similar option. For example, when you're creating an Elementor PDF viewer then you need to use an Elementor shortcode block. It might have a different name in other page builders.
How to add a PDF to WordPress as a text link
If you don't want to fully embed the PDF, then you can add it as a basic text link instead:
- First, go to Media → Add New in the WordPress Dashboard and upload the file to WordPress.
- Copy the PDF's 'File URL' to your clipboard.
- Now edit the page or post that you want to link to the PDF from.
- In the body of the page or post, type the text that you want to turn into a link, highlight it, and use the 'Insert/edit link' icon to add the link. For the link URL, paste the URL of the PDF file that you copied in step 2.
This will add the PDF as a normal text link in your WordPress page or post.
As you can see, these no-plugin methods are best for displaying individual PDF files. In contrast, Method 2 is designed for displaying multiple PDFs. We'll get to this next.
Method 2: Upload PDFs to a searchable, viewable PDF library
Now we've discovered the benefits of uploading PDF's to WordPress and where to store them, I'll tell you how to do it from start to finish.
We'll do it using the Document Library Pro plugin. This robust WordPress PDF plugin comes with various features that can help you manage your PDF library in the most efficient way.
On top of making things more organized for admins, Document Library Pro gives you huge flexibility in how to list PDF files in the WordPress front end. You can choose from a structured table or an eye-catching grid layout for displaying the PDF's.
Displaying embedded PDFs
You can also embed the uploaded PDFs directly onto the page in WordPress. Document Library Pro does this automatically if you enable the 'Preview' buttons. These display an embedded version of the PDF in the user's browser. That way, people can view the uploaded PDF's without having to download them to their computer:
Alternatively, if you want to prevent people from downloading the PDF then you can embed them using the free PDF Embedder plugin. These appear on the single document page when people click on a link to a PDF in the library:
What else can the PDF upload plugin do?
As well as displaying and embedding PDF's, Document Library Pro has lots more features for managing and showcasing your files:
- 5 ways to upload PDF to WordPress - individually, selecting existing PDFs from the WordPress Media Library, drag and drop upload, bulk CSV upload, and via a front end PDF upload form.
- Along with PDF files, you can upload and manage other file formats such as jpegs, docs, gifs, PDFs, audio files, and dozens of other file formats.
- Manage all your documents (including WordPress PDFs) directly from your website's admin dashboard.
- Super flexible with 50+ customization options such as show/hide download button, links, document previews, and document download analytics.
- Let your customers sort, filter, and search the tables to locate the PDF file they are looking for in seconds.
- Structure the uploaded PDF's into folders to make the library easy to navigate. You can list the uploaded PDF's in a folder structure just like on your computer. The filter dropdowns and keyword search also make it easy to find PDFs in WordPress.
Setup tutorial: Upload PDFs to a viewable PDF library
Installing the Document Library Pro PDF plugin
Before you can start setting up Document Library Pro, you need to purchase and download it. You can then install it:
- In your WordPress admin dashboard, go to Plugins → Add New → Upload Plugin.
- Upload the .zip file you downloaded earlier and install it. After installation is completed, click on the Activate button.
- The plugin setup wizard will open automatically. Use this to activate your license key and choose the main settings for displaying your PDFs. There are lots of options, and here are the main ones to configure before uploading PDF files:
- Layout - You get two layouts to choose from, Table and Grid. Depending on your requirements, you can choose the layout. I recommend going with the table layout if you plan to add lots of PDF files to your library.
- Folders - This option enables the folders structure to make navigation and sorting more organized.
- Columns - Select the columns you want to have on your PDF table. There are multiple columns to select from, and you can even rename the columns if required.
- Download and preview links - Enable the download links if you want people to be able to download each PDF. Alternatively (or as well!), the preview buttons allow people to view embedded PDFs in their browser without having to download them.
- Link style and destination - The link style defines how the clickable link column is displayed on the website, and the destination tells what happens when someone clicks on a link to a PDF or a document.
- Sorting and Search box- For improved navigation, you can use the sort and search box feature to help users find documents quickly.
Now you're all set! Next, we can start adding WordPress PDFs.
Structuring your WordPress PDFs library
Before you can start uploading PDFs, I recommend that you use categories and tags to build a scalable structure for your WordPress PDFs.
PDF categories
Document categories work just like WordPress post categories. You can create a hierarchical structure for categories and subcategories depending on their nature.
To create a new category, follow these steps:
- Go to Documents → Categories. You can add a new category on the left, and all the existing categories are listed on the right.
- To add a new category, type in your category name and slug. If you want this to be a subcategory, select the parent category from the dropdown list.
- Give your category a short description and set the visibility.
- Finally, hit the Add New Category button.
- Repeat the steps to add more WordPress PDF categories.
Restricting access: If you wish to restrict the category from certain users, you can use the Protected or Private visibility option. All subcategories and PDF files within the category will inherit the same protection. This option is powered by the Password Protected Categories plugin is designed to work alongside Document Library Pro. If you wish to use this feature, you can get the two plugin bundle for a discounted price.
Tagging PDFs
Just like adding tags to blog posts, you can add tags to PDF uploads. You can then fetch the PDF or document files with the same tag or label. For example, you can add tags such as publisher, publish month, niche, interests, or anything else and display or embed PDF files with the same tags using the shortcode.
To add new tags for PDF files and other documents, follow these steps:
- Go to Documents → Tags. You can find all the existing tags on the right.
- To add a new tag, type in your tag name, slug, and tag description.
- Click on the Add New Tag button. Your newly added tag will start showing up in the table on the right.
- Repeat the above steps to add more tags.
Additionally, if you want more control over your PDF library structure, you can create custom taxonomies to further group your PDFs. For example, you can use the built-in Author taxonomy to group the files with the name of document authors. You can also add a search function to make navigation easier.
Now once you have your categories and tags structure in place, you can start uploading WordPress PDFs to Document Library Pro.
How to upload PDF files to the WordPress PDF library
There are five different ways you can upload PDFs to WordPress. All of them are pretty easy, and you can go with the method that works best for you:
- Create documents individually and either upload the PDF directly or link to a PDF hosted elsewhere.
- Select PDF files from the Media Library.
- Drag and drop PDF files.
- Bulk PDF files CSV upload.
- Front end PDF upload form.
Let’s check each method in more detail.
Method 1: Create PDF documents individually
This method lets you upload a single PDF to your website at a time. Here’s how you can do it.
- Go to Documents → Add New.
- Fill in all the relevant details. Enter the document name, description, slug, and featured image, and select from the list of categories and tags.
- To upload a PDF to the WordPress Media Library, select the Document Link at the top right corner as File Upload. Now click on the Add File button and go to Upload Files → Select Files. Choose the PDF file you wish to upload and click on Add File button.
- Alternatively, select the Document Link at the top right corner as File URL. Then paste the URL of wherever the PDF file is hosted.
Method 2: Link to PDF hosted externally
If you do not wish to upload PDFs to WordPress site, you can host it externally, such as Google Docs or Dropbox, and add a link to your document library. Here’s how you can do this:
- First, go to Documents → Add New.
- Just like the previous method, add all the relevant details such as tags, categories, name, slug, etc.
- Select the Document Link at the top right corner and select a custom URL from the dropdown.
- Paste the live link to the PDF and publish the document.
Do keep in mind that if the file isn’t hosted on the website, your users won’t be able to preview it before downloading.
Method 3: Select PDF files from the media library
If you already have PDF files hosted on your website in the media library, you can follow this method to add them to the Document Library. Here’s how you can do this:
- Go to your WordPress Media Library.
- Switch to List view and select the PDFs you wish to add to your WordPress PDF library.
- From the Bulk Actions dropdown, select Add to document library and click Apply. All the selected PDFs will be imported successfully.
- Since you might need to add tags, categories, and other details for the newly imported PDFs, click on the link at the top to review and update recently imported WordPress PDFs.
Method 4: Drag and drop PDF files
If you wish to upload multiple PDF files simultaneously, you can use the drag and drop method. Here’s how you can do this:
- Go to Documents → Import.
- Select the PDF files you wish to import from your PC or desktop.
- Drag and drop the PDFs on the Import page → Drop files to upload area.
- Go to the All Documents section to make changes to the PDFs that you uploaded to WordPress individually.
Method 5: Upload PDFs to WordPress in bulk via CSV import
This is a slightly more advanced way of uploading PDFs to WordPress, but it's also the best for adding in bulk. It involves creating a CSV file containing all the details for multiple PDF files.
Here’s how you can use this approach:
- First, make sure you have already added all the PDFs to the WordPress Media Library or wherever else you plan to host them. Copy the URL for each PDF for step 2.
- Create a new CSV file with a list of all the details of the PDFs, such as PDF URL, category, tags, document authors, etc. If you’ve added custom taxonomies, you can add new columns with the same taxonomies and map them later.
- Once you have your CSV ready, go to Documents → Import.
- Follow the on-screen steps to map the columns to your document library fields.
You can use this sample CSV file to upload PDFs to WordPress easily. This is what the CSV file should look like:
How to display WordPress PDFs on the frontend
Once you have your PDFs in your library, you can see them listed on the front end.
Document Library Pro creates a main document library page that lists all the documents in the library. To access this web page, go to Pages → Document Library page → View.
Alternatively, the plugin has a shortcode with various options for listing specific WordPress PDFs only. For example, if you want to display PDFs from the category ‘Fiction’ from the year 2024, you need to use this shortcode:
[doc_library doc_category="fiction" year="2024"]
Learn more about Document Library Pro shortcodes.
You may also like: How to add a file upload field to the product page in WooCommerce.
Embedding PDFs from the media library
So far, you've learned how to upload PDF files to WordPress and display them with download buttons. Before we finish, I'll share 2 ways to embed them directly into WordPress so that people don't need to download them:
- Method 1 - Use the built-in Preview buttonsDocument Library Pro comes with 'Preview' buttons which appear in the 'Link' section of the library. Simply enable these on the settings page at Documents → Settings so that people can click to view the PDF embedded in their browser. You can also disable the download buttons here.
- Method 2 - Use the PDF Embedder pluginYou can also embed the PDF file directly into an individual page for each document. That way, people can click on the name of a document in the library to view the page with the embedded PDF. Do this with the free PDF Embedder plugin. Once you've installed it, embed the PDF in the main content area for each document in the 'Documents' section of the WordPress admin.
- Method 3 - Embed PDFs without a pluginTo embed a PDF into WordPress without a plugin, add the following iframe code to an HTML or code block, replacing the URL with the correct location of your PDF. Put the code to the main content area of your document post, which you can access via the 'Documents' section of the WordPress admin.
<iframe src="https://yoursite.com/wp-content/uploads/2024/22/your-pdf-file.pdf" width="100%" height="600px"></iframe>
Case studies - See WordPress PDFs in action
International Arctic Research Center (IARC)
International Arctic Research Center has multiple lists of PDFs on their website. To make this more organized and structured, IARC uses the shortcode feature to list different categories of WordPress PDFs on multiple pages.
They use it to list reports, academic publications, previous research activities, and case studies on different pages.
Each PDF table is accompanied by a quick search box and filter dropdowns to help the viewers find their desired documents.
Just like IARC, you too can take control over displaying PDFs on your website with the Document Library Pro plugin.
NER Model Railroad Association
The Northeastern Region Model Railroad Association uses Document Library Pro to list multiple PDF files such as meeting minutes, monthly publications, and handbooks.
While they upload all PDFs to the WordPress Media Library, they are segmented with the help of PDF categories.
On the Documents page, NER has divided the WordPress PDFs into multiple categories. Users can sort the tables in ascending or descending order by clicking on the column headers. If they want to download multiple files, they can simply select the checkboxes and click the Download Selected Documents button.
Here's what NER had to say:
Like NER Model Railroad Association, you can also set up Document Library Pro and upload PDFs to WordPress in no time. I'll tell you how to do that next.
Further reading: A guide to uploading files to WordPress.
The best WordPress PDF plugin
With the Document Library Pro plugin, you can easily upload, set up, and manage your PDF library in no time. Not just PDFs, you can host and manage other files such as images, videos, and audio files.
- Easy setup process
- Seamlessly upload PDFs to WordPress
- Advanced shortcode functionality
- Perfect for non-developers and novice WordPress users
- Advanced control over WordPress PDFs behavior and functions
- Access to future updates and new features
- 30-day money back guarantee - try it risk-free!
I hope you found this tutorial useful. If you have any questions regarding this guide, please let me know in the comments section below!
FAQ
File size limits for uploading WordPress PDFs
WordPress itself doesn't impose any file size limit for the PDF's you upload. If you are seeing file size limits then I recommend asking your hosting company as they may have set a limit.
Troubleshooting PDF upload errors
Most web hosts support PDF files by default. If you get an error that the file type is not accepted then you need to ask your host to enable PDFs.
Are PDFs mobile responsive?
If your WordPress theme is mobile response (as nearly all themes are these days) then your PDF library and embedded PDFs should be responsive too. This means that they will automatically resize to fit the screen size, regardless of which device they are viewed on.