Sunday , December 22 2024
Files Documents

Embedding PDF Files in WordPress Post Without Plugin

Sometimes we want to add a PDF File or Spreadsheet file to a WordPress Post or Page so that it’s visible to user (Not just as a link). In such a case we can use some coding skills which are easier to code and doesn’t require any external plugin help.

If you want to embed a PDF File in WordPress Post or page but not want to add any other plugin. Then, here is the solution. As we all know – adding more and more plugins makes your website slow, however, we often required to embed or add the PDF File in our WordPress post, then why should, we compromise the speed.

By default, when you upload and add the PDF File from the Media section to WordPress post; it only embeds a PDF in your blog post and shows only the PDF File name along with a link. In case, if you just want to give a user the PDF File download capabilities then it is good but not if you want to show the PDF File in the post so that user can view and read it directly on your website without leaving it; that also decrease the bounce rate.

In this article, we will show you how to add a PDF viewer in WordPress without using any PDF Embedder WordPress plugin.

Steps to Embedding PDF Files in WP post:

  1. Go to WordPress Page or Post where you want to add the PDF File to view.
  2. Now click on the Add Media button.
  3. Click on the Upload files Tab.
  4. Now again click on the Select file button to upload the PDF File.
  5. Select and upload your PDF File to WordPress media gallery.
  6. Once it uploads, come back to your blog post.
  7. Where you want to add the PDF File Viewer click there and after that just click on the Text Editor Mode tab given on the right top side of your text editor.
  8. Inside the Text Editor Mode –  just place the following code (Please see code in the box area).
  9. Now click on the Add media, select the PDF File and copy its URL given on the right side.
  10. After copying the URL, just replace the https://www.example.com/demo.pdf with your own PDF file.
  11. You can also increase or decrease the size of embedded PDF file by altering the value of Width and height attributes given in the code.
  12. Once you replaced the URL you will see you have successfully added the embedded PDF File Viewer on WordPress post without any external plugin.

<embed src=”https://www.example.com/demo.pdf” type=”application/pdf” width=”660″ height=”550″></embed>

The above method may not work in the Microsoft edge browsers. In such a case, you can use the iframe code:

<iframe src=”https://websolvant.com/wp-content/uploads/2019/07/Amarjeet-malik-WebSolvant-Profile.pdfwidth=”660″ height=”550″> </iframe>

Note: Change the PDF link with yours URL and in the Text tab of the editor same as mentioned above in this article

Best WordPress Plugins Embedding PDF Files

  • PDF Embedder
  • Google Doc Embedder
  • PDF Viewer for WordPress
  • PDF.js Viewer Shortcode
  • WP Booklet
  • Flowpaper
  • Vanilla PDF Embed
  • PDF Viewer
  • PDF and Print by BestWebSoft
  • PDF Tab for WooCommerce
  • Real3D FlipBook WordPress Plugin
  • Embed PDF Viewer