How to Embed PDF in WordPress 1

How to Embed PDF in WordPress

WordPress allows us to embed a wealth of content in our posts and pages, including audio and video files, tweets, content from Reddit, Amazon Kindle and much more. However, one thing we cannot do in WordPress is embed a PDF file, at least not out of the box.

PDF is one of the most popular file types and is a universally accepted format. It is used for various types of content, particularly eBooks, travel brochures, restaurant menus and course materials. So when you want to embed this content on your WordPress website in a PDF format, how do you do it?

Of course, you can embed the PDF in WordPress by selecting the following. Add media the option in the Classic Editor, or File Block it in Gutenberg and then upload the file to it. In this case, however, users can simply download the file or view it in a separate tab away from your website. And embedding is not about that. The goal is to keep visitors on your page.

In this article, we’ll dig deeper into this topic and show you:

How to Embed PDF in WordPress Using a Plugin

The fastest and easiest way to embed a PDF on a page or post is to use a plugin.. We recommend that you use PDF Embedder.

PDF Embedder

It currently has over 200,000 active installs, an average 4.6 star rating on the official WordPress plugin repository, and is regularly updated.

This plugin makes it super easy to embed PDFs on your pages and posts. it displays files in their original sizebut you also have the option to change the width and height of the file (more on that later).

What we particularly like about PDF Embedder is, using JavaScript to embed files, not iframes. This means that you can modify the plugin as you wish, or even add some new features that the plugin does not include by default. While this might not mean much to you if you’re not a developer, this information can be very useful to anyone interested in coding. Remember, WordPress.org plugins are open source and therefore can be modified to the liking of the user.

Now let’s see how to embed a PDF in WordPress using PDF Embedder.

Enable PDF Embedder

First, let’s install and activate the plugin.

To do this Plugins > Add New and type PDF Embedder in the search box on the left side of the screen.

Enable PDF Embedder

When the add-on appears in the search results, first To organise and then enable. That’s it, the plugin is now active on your WordPress website.

Plugin Installation

Next comes the plugin configuration. go Settings > PDF Inserter.

PDF Embedder Plugin Settings

The free version of the plugin allows you to:

PDF Inserter Main Settings

this mobile and Trustworthy options are for premium users only. You can buy the premium version of the plugin at wp-pdf official websiteStarting at $20 for a single site license.

However The free version of PDF Embedder comes with the features you need to embed a PDF in WordPressso if you’re short on cash, you don’t need to spend money on premium plans.

Embed PDF File

Once you’ve changed the plugin settings to your liking, it’s time to upload a PDF file to your page.

go Pages > Add New. If you are using the Classic Editor, click on it. Add media.

Add Media in Classic Editor

Next, select the PDF file and Add to Page button.

Add to Page button

The PDF shortcode will now appear in your text editor.

PDF shortcode

if you are using Gutenbergafter installing the plugin Pages > Add New. Then click on “+” symbol to add and search for a new block PDF Embedder.

PDF Embedder Gutenberg block

After adding the block, all you have to do is upload the PDF file to the page.

Upload the PDF file to the page

And that’s it, that’s all you need to do to embed a PDF in WordPress with PDF Embedder.

There are other free plugins you can try, for example Google Drive Embedder, Embed PDF Viewerand Algorithm PDF Viewerbut as far as we’re concerned, PDF Embedder definitely takes the crown.

How to Embed PDF in WordPress Using Google Drive

If you don’t want to mess with plugins, however simple they are, you can still embed a PDF file in your posts and pages using Google Drive (you can also use this to embed Word documents and Google Sheets in WordPress). In this case, you must use iframe code.

The first thing you need to do is upload a PDF file to Google Drive. To do this, go to your Google Drive account, new Select in the upper left corner of the screen and File upload.

Upload a PDF file to Google Drive

Find your PDF file and upload it to the drive.

Then double-click the file to preview it. In the upper right corner of the screen, you will see the three vertical dots icon with its abbreviation. more moves. Click on it and select the first option – Share.

Share document

Now we need to ensure that anyone with the link can see your PDF file. To do this, Anyone with the link choose filed can view choice.

Anyone with the link

We also recommend that you click. Developed options and tick the box prevents visitors from downloading, printing or copying your file.

Prevents visitors from downloading, printing or copying your file

After saving your changes, click the three dots again and Open in new window.

Open Document in New Window

When the file is opened, the three dots will be visible again. Click on them and from the drop down menu Embed Item.

Embed Item

The iframe code of your PDF file will now appear.

The iframe code of your PDF file

Copy the link and go to your WordPress dashboard. choose Pages > Add New and paste the link into the text editor.

Custom HTML box

To do this in Gutenberg first Custom HTML box to your page and then paste the link into the block.

Add the custom HTML box to your page

The iframe code may not allow much customization options, but at least change the size of the preview according to your requirements by changing the width and height parameters at the end of the code.

Change the size of the preview

And you’re done with that! You have successfully embed a PDF file in WordPress using Google Drive.

final thoughts

WordPress comes with a plethora of features that you can use for all sorts of purposes, but it’s still not possible to embed PDF files from the platform itself, unfortunately. Fortunately, there are two simple ways you can go about it. If you are a WordPress expert, You can lean more towards PDF Embedder because it is a JavaScript plugin and you can change its code exactly to your liking.. Others may feel more comfortable in the familiar environment of Google Drive. It really doesn’t matter that much – it all depends on your preferences and skills.

Support our work ❤️

If you enjoyed this article, consider leaving a tip to help us keep publishing great content.

Secure payment on PayPal
Moyens I/O Staff is a team of expert writers passionate about technology, innovation, and digital trends. With strong expertise in AI, mobile apps, gaming, and digital culture, we produce accurate, verified, and valuable content. Our mission: to provide reliable and clear information to help you navigate the ever-evolving digital world. Discover what our readers say on Trustpilot.