Skip to content
Blog
Guides

How to embed a PDF in WordPress: four ways compared

Four ways to show a PDF in WordPress: a download link, the File block, a Drive embed and a viewer plugin

A PDF that only downloads is a PDF most visitors never open. Embedding it puts the document on the page itself, so people can read it where they found it. WordPress gives you several ways to do that, and they behave very differently, especially on phones.

Here are the four common ones, from the simplest to the most capable, with what each looks like to the reader.

The four ways at a glance

Download linkFile blockGoogle Drive embedPDF viewer plugin
Reader stays on your pageNoYesYesYes
Works on phonesOpens or downloads the fileOften notYesYes
Looks the same in every browserNoNoYesYes
Search, zoom, table of contentsBrowser’s ownBrowser’s ownGoogle’s viewerBuilt in
Control over download and printNoNoPartlyYes
File stays on your serverYesYesNo, on Google DriveYes
SetupSecondsA minuteA few minutesA few minutes

1. A link or button to the PDF

Upload the PDF to the media library and link to it from a paragraph or a Button block. The browser then opens the PDF in its own viewer or downloads it, depending on the browser and its settings.

Good for forms, price lists and documents people want to save or print anyway.

The catch is that the reader leaves your page, and on phones the file often lands in the downloads folder rather than on screen. You also cannot see whether anyone read past the first page.

2. The WordPress File block

The block editor’s File block can show a PDF inline:

  1. Add a File block and upload or choose the PDF.
  2. In the block settings, turn on Show inline embed and set the height.
  3. Publish. The PDF appears in a frame with a download button underneath.

The frame uses the browser’s built-in PDF viewer, so the toolbar, zoom and look change from browser to browser. WordPress itself warns about the main limit in the block settings: most phone and tablet browsers will not display an embedded PDF, and those visitors see only the file name and the download button.

Good for quick internal pages and audiences that read on desktop.

3. A Google Drive embed

Upload the PDF to Google Drive, share it as “Anyone with the link”, and embed the file’s preview address in an iframe:

<iframe src="https://drive.google.com/file/d/FILE_ID/preview" width="100%" height="700"></iframe>

Replace FILE_ID with the ID from the file’s sharing link and paste the code into a Custom HTML block. Only administrators and editors can add iframes, so other roles need help from one of them.

Google’s viewer works on phones and looks the same everywhere. The trade-offs: the file lives on Google’s servers rather than yours, the viewer carries Google’s branding, anyone with the link can open the original, and you depend on the sharing setting staying public.

Good for documents that already live in Google Drive and need no styling.

4. A PDF viewer plugin

A viewer plugin draws the PDF with its own viewer inside your page, so it looks and works the same in every browser and on every phone. It is the only one of the four that lets you decide how the document is shown.

With Real3D Flipbook the same PDF can be shown as a classic scrolling viewer, a sliding viewer for phones, or a book with turning pages. Here is a 28-page brochure in the scroll view:

What a viewer plugin adds over the other three:

  • The same experience everywhere, including phones, where a two-page spread becomes one page at a time.
  • Its own toolbar: zoom, full-text search, thumbnails, a table of contents from the PDF’s bookmarks, sharing and full screen.
  • Download and print under your control. Switch the buttons off, or keep them.
  • Speed. The PDF loads in pieces, so the first page appears before the rest of the file has arrived. A viewer further down the page can open in a lightbox and load nothing until it is clicked.
  • Your design: toolbar layout, colors and background match the site.
  • Analytics: with Google Analytics connected, opens, page views and link clicks are reported.

Setting it up takes a few minutes: create a flipbook from the PDF, choose the view mode and paste the shortcode into the page. Our step-by-step guide to turning a PDF into a flipbook on WordPress has screenshots of each step, and which view mode to use explains the choice between scrolling and turning pages.

Good for anything readers should actually read: catalogs, magazines, brochures, reports, manuals and menus.

Which one to use

  • People will download it anyway (a form, a price list): a download link.
  • An internal page read on desktop: the File block.
  • The file already lives in Google Drive and the look doesn’t matter: a Drive embed.
  • Anything customers should read on your site, on any device: a PDF viewer plugin.

Questions about embedding PDFs

Why doesn’t my embedded PDF show on my phone?

The File block relies on the browser’s built-in PDF viewer, and most phone and tablet browsers do not show PDFs inside a page. Visitors see a download button instead. A viewer plugin draws the pages itself, so it works on phones.

Can I stop people from downloading the PDF?

You can remove the download and print buttons in a viewer plugin, and keep the original file private by converting it to page images on your server with an addon such as PDF Tools. No method can stop a determined visitor from taking screenshots, so treat it as making copying harder, not impossible. Our guide to selling or protecting a flipbook covers members-only previews.

Is an embedded PDF good for SEO?

Search engines index PDF files on their own, but the page around the embed is what usually ranks. Give the page a real title and a few paragraphs about the document, so it can be found even when the PDF itself is not what people search for.

My PDF is too large to upload. What now?

That is the WordPress upload limit, set by your host. Ask them to raise it, or upload the file by FTP and point the viewer at its address. Large files are also slow to open; our loading speed checklist shows how to shrink them.

Does it work with Elementor?

A viewer plugin’s shortcode works in Elementor’s Shortcode widget, and Real3D also has an Elementor addon with its own widget. The File block is for the block editor only.

Comparing viewer plugins? Our guide to the best flipbook plugins for WordPress puts prices and features side by side.

More from the blog

All posts

Turn your PDFs into flipbooks

Catalogs, magazines and brochures with a realistic page flip, on WordPress, Shopify, Wix or any website.