monticellllo / stock.adobe.com
WordPress enables you to upload a wide variety of content types, including videos, images, and audio files. Unfortunately, dealing with PDFs isn’t as straightforward. Therefore, if you’re wondering how to embed a PDF in WordPress, you’re not alone.
By default, uploading a PDF file to a WordPress page or post will display a link that can either be used to download the file or open it in a new browser tab. However, just because WordPress doesn’t come with a built-in feature for embedding PDFs doesn’t mean it’s not possible. With the right tool, it’s actually a simple task.
In this post, we’ll explain your options for embedding PDFs and how to get started. Let’s jump right in!
In This Article 👀
Can You Embed a PDF in WordPress? 🤔
If you’re wondering “Can you embed a PDF in WordPress?”, the answer is yes. However, it’s not possible to do this in the same way you would with other media and content types, such as images and videos.
When you use the Add Media button or Image block in the WordPress editor, you can only upload a PDF file. This file will be presented as a link that visitors can either click on to download the PDF or open it in a new browser tab.
While this is suitable in some cases, there are other times when you might be looking to embed the PDF into the actual WordPress post or page. Not to worry; there are a few ways you can do this easily.
The simplest method is to use a plugin, such as PDF Embedder. Another option, if you don’t want to use a plugin, is to embed the PDF using an iframe code. The latter requires a few more steps, but it’s an effective method if you don’t want to install another plugin on your website. Throughout this post, we’ll show you how to use both of these techniques.
[bctt tweet=”🔑 Using a plugin enables you to embed a PDF in WordPress with ease! #WordPress” username=”thewpbuffs”]
How to Embed a PDF in WordPress (In 3 Steps) 📩
As we mentioned, the quickest and most efficient way of embedding a PDF into a WordPress post or page is to use a plugin. This method lets you customize the appearance of the PDF, and makes uploading your files simple. Let’s take a look at how to embed a PDF in WordPress in three easy steps:
- Download and install the PDF Embedder plugin.
- Configure the plugin’s settings.
- Embed your PDF into your WordPress post or page.
Step 1: Download and Install the PDF Embedder Plugin
There are a handful of PDF plugins you can use, but we suggest PDF Embedder:
With over 200,000 active installations and a 4.5/5.0 star rating in the WordPress Directory, this plugin makes uploading and embedding PDF files as easy as adding images. It also embeds PDF files using JavaScript only, eliminating the need for iframes or third-party apps. This means you get more flexibility, customization, and control over the appearance of your documents.
To get started, go to Plugins > Add New in your WordPress dashboard and search for “PDF Embedder”:
Select Install Now, followed by Activate. Alternatively, you can download the plugin from the WordPress Plugin Directory, then upload it to your site by going to Plugins > Add New > Upload Plugin > Choose File.
Step 2: Configure the Plugin’s Settings
Once you’ve installed PDF Embedder, the next step is to customize its settings. This helps ensure that your PDF files appear how you want them to.
To locate the plugin settings page, navigate to Settings > PDF Embedder:
Under the Default Viewer Settings, you can change the width and height of the PDF viewer:
You can also decide where the PDF viewer toolbar will be located, and whether it will stay visible at all times. When you’re done customizing these settings, save your changes. Then you’re ready to embed your PDF in WordPress.
Step 3: Embed Your PDF into Your WordPress Post or Page
If you’re using the Classic Editor, you can embed your PDF in WordPress the same way you would place an image. After you open the WordPress page or post that you want to embed the PDF in, select the Add Media button:
Next select the Upload File tab, followed by your PDF file, and hit Insert into post. This will add a shortcode to the post. To see how the PDF embed will look on the front end, click on Preview in the top right-hand corner of the editing screen.
If you’re using the newer Block Editor, the PDF Embedder plugin ships with a custom block. To locate it, click on the + icon in the post or page to add a new block. In the text field, search for and select “PDF Embedder”:
After you select your PDF file to upload, you’ll notice that there are some options to the right. There, you can customize the dimensions and toolbar settings (as you did in Step 2).
If you want to keep the universal settings, you can leave these sections as is. Otherwise, your changes here will override them:
Again, you can preview the changes to see how the PDF will appear on the front end of your site:
If you’re happy with your PDF, save and publish your changes. That’s it!
How Can I Embed a PDF in WordPress Without a Plugin? 🗒️
Some people avoid adding new plugins to their WordPress sites whenever possible, in order to maximize performance. So you may find yourself wondering, “How do I embed a PDF in WordPress without plugins?”
[bctt tweet=”⌨️ If you don’t want to use a plugin, you can embed a PDF in WordPress using iframe code! #WordPress” username=”thewpbuffs”]
Fortunately, you can still embed a PDF in WordPress posts and pages without using a plugin. To do so, you’ll first need to upload your PDF file to Google Drive. If you don’t already have a Google account, you can create one quickly and easily.
Then from your Google Drive account, you can upload your PDF file by clicking on the New button:
Click on File upload, and select your PDF file followed by Open. After the file is uploaded, you can preview it by double-clicking on it.
From the preview screen, select the three vertical dots in the top right-hand corner, then choose Open in new window:
In the new window, once again click on the dots, followed by Embed item:
The Embed item window will open and display your iframe code. Copy the code:
Next, navigate to the WordPress page or post where you want to embed the PDF. If you’re using the Classic Editor, click on the Text tab and paste in the code. If you’re using the Block Editor, add a new Custom HTML block and insert the code there:
You can preview your PDF on the front end to see how it will appear. When you’re done, save your changes, and you’re all set.
Frequently Asked Questions 🙋♀️
At this point, you should have a solid understanding of how to insert a PDF in a WordPress page or post, both with and without a plugin. However, there are some FAQs we want to address for those who have more specific concerns.
How Do I Embed a Document in WordPress?
So far, we’ve covered how to embed a PDF into WordPress pages and posts. However, there might be times when you want to embed a text document instead, such as a Word Doc.
The best way to do this is to use a plugin, such as Embed Any Document:
This tool lets you easily upload and embed documents. It supports a variety of file types, including those created in Microsoft Word, Excel, and PowerPoint, as well as Adobe Illustrator (.ai) and text (.txt) files.
Once you install and activate the plugin on your WordPress site, it will automatically place an Add Document button in the Classic Editor, or add a custom Document block to the Block Editor.
How Do I Embed a Fillable PDF in a WordPress Site?
If you’re wondering how to embed a PDF in WordPress that acts a fillable form, one of the easiest methods is to use a tool such as JotForm:
This PDF form builder lets you build your own fillable PDF forms, either by using a template or importing your own. You can download the fillable PDF, or embed it in your WordPress site via code.
Under the Publish tab of the JotForm PDF editor, there is a list of third-party platform integrations. When you click on the WordPress.org icon, JotForm will display the script code:
Copy and paste this code into the text editor of your WordPress post or page. Then your users can fill out the form on the front end of your site. Once they submit it, you’ll be emailed a copy of the data in PDF form.
How Do I Embed a Submittable PDF Form in WordPress?
The process for embedding a submittable PDF form in WordPress is the same as for fillable forms. However, if you don’t want to use JotForm, you can also use a premium plugin such as Gravity Forms:
This popular form builder plugin starts at $59, and can be used to create your own custom forms. However, to turn your form into a submittable PDF, you’ll also need the Gravity PDF plugin, which is an extension of Gravity Forms.
How Do I Embed a Small Image of My PDF in WordPress?
Perhaps you don’t want to embed your entire PDF file into WordPress, but instead feature a small image or thumbnail. This is useful is you want to include the first page or front cover of a book or document, so visitors can view it before downloading the file.
To do that, you can use a plugin such as PDF Thumbnails, a premium add-on for the PDF Embedder plugin. This plugin will automatically generate fixed images of your PDF files in your WordPress Media Library. You’ll have the option to use the thumbnails as featured images for specific posts, or as clickable thumbnails that can be used to download your PDFs.
How Do I Embed a PDF in WordPress Without Forcing a Download?
You can embed a PDF in WordPress without forcing a download using any of the methods we mentioned earlier in this article. The purpose of embedding a PDF in WordPress is so visitors don’t necessarily have to download the file or open a link in a new browser tab to view it.
For example, whether you embed your PDF in WordPress via the PDF Embedder plugin or by using code, it won’t force a download. Therefore, as long as you embed the PDF with or without a plugin, visitors can access it without having to download it first.
Wrapping Up 🎉
Knowing how to put a PDF on a WordPress page or post helps you make key documentation and resources available to your visitors. However, the built-in WordPress functionality is limited, giving you no way to display a full PDF right on your website.
As we’ve seen, you can still embed a PDF in WordPress in a number of ways. One method is to use a plugin such as PDF Embedder. Another is to upload it to your Google Drive account, and then copy and paste the iframe code in your WordPress post or page. With the right tools, you can even embed form fillable and submittable PDFs on your website.
Once you’ve added PDF files to your WordPress site, it’s important to make sure the documents are properly maintained and updated, as well as the tools you use to manage them. At WP Buffs, we can help. We offer Care Plans that make managing and securing your WordPress site easier, including plugin updates and configuration. Whether you need help or simply want to save time, we’ve got you covered!
Want to give your feedback or join the conversation? Add your comments 🐦 on Twitter!
Image credit: Pexels.