How to Embed PDF in WordPress With and Without Plugin

How to Embed PDF in WordPress With and Without Plugin

Embedding a PDF into a WordPress post or page offers several advantages. First, it allows you to easily share documents with your website visitors. Whether you want to provide reports, brochures, whitepapers, or any other type of document, embedding a PDF enables you to display it directly on your WordPress site. In this article, I’ll describe a step-by-step guide about How to Embed PDF in WordPress with or without a plugin?

One of the key benefits of embedding a PDF is that it preserves the formatting of the original document. This means that fonts, images, and layouts are retained, ensuring that the document appears exactly as intended. Regardless of the user’s device or screen size, the PDF will maintain its visual integrity.

By embedding a PDF, you provide a user-friendly experience for your website visitors.

Furthermore, PDFs are compatible with various devices, including desktops, laptops, tablets, and smartphones. By embedding a PDF, you ensure that your content can be accessed by users regardless of the device they are using.

Embedding PDFs can also have search engine optimization (SEO) benefits. Search engines can index the text within PDF documents, making it easier for your content to be discovered through search queries. By embedding PDFs into your WordPress posts or pages, you provide search engines with valuable content to index, potentially improving your website’s visibility and search rankings.

Methods to Embed PDF in WordPress

There are different ways that can be used to embed PDF in WordPress. These ways can be categorized as:

  1. How to embed PDF in WordPress using Plugins
  2. How to embed PDF in WordPress without Plugins

How to embed PDF in WordPress using Plugins

If you are a beginner then using plugins is the easiest and quick way to embed PDF in WordPress. There are various Plugins that can be used to perform this action but there is a slight difference in the functioning of these plugins.

If you want to embed PDF in WordPress with the help of plugins, then the following plugins can be useful options:

PDF Embedder

Empowers you to effortlessly upload PDF documents and seamlessly embed them directly into your website.

Embed PDF Viewer

This plugin is free. You have the ability to incorporate a PDF into your content by utilizing the media library or by utilizing oEmbed to import it from a third-party site.

PDF Viewer for WordPress

This plugin is not available for free. It offers a variety of impressive features that allow you to have greater control over how your PDFs are displayed, with a user-friendly admin panel, the ability to track views using Google Analytics, and more.

You can use any one of these plugins as all the mentioned plugins are excellent choices, we highly recommend PDF Embedder for its simplicity and functionality. It’s a free WordPress plugin that allows you to effortlessly upload and embed PDFs directly into any page or post on your website. With PDF Embedder, you can customize the appearance of your documents using JavaScript.

By default, PDF Embedder automatically displays PDFs at their original size. If a PDF is too large, it will adjust to fit the available width. You also have the option to specify a specific width and height for any embedded PDF. Additionally, all the necessary files, including JavaScript, are served from your own server, ensuring reliability without relying on potentially unreliable third parties.

How to Embed PDF in WordPress using PDF Embedder

To embed PDF in WordPress using the PDF Embedder plugin, you need to follow three simple steps given below.

Step 1: Install PDF Embedder

Step 2: Configure the settings of the plugin

Step 3: Upload and Embed PDF 

Now, I’ll describe the procedure in detail.

Step 1: Install PDF Embedder

In order to install PDF Embedder, you need to:

  1. Log in to your WordPress dashboard.
  2. Navigate to Plugins->Add New  How to Embed PDF in WordPress
  3. Locate the search bar and type PDF Embedder.
  4. PDF Embedder will appear on the screen.
  5. Click on Install Now and after installation click on Activate.

How to Embed PDF in WordPress

Step 2: Configure the settings of the plugin

We are using the free version of PDF Embedder here.  The free version offers limited settings including:

  • Height & Width
  • Toolbar Location
  • Toolbar Hover
  1. Locate Settings in WordPress Dashboard.
  2. Click on PDF Embedder in WP Settings.
  3. PDF Embedder shows PDFs in their original size. But you can set specific height and width according to your need.
  4. Decide whether to show the toolbar at the top or bottom of the page. The toolbar enables users to zoom in and out of the PDF and switch between pages.
  5. Choose whether the toolbar should always be visible or only appear when a user hovers over the PDF.
  6. Click on Save Changes once you have fixed the PDF settings.

How to Embed PDF in WordPress

Step 3: Upload and Embed PDF 

Uploading and embedding PDF files in your posts or pages is the same as embedding images.

  1. Go to Posts or Pages where you want to embed PDF.
  2. Open the specific post and click on Add Media. How to Embed PDF in WordPress
  3. You’ll see two options (Upload Files & Media Library) in the upper left corner of the screen.
  4. Click on Upload Files. How to Embed PDF in WordPress
  5. After uploading the PDF to Media Library, Select the PDF File and click on Insert into Post. How to Embed PDF in WordPress
  6. You’ll see a short code in your post that will make a PDF File appear on the front end of your website.

How to Embed PDF in WordPress

How to Embed PDF in WordPress without Plugins

Using plugins to embed PDF is usually recommended to beginners. As many plugins can slow down the speed of your website at a time when fast-loading websites are being preferred by Google. So, rather than using plugins, You can use the following 2 methods to embed PDF in WordPress.

Method 1:

If you want to embed a PDF File in your post, then you must upload PDF File to Media Library.

  1. Log in to your WordPress dashboard
  2. Go to Media-> Add New
  3. After uploading the file, copy its URL from the URL section. How to Embed PDF in WordPress
  4. Now go to the post where you want to embed the PDF File.
  5. Locate the HTML block by clicking on the “+” icon.
  6. Copy the code given below.
<iframe src="URL" width="640" height="480" allow="autoplay"></iframe>

7. Paste this code in the HTML block.

8. Now go to the media library and copy the URL of the PDF File.

9. Paste the URL  in the code.

How to Embed PDF in WordPress

Using this method you can embed and show PDF File on the front end. And the users can view the file without downloading it.

Method 2:

Embedding PDF files in WordPress using Google Drive

Step 1: Upload the file to Google Drive

  1. Log in to your Google Drive if you have an account. But if you do not have an account, then create a new account first. How to Embed PDF in WordPress
  2. Upload the PDF File by clicking on New>File Upload from the upper left corner menu.
  3. Select the file from your computer and upload it.  How to Embed PDF in WordPress

Step 2: Getting a Shareable link

  1. Open the PDF file you just uploaded.
  2. There will be three dots in the upper right corner. Click on these dots.
  3. Locate “Open in a New Window” and click on it. How to Embed PDF in WordPress
  4. After opening the file in a new window, click on the three dots icon again.
  5. Locate the “Share” and click on it. How to Embed PDF in WordPress
  6. A new popup will appear on the screen.
  7. Click on “Get Shareable link”  How to Embed PDF in WordPress
  8. Click on “Advanced” if you do not want the PDF File to be downloaded, printed, or copied by the users.  Check ‘Disable options to download, print, and copy for commenters and viewers’. How to Embed PDF in WordPress

Step 3: Embed the HTML Code

  1. Again open the PDF File and click on the three dots icon.
  2. Locate the Embed item and click on it. How to Embed PDF in WordPress
  3. A popup will appear with HTML Code.
  4. Copy the code.  How to Embed PDF in WordPress
  5. Go to the post where you want to embed PDF.
  6. Click on the “+” icon and then select the HTML block.
  7. Paste the code here.

You now can view the PDF File on the front end of your site.

Final Thoughts

I have described the possible ways to embed PDF files in WordPress with and without plugins.

Ultimately, the choice between using plugins or going plugin-free depends on your preferences, technical proficiency, and specific requirements. Whichever method you choose, the ability to embed PDF files in WordPress opens up new possibilities for showcasing content, sharing documents, and enhancing the overall user experience on your website.

It’s worth noting that you should be mindful of the file size and complexity when embedding PDFs. Large or complex PDF files can impact page loading times. To optimize your PDF files for web viewing, it is recommended to reduce the file size before embedding them. This ensures that your website remains fast and responsive for your visitors.

So, whether you opt for the convenience of plugins or the flexibility of manual embedding, you now have the knowledge to successfully integrate PDFs into your WordPress site. Experiment, explore, and enjoy the benefits of incorporating PDFs seamlessly into your website!

FAQs.

Q.1: What are the advantages of using plugins to embed PDF files in WordPress?

Using plugins provides a convenient and user-friendly way to manage PDF embedding. Plugins offer additional features such as customizable dimensions, toolbar options, and responsive design.

Q.2: Are there any disadvantages to using plugins for PDF embedding?

While plugins offer convenience, it is important to select a reliable and well-supported plugin. Additionally, some plugins may affect the site’s performance if not optimized properly.

Q.3: Does embedding PDFs without plugins require technical knowledge?

Embedding PDFs without plugins may require some technical knowledge, especially when it comes to writing HTML code, ensuring responsive design, and ensuring cross-browser compatibility.

Q.4: Can I change the appearance and behavior of the embedded PDFs?

Yes, both methods allow you to customize the appearance and behavior of the embedded PDFs. Plugins often offer built-in options for customizing dimensions, toolbar positions, and other features. When embedding PDFs without plugins, you have greater control over the HTML code, allowing you to modify various aspects such as size, layout, and responsiveness.

Q.5: Can I embed multiple PDF files on the same page?

Yes, both methods allow you to embed multiple PDF files on the same page.