Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

How to Add a PDF Viewer in WordPress

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Add a PDF Viewer in WordPress

Do you want to add a PDF viewer in WordPress? By default, WordPress displays PDF files as links. Users can view the PDF by downloading it or opening it a new window. But what if you wanted to embed a PDF in your blog post? In this article, we will show you how to add a PDF viewer in WordPress.

PDF Viewer for WordPress

Why and When You Need a PDF Viewer in WordPress?

WordPress does not embed PDF files into blog posts like it does with audio and video embeds. It just adds the file as a downloadable link.

This means that users will have to go away from your page to view the PDF file. Many of these users don’t come back to your site, and this reduces your site’s pageviews as well as user-engagement.

One way to deal with is to offer PDF files as content upgrades. This way, you can ask users to join your email list to get the bonus content.

However if you just want users to view PDF files without leaving your website, then you will need to add a PDF viewer in your WordPress site.

A PDF Viewer will embed the PDF right into your WordPress posts and pages. Users will be able to view, read, download, and even print the PDF file without leaving your site.

Installing and Setting up a PDF Viewer in WordPress

First thing you need to do is install and activate the PDF Viewer plugin. Upon activation, you need to visit Settings » PDF Viewer to configure the plugin settings.

Settings page for PDF Viewer plugin

PDF Viewer plugin allows you to control the height and width of the PDF viewer. You can change this if you feel that PDF viewer container is too wide or narrow on your site.

You can also disable support for older versions of Internet Explorer. By default, the plugin will not show the PDF viewer to users with Internet Explorer 9 or below. Instead, those users will see a download link. You can modify the message users with old browsers will see.

Don’t forget to click on the save changes button to store your settings.

Embedding PDF Files with PDF Viewer in WordPress

Adding PDF files in your blog post is quite simple. First you need to upload a PDF file using the media uploader. You can do this by creating a new post or edit an existing one, and then click on the ‘Add Media’ button above the post editor.

Use media uploader while writing posts to upload your PDF files

After uploading your file, you can copy its URL directly from the media uploader.

Copy the URL of PDF File

Next, you need to add this URL wrapped between [pdfviewer] [/pdfviewer] shortcode. Like this:


This is how the PDF Viewer will display your file in your WordPress post.

PDF Viewer demo

You can add height and width parameters to the shortcode as well. This is particularly helpful if you want to override the default height and width defined in plugin settings.

The PDF Viewer uses Mozilla’s PDF.js script to display PDF files. It renders PDF files beautifully with the standard set of tools to scroll, search, jump between pages, print, and download PDF files.

We hope this article helped you add a PDF Viewer in WordPress. You may also want to take a look at our guide on how to restrict content to registered users in WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. rajesh says:

    hi i want to publish a book in my wordpress site and people only read the book so can u refer me any easy pdf reader plugin

  2. Omar says:

    This is not working for me on the last version of WP. Someone know a workaround? Or another option that works?

  3. fred says:

    Hi guys,

    the problem with PDF plugins like this ones, is that you cannot remove sibar(s) when generating your PDF, an that changes style a lot !

    If ever I find one that has this so useful feature, I come back here to tell you ! Or maybe someone found one somewhere ?

  4. ibrar says:

    NIce information

  5. Nate Richie says:

    You should try ‘Embed Any Document’. It’s a much better alternative.

  6. Piet Marisael says:

    Is it possible to set the viewer by opening a file to 110% view automaticly and how i gonna do that?

    It’s a perfect plugin used by WordPress 4.4.2 and twenty-eleven theme

  7. Darron says:

    Hi Syed,
    Many thanks for the ‘heads up’ on this issue.

    I’ve been using the following free version of this plugin for the last two years, though have just upgraded to the premium due to the high number of fPDF’s held on my clients site:

    So far I’ve had no issues at all with the premium version, I’m also able to ‘unbrand’ the document, plus track the number of download/views.

  8. Rita says:

    I read the info that you indicated. Looks like the pdf viewer is not available for Too bad. I understand the issue that readers who click on my url for a pdf will go to a separate page, and may not return to my blog. That is a problem. I didn’t know that I would have this a need to display pdfs when I started with, or I may have made a different choice.

    • Rita says:

      Am I correct that is the required application for the embedding plugin? If so, I suggest that information be clearly stated as a requirement. All references that I saw are to the generic WordPress, so it’s not possible (Did I miss it?) to determine whether there is a specific application requirement. It would help us newbies to avoid mistakes, and direct us to potentially making different decisions.

  9. Dan says:

    I really appreciate your posts that identify a DIY (do it yourself) issue in wordpress, and then provide some alternate solutions, usually involving plug ins.

    “But”, am wondering if you take the time to read some of the reviews posted by users on the plugin page in directory, and also the LAST UPDATED info.

    For example, this PDF VIEWER plugin was last updated “8 months” ago, and is compatible up to WP 4.2.6

    Also, per one reviewer….

    “November 4, 2015 for WP 4.3.1
    This plugin was precisely what I needed. Thanks!

    ******Only concerns are:
    (1) This plugin leverages Mozilla PDF.JS framework. As of 2015-NOV, this plugin is significantly behind the present version of that framework:

    Plugin Settings page states:
    PDF.js Version Date
    Stable 1.1.1 18 Mar 2015
    Beta 1.1.114 7 May 2015
    PDF.JS page states as of 2015-NOV:
    Stable 1.1.366
    Beta 1.1.469

    SUMMARY > Don’t you think it’s good practice to use plugins with good ratings, but that are also consistently updated and highly rated ? If you do, please include some info in your posts that acknowledge a suggested plugin hasn’t been updated in a while, but appears to be the best solution among the ones currently available.

  10. Rita says:

    I use, not .org. Can I embed pdfs and other documents using a plug-in? I have found varying references, and want to be certain, before experimenting and possibly damaging m existing blog. edit page does have a location labeled plugins. That also leads me to believe that I can use them, yet, references say “no”. I’ll appreciate an explanation.


  11. Md Riyaz Alam says:

    Hey Syed,
    I think this is the first of its kind pots on wordpress. I did not see a post on PDF for WordPpress, but many of SEO and bloggers are looking for this pluging. So thanks to introduce this to the WP industry. This could be very helpful for tutorials as well.

  12. Rita says:

    I am using (not .org). I want viewers to see my pdf documents on the same page as the rest of my blog post. Can I install the pdf viewer that is described here, in my blog?

  13. Prince says:

    Thanks for this article. For SEO purpose, is it better to add the pdf content in text and add a button to download the link, or to display the pdf only using this viewer plugin ?

    • WPBeginner Support says:

      Like we said, a download link forces users to view the PDF separately. This decreases the time they spend on your page and their chances of coming back to resume browsing your website. You will get the same SEO benefit as adding a download link. Since it is written in JavaScript and compatible with HTML5 search engines can still index your PDF contents if the PDF file has text in it and not just images.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.