PDF files are one of the most popular formats used for online documents.
If you want to know how to add a PDF file and share it with your visitors, you came to the right place.
In this article, you’ll learn how to upload and embed a PDF file in your WordPress website.
Why Upload PDF to WordPress
As mention above, PDF is a trendy format and a common way to save documents.
There are many reasons to upload PDF files to your WordPress website, and here are only some of them:
- Display long articles or user manuals in a downloadable file.
- Send an eBook to users that subscribed to your email list.
- Gift the content to users who purchased membership to your website.
- Promote a click call-to-action engagement that will increase the size a visitor spend on your website. As a result, it will reduce the bounce rate and improve the overall SEO score.
Whatever the reason, uploading a PDF file to WordPress is a task that you should know how to do.
In the next section, I will show you how to upload PDF files in three ways: first through the media library, second to a specific blog post or page, and lastly, by using a plugin.
Upload PDF Files to WordPress
Upload PDF files to WordPress is a straightforward process, and you can do it in multiple ways.
Let’s start first by uploading PDF to the WordPress media library.
Upload PDF files to the Media Library
From the backend of your WordPress website, navigate to Media -> Library and click on the Add New button to add a new file.
Click on the select files button and drag your desired PDF file into the marked area.
Once the file is finished uploading, you’ll be able to access it by navigating to the file’s URL path.
When the PDF file is hosted on your server, you can add it to your opt-in offer for your email campaign.
On the other hand, keep reading if you would like to add it to any of your blog posts or pages.
Embed PDF in a Page or Post
Now that we have the PDF on our website, we should move forward and embed it on a page or a post.
The default pages or posts of WordPress are using the Gutenberg editor, while custom post types using the old editor. Let’s start with Gutenberg first.
PDF in Gutenberg
When editing a page or a post, you’ll have the option to upload and embed a PDF file into it using the right Gutenberg clock.
Click on the plus icon in your desired position to add a block.
First, type in and search for the file block. Then, click on it to add it to the content.
Next, choose if you would like to upload a new file or use the same PDF file you uploaded in the last section.
In this example, I’ll choose the file we uploaded earlier and click on select.
Once you selected the PDF file, it was embedded inside the page with a download it below it.
After updating the changes, revisit the page and verify that the download button is working as expected.
If you’re trying to upload the file to a custom post type, you won’t use the Gutenberg editor. Therefore, use the classic editor instead.
PDF in the classic editor
Uploading files to the classic editor is a similar process to the Gutenberg one.
While under the visual tab, click on the add media button, select your PDF file and click insert.
If you didn’t upload any file yet, drag it into the library.
Once inserted, WordPress will add the file to the content. Unlike the Gutenberg editor, the classic editor won’t embed it but add a download link instead.
After updating the page, revisit it and click on the download link to verify it’s working as expected.
If you would like to display PDF content in custom post types, we will need to use a dedicated plugin for that.
Embed PDF with a plugin
There are WordPress plugins for everything, and PDF files are no different.
To embed a PDF on any post type (including customs), we will need to use a plugin.
Navigate to Plugins -> Add New and install the PDF Embedder plugin.
Once activated, open the page where you would like to display the file and click on the add media button.
In our example, we will use the same WooCommerce product that we used earlier.
This time, after selecting and inserting the file, it will be added to the content as a shortcode.
Then, revisit the page and make sure the plugin embedded the PDF file successfully.
Create a Downloadable Link
If you would only like to create a download link of the file instead of displaying it, you can do that with simple HTML.
Creating a download link is very useful when you want to add a download link to your email campaign.
Switch to the visual tab of the editor and create a link tag with the PDF file path.
<a href="LINK GOES HERE">Download PDF</a>
Make sure to replace the LINK GOES HERE with the actual address of the file.
Then, add the download attribute into the tag to make it downloadable.
The complete code will look like that:
<a href="LINK GOES HERE" download>Download PDF</a>
Now, when visiting the page, you’ll be able to click on the link and download the file to your computer.
In this article, you learned how to embed a PDF file in your WordPress website.
Leave us a comment and let us know which methods you used to achieve this task.