Do you want to upload a PDF file and embed PDF in WordPress without a plugin?

WordPress comes with a powerful Media Library where you can upload and embed images and videos easily. Not known to many, you could also upload PDF files to the Media Library and display it on your posts or pages.

In this article, I’ll show you how to upload and embed PDF on your blog posts or pages without a plugin.

[click_to_tweet tweet=”Embedding PDF on your page could make your user stays longer. #wordpress” quote=”Embedding PDF on your page could make your user stays longer. “]

Why PDF

PDFs are a popular file format that could be used to display useful information for your users and your businesses. You could use PDF to display the restaurant menu, checklists, templates, course materials, and even eBooks.

How to Upload a PDF to WordPress

Before you can embed a PDF on your WordPress blog posts or pages, you need to first upload your PDF to WordPress.

Luckily, you could do it with WordPress’s Media Library directly.

Simply click the “Add Media” button on the editor screen and drop the PDF file to upload.

WP Editor - Add Media
WordPress Editor – Add Media

Alternatively, click the “Upload Files” tab to select the PDF file to upload.

WordPress Editor - Upload Files
WordPress Editor – Upload Files

By default, if you click on the “Insert into post” button, all it does is insert a link on your post to view and download the PDF file on the browser. Like this link below.

The_Marketers_Pocket_Guide_to_Writing_Good

Upload a PDF with Gutenberg Editor

For those using the Gutenberg Editor, you could either insert a “File” or “Image” block to your post or page to upload the PDF file.

If you’re using the “Image” block, you might not be able to select PDF files when you click the “Upload” button. Simply click on the “Media Library” button to select the PDF file to upload. Clicking on the “Insert into post” button will add a link to view and download the PDF file.

Gutenberg Editor - File Block
Gutenberg Editor – File Block

If you use the “File” block, WordPress will display the name of the PDF file and a button to download the file. Through the options panel, you could choose to show or hide the download button and change the link of the file.

Gutenberg Editor - File Uploaded
Gutenberg Editor – File Uploaded

How to Embed a PDF File without a Plugin

Now that you’ve uploaded the PDF to your Media Library, let’s try to embed it on a post. First, go to your Media Library, and get the URL of the PDF file uploaded.

Media Library - File URL
Media Library – File URL

Copy this code below, don’t forget to replace the URL part with the file URL you just copied.

Notice that we’re using the Google Docs viewer to help us embed and preview the PDF file. This will create an iframe with 800px width and 1200px height. Feel free to change it to fit your website layout.

Check out this guide to make the iframe responsive.

Embedding PDF File from Google Drive

If you’ve been using Google Drive to store all your documents, you can skip the first part of the tutorial.

Login to your Google Drive account and upload the PDF file that you want to embed or choose an existing file you’ve uploaded before.

Now, click on the file to preview it and click the 3 dots sign to share and click on the “Open in new window”.

Google Drive - Open in new window
Google Drive – Open in new window

Google Drive will load the document in a new browser window. Next, click on the 3 dots sign again and click on “Embed item…” to reveal the iframe code.

Google Drive - Embed Item
Google Drive – Embed Item

Copy the iframe code.

Google Drive - iframe code
Google Drive – iframe code

Go to your WordPress Editor, click on the “Text” tab and paste the code.

WordPress Editor - Text Tab
WordPress Editor – Text Tab

This is how it would look like.

Additional Features

Google Drive has an advanced feature that prevents viewers from downloading and printing your file. To do this, click on the 3 dots icon on your Google Drive preview and click the “Share” link.

Next, click on the “Advanced” link at the bottom right corner to reveal the option.

Google Drive - Advanced Share
Google Drive – Advanced Share

Simply check it and you’re done.

Google Drive - Disabled download
Google Drive – Disabled download

When Should You Use a Plugin?

So, you might ask why do you need to use a plugin to embed PDF in WordPress?

Plugins give you more features than embedding and viewing PDF. It might come in handy if you want to track downloads of the PDF or if you want to prevent people from downloading the PDFs.

A plugin also makes it easy to organize your PDF files.

Final Thought

The Media Library feature in WordPress supports multiple file types and it’s easy to embed a PDF in your post without installing a plugin.

I hope this article helped you embed a PDF in WordPress. Check out this tutorial to make your embedded iframe responsive. You might want to take a look at our guide on how to make people share your content.

If you like this article, don’t forget to click the share button.