If you are looking to embed PDF in WordPress without plugin, then you are at the right place. This guide will show you how to embed PDF files in your WordPress without a plugin.
As many plugins can slow down the site speed, and nowadays, google prefer the site to have a fast loading speed to improve the overall user experience.
In case you want to use a plugin to embed a PDF file to your WordPress page or post, this article will cover all the methods.
So let’s get started.
Why PDF Embedding?
WordPress only allows the PDF file upload and insertion in the post or page, but what if you want to allow the user to view the PDF file on the website without the need to download the file?
In this scenario, the PDF embed is the solution as this will allow the user to view the PDF file on the website, improving the user experience, and the user will stay longer on your website. As a result, the bounce rate will be decreased.
So below are the 3 methods of embedding PDF in wordpress.
Method 1. Embed Pdf File In WordPress Without Plugin
To embed a PDF file first, we need to have a PDF file uploaded in our wordpress.
For uploading a PDF file, go to the wordpress dashboard and then go to your media library and upload the PDF file.
Once the file is uploaded, copy its URL from the URL section as shown in the picture below
Now head to the post or page where you want the PDF file embedded.
Copy the code below and paste the code into the custom HTML block, which you can create by clicking on the “+” icon and the search for the custom HTML block
<iframe src="URL" width="640" height="480" allow="autoplay"></iframe>
Also, don’t forget to replace the Url path with the file URL you copied earlier.
The code we are using from google docs will allow us to embed and view the PDF file in your wordpress without downloading it.
It will show the PDF file in an Iframe of 660px width and 480px height, which you can alter according to your need.
As in this method, we use the wordpress media library for storing files and embedding and viewing it. In the following method,, I will use google docs to embed the PDF file directly.
You May like:
How to embed a Spotify playlist in WordPress
How To Add A Download Link In WordPress
How to Add an Email Link in WordPress
Method 2.Embed Pdf File In WordPress Using Google Drive
This is the method I recommend if you have a large file size PDF file, as this method allows you to embed a PDF directly into your website without the need to upload it wordpress media library.
So first log in to your google drive and upload your PDF file. To embed google drive PDF in WordPress, open the file inside google drive.
You will see 3 dots on the upper right side. Click on it. You will have a dropdown to locate the options open in a new tab and click on it.
Once the file is opened in a new tab now, locate the new option “Embed item” and click on it once opened, you will have an iframe code.
Copy the code, head back to your wordpress editor, click on the “+” icon, and search for a custom HTML block.
Paste the code there, which you copied from google drive, and you are done.
You can change the height and width attribute in the code to modify the dimension of your embedded PDF file.
Using the code from the embed option will also show the download option with the Embedded PDF file in your wordpress.
If you want to only show the PDF file to the visitor without allowing them to download it.
For this, instead of clicking on the embed option, click on the share option > Advance and make sure the “Viewers and commenters can see the option to download, print, and copy” option is turned off.
And that’s it, and you are done!
So as you are done with embedding PDF files in your wordpress without a plugin, what if you want additional features with your PDF to embed, like you want to count the number of times your PDF is downloaded or want to organize it to show to only specific users?
For this, you will need a plugin to assist you in organizing your PDF file and providing you with additional features. Check the following method for embedding PDFs in wordpress using the plugin.
Method 3. Embed Pdf File In WordPress Using Plugin
For embedding a PDf file in wordpress using a plugin, we will have to install a plugin named PDF embedder.
This plugin is one the most rated download by over 300k and has many features to utilize for your site.
To install the plugin:
- Go to your wordpress dashboard and navigate to Plugins > Add new.
- Search for the plugin ” PDF embedder.”
- Install and activate it.
Now navigate to Settings > PDF Embedder. There you will find all the settings you can customize according to your need, But you can also leave it as default and Save the changes by clicking on the save changes button at the bottom.
Open any page or post where you want to embed your PDF file. Click on the “+” icon, search for “PDF embedder,” and select the PDF block as shown in the picture below.
It will add a block having the text “Click here to open media library to select PDF.” Click on it and upload a PDF file or select from your media library if you already have it and click on select.
It will add the PDF file as an embed, but you will not see the functionality in the block editor. If you save the changes and Preview them, you will see the PDF file in the visitor view.
And you are done with a successful embed of your PDF file using the plugin in wordpress.
FAQ (How to Embed PDF in WordPress Without Plugin)
Can you embed a pdf in wordpress?
WordPress allows users to embed PDF files by uploading them in the wordpress media library and then embedding them to the site page or post using the file block element. Additionally, you can also embed PDF files in wordpress By using a google drive embed link.
PDF file not uploading to wordpress?
Your PDF file not uploading to your WordPress site may be because you’ve uploaded the wrong file type. Review the file type to make sure you are uploading the correct one.
Can I host PDF files on my wordpress Site?
WordPress allows its user to host files, including images, videos, audio, and PDF files, So you can easily host your PDF files on your wordpress site and embed them on your posts or pages.
You can use WordPress to display your price list, ebooks, and other data in a consistent format or to provide downloadable for your visitors using PDF embed. It’s a great way to do so, and after reading this tutorial, you’ll be able to embed a PDF file in WordPress. If you’re still having difficulty doing so, feel free to leave a comment, and I will assist you.