Are you looking to embed a PDF file in WordPress but can’t find a solution online? Don’t worry, I am here with a guide on how you can embed PDF files in posts or pages.
Embedding a PDF file can be very helpful for you as it allows you to display your content to visitors. For example, you can share your courses or eBooks by embedding them on your website. The website visitors can view, download, and print these PDF files as required.
In this guide, you are going to learn how to embed PDF files in WordPress with and without a plugin. The best of this guide is that you don’t have to purchase any premium tools to embed PDFs, the process will just take your time, nothing else.
So, let’s get started…
Is Embedding a PDF in WordPress Possible?
Wondering if you can embed a PDF file in your WordPress or not? If yes, then the answer is yes, WordPress allows users to embed PDF files in posts or pages. However, this is not possible in the same manner as you embed other media like images, videos, and other media.
This is because when you try to embed a PDF using the “Add Media” button in the editor, then you are only allowed to upload a PDF file. It will be then presented to the users as a file that they can click to download or can open in a new browser tab.
This can be suitable for several cases but sometimes you need to embed a PDF file into the post or page, so that visitors can preview it, without downloading it.
How to Embed a PDF in WordPress
You can embed PDF files in your WordPress blogs using the below-mentioned methods:
- By using a Plugin
- Without Plugin
In the below guide, we have discussed these two methods of embedding a PDF file in detail with steps.
How to Embed a PDF Using a Plugin
The first method to embed PDF files is to use a free WordPress plugin. We also highly recommend using this method as it is easier and more convenient, especially for beginners. There are multiple plugins available to perform this job. Here are a few of them:
- PDF Embedder: This plugin allows you to bulk upload and embed PDF files into your website posts or pages
- Embed PDF Viewer: This Lets you embed PDF files directly through the media library or you can also embed using third-party platforms using oEmbed.
- Google Drive Embedder: It is a free plugin that enables you to embed PDF files directly through Google Drive.
To get started, go to Add Plugins under the Plugins menu, type “PDF Embedder” in the search box, install, and then activate the plugin.
With this step, you have completed the PDF Embedder plugin installation in your WordPress blog.
The next step is to configure the plugin settings (only if required). To configure the setting, go to Settings > PDF Embedder as shown in the image below:
By default, this plugin embeds and displays the original size of the PDf file but it allows you to customize the height and width of the PDF.
In the free version of PDF Embedder, you get the below-limited setting options:
- Height and Width: With this setting, you can adjust the height and width of your PDF file. You can enter any specific dimensions in the given file and your PDF will be displayed at that size.
- Toolbar Location: Here you can choose where to show the toolbar on your site page. The available options are top, bottom, or both. This toolbar allows visitors to toggle between PDF pages and also to zoom in and out.
- Toolbar Hover: In this option, you can choose an action when visitors hover over the document. You can either choose to always be visible in the toolbar or visible only when visitors hover over the PDF.
Once you finish configuring the settings, click on the save button to save the configuration settings.
If you like to give credit to the plugin developers, you can enable the Display Credit option and the credit will be shown on the PDF viewer.
Now, it’s time to embed PDFs on our website. First, open any page or post where you would like to display your PDF and click on the Plus (+) button, search for PDF Embedder, and add the block to your post.
Now, click on the block “Click here to Open Media Library to select PDF” and WordPress media will open. Here, you can upload your PDF file.
After successfully uploading the file, click on it and choose the Select button to embed the document in your post.
With the above step, you have successfully embedded a PDF file in your WordPress post. To view your PDF, simply preview your post and see how it looks.
Here is an example:
Some people also use the Classic Editor instead of the Gutenberg Editor. To embed PDF files in the WordPress classic editor is pretty simple, you just need to drag and drop your PDF file in the editor and the PDF Embedder plugin will automatically select the file.
The plugin will automatically add a shortcode in your post that looks like [pdf-embedder url=” your PDF URL”]. This code will display your PDF to visitors.
How to Embed a PDF Without Using a Plugin
If you are a person who doesn’t like to use plugins for every problem and always looks for a solution without a plugin, then this section of the guide is for you. In this part, you will learn how to embed a PDF file in a post or page without using any plugin.
In this method, we are going to take the help of Google Drive. First, visit your Google Drive account and upload the PDF file by clicking on the New > File Upload option.
Once the file is successfully uploaded, double-click to open the file. Now, click on the three dots (more options) and select the Share option.
By clicking on this option, a new popup will open from where you need to select the Get Link option and choose the Anyone with this link option, and select Viewer. By doing this, you ensure your PDF will be visible to everyone.
Now, click on the Done button and go back to the three dots menu and click on the Embed Item option.
Once you click on the “embed” option, a popup will appear where it shows the HTML code of the PDF file. You need to copy that code and then click on “Ok” as shown in the image below.
Once the code is copied, go back to your WordPress post or page where you want to display your PDF and add a Custom HTML block.
Now, you’ve to paste the code under the block as shown in the image above.
Once you’ve added the code, you can click on the “Preview” to check how your PDF will look. You can also change the width and height as per your need.
Here is an example:
Voila! You have successfully embedded your PDF file in your WordPress site.
Frequently Asked Questions (FAQs)
If you still have questions in your mind then are some common and frequently asked questions by users:
Q1. How to embed a document in WordPress?
In this article, we have covered how you can embed a PDF file in WordPress. However, there are several other documents or files that you might want to embed in a post or page.
For this, you can use a plugin named Embed Any Document. It allows you to embed different types of documents like Word, Excel, and even PPT.
Q2. How do you embed images of your PDF in WordPress?
Sometimes, you don’t want to embed the entire PDF file in WordPress, instead, you want small images or thumbnails of your PDF that you can use as the featured images of your post. Also, you can use these thumbnails to show the front page of your PDF to the visitors before they download it.
For this purpose, you can use PDF Thumbnails which is a paid add-on for the PDF Embedder plugin. It automatically creates images or thumbnails of your PDFs in the media library of WordPress.
Q3. How do I embed a fillable PDF into WordPress?
Do you want to embed a fillable PDF in WordPress? If yes, then this can be achieved using tools like Gravity Forms or JotForm. These tools enable you to create fillable PDF files using built-in templates.
After creating a PDF, you will get a code that you need to copy and paste into your WordPress post or post. The tools also support integration to WordPress allowing you to embed PDF files directly from the tool’s dashboard.
Inserting a PDF file in a WordPress post or page is not rocket science. We have several ways to do this and above we have shared all the possible solutions to this problem (with steps).
I hope you enjoyed this article and it helped you embed PDF files in your WordPress blog. However, if you face any issues in the process, then don’t hesitate to comment below your questions.
Also, if you have any other method to embed PDFs then let the audience know by commenting below. Don’t forget to share this useful guide with your friends.