How to Embed PDF in WordPress (With or Without Plugin)

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 then be presented to the users as a file that they can click to download or 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.

💡 Quick Tip:

Before you install any plugin on your WordPress website, it’s always recommended that you take a full backup of your website and save it locally before starting the installation.

It is also a good idea to clone your WordPress website to a dummy domain in order to try any plugins. By doing so, you will greatly reduce the chances of getting any type of error on your website in the future. Also, if you’re using these methods on your main domain, please make sure that the page is set to the “Private” setting.

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.

All of the above plugins are good in terms of features, but we highly recommend using the PDF Embedder plugin, as it is trusted by more than 300k WordPress blog owners. Also, it uses JavaScript instead of iframes or other third-party services that make PDF files load fast.

To get started, go to Add Plugins under the Plugins menu, type “PDF Embedder” in the search box, install, and then activate the plugin.

Install “PDF Embedder” 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:

Open “PDF Embedder”

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:

PDF Embedder 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 would 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, click on the Plus (+) button, search for PDF Embedder, and add the block to your post.

Search for “PDF Embedder” on Gutenberg

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.

Search or Upload PDF File

After successfully uploading the file, click on it and choose the Select button to embed the document in your post.

Choose Your PDF File to Embed

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:

Preview Your PDF File

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.

PDF Embedder Shortcode

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.

Upload Your PDF File to Google Drive

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.

Open PDF File and click on “Share”

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.

Make File Visible to Public & Copy File Link

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.

Click on “Embed Items” on Your PDF File Options

Now, click on the Done button, go back to the three dots menu, and click on the Embed Item option.

Copy Embed Code of Your PDF File

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.

Search for the “Custom HTML” block in Gutenberg

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.

Paste Your Embed Code on 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:

Preview Your PDF Embed Code

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 with WordPress, allowing you to embed PDF files directly from the tool’s dashboard.

Wrapping Up

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.

Sunny Kumar

Number of posts: 145

Hi, I'm Sunny Kumar, a passionate tech enthusiast and a blogger from New Delhi, India. With a degree in IT from IIT-D and expertise in SEO, Cloud Computing, Telecom & Networking, and CEH, I specialize in various technical fields, including SEO, WordPress Development, and PC Building. And being a proficient WordPress user, I’m dedicated to delivering quality content and a remarkable user experience.

Leave a Comment