pdf conversionsharingtutorialsonline tools

Embed Google Drive PDF in WordPress: Iframe Steps, Not Working Fixes, Alternatives

Want a Google Drive PDF to show up inside a WordPress page? This article walks through the iframe method step by step, explains why the embed shows a blank box or an access error, lists quick fixes, and compares better alternatives, including a page-turning flipbook.

Embed Google Drive PDF in WordPress: Iframe Steps, Not Working Fixes, Alternatives
Cristian Da Conceicao

You uploaded a PDF to Google Drive, pasted a snippet into WordPress, and got a gray box, a sign-in prompt, or the dreaded "drive.google.com refused to connect." It happens to almost everyone who tries it. The good news is that the Google Drive iframe method works well once the sharing settings, the URL format, and the WordPress block are all correct. This article shows the exact steps to embed a Google Drive PDF in WordPress, the fixes for each common error, and a few alternatives when Drive simply is not the right tool. If you would rather skip the troubleshooting entirely, a PDF to flipbook converter from Flipbooks AI gives you a cleaner embed in a couple of minutes.

Why Embed From Google Drive?

Google Drive is where most PDFs already live: price lists, menus, reports, class handouts, brochures. Embedding straight from Drive feels natural because there is nothing new to upload and no plugin to buy. Edit the file in Drive, and the embedded version updates, usually after a short delay.

Hands typing on a laptop with a cloud storage folder on screen

What the iframe actually does

An iframe is a small window inside your page that loads another web address. When you embed a Drive PDF, WordPress is not hosting the file at all. Your visitor's browser asks Google to render a preview inside that window. That is why sharing permissions, cookies, and Google's own framing rules matter so much, and why most failures come from outside WordPress.

When this method makes sense

Drive embeds are a good fit when:

  • The document is public and you do not mind Google branding around it.
  • The file changes often and you want updates without re-uploading.
  • You need a free, five-minute solution for a single page.

They are a poor fit for private documents, large catalogs, or anything where the reading experience and tracking matter. We will get to those cases below.

Embed a Drive PDF in 5 Steps

Here is the standard process. Follow it in order, because skipping the sharing step is the number one cause of blank embeds.

Low-angle view of a monitor showing a website editor with an embed block

Step 1: Set sharing to public

  1. Open Google Drive and right-click your PDF.
  2. Choose Share.
  3. Under General access, switch from "Restricted" to Anyone with the link.
  4. Set the role to Viewer.
  5. Click Done.

⚠️ If the file sits in a Google Workspace account, your admin may block public sharing. In that case the embed will fail for everyone outside your organization, no matter what you do in WordPress.

Step 2: Grab the file ID

Click Copy link. It will look roughly like this:

https://drive.google.com/file/d/1AbCdEfGhIjKlMnOpQrStUvWxYz/view?usp=sharing

The long string between /d/ and /view is the file ID. Copy it somewhere handy.

Step 3: Build the iframe

Change the ending of the URL from /view to /preview. This detail matters. The /view page is a full Drive interface and Google tells browsers not to show it inside frames, which triggers the "refused to connect" message. The /preview address is built for embedding.

Your code looks like this:

<iframe src="https://drive.google.com/file/d/YOUR_FILE_ID/preview" width="100%" height="640" allow="autoplay"></iframe>

You can also get a ready-made snippet from Drive: open the PDF, click the three-dot menu, choose Open in new window, click the three dots again, and select Embed item.

Step 4: Paste into a Custom HTML block

In the WordPress block editor:

  1. Edit the page or post.
  2. Click the plus icon and add a Custom HTML block.
  3. Paste the iframe code.
  4. Use the Preview tab inside the block to check it renders.
  5. Click Update or Publish, then open the live page in a private window.

💡 Always test in a private or incognito window. Your own browser is logged in to Google, so it can show a working embed that your visitors never see.

Make it responsive

A fixed pixel width breaks on phones. Wrap the iframe in a container and let CSS handle the proportions:

<div style="position:relative;width:100%;aspect-ratio:3/4;max-width:800px;margin:auto;"><iframe src="https://drive.google.com/file/d/YOUR_FILE_ID/preview" style="position:absolute;inset:0;width:100%;height:100%;border:0;" allow="autoplay"></iframe></div>

A 3:4 ratio roughly matches a portrait letter or A4 page. For landscape slide decks, use 16/9 instead.

SettingRecommended valueWhy
URL ending/preview/view is blocked inside frames
Width100% with a max widthFits desktop and mobile
Height or ratio640px or 3/4Shows a full portrait page
Border0Removes the default frame outline
SharingAnyone with the link, ViewerVisitors need no Google account

Why the Embed Is Not Working

When the embed breaks, the symptom usually points straight at the cause. Use the table first, then read the detail.

Top-down view of a desk with a laptop showing a blank frame and a magnifying glass

SymptomLikely causeFix
"drive.google.com refused to connect"Used the /view URLSwitch to /preview
"You need access" or request access screenFile is still restrictedSet to Anyone with the link
Gray box, nothing loadsIframe stripped by WordPress or a pluginUse Custom HTML block, check roles
Works for you, not for visitorsYou are logged in to GoogleTest in incognito
Sign-in loop on SafariThird-party cookies blockedOffer a direct link as backup
"Too many users" messageDrive download quota hitWait, or host the file elsewhere

Blank box or "refused to connect"

This is almost always the URL. If your iframe src ends in /view or contains ?usp=sharing, replace the whole thing with the /preview format shown above. Copy the file ID again if you are unsure.

Access denied and sign-in loops

Two causes show up repeatedly. First, the file is shared with specific people instead of anyone with the link. Second, the visitor is signed in to several Google accounts, and Drive picks the wrong one and says they lack access. You cannot control the second problem, which is one reason Drive embeds feel unreliable on public sites.

WordPress strips the iframe

WordPress filters HTML for users who lack the unfiltered_html capability. Editors and authors on multisite networks, or sites with locked-down roles, often see their iframe vanish after saving. Check these in order:

  1. Edit the page while logged in as an Administrator.
  2. Disable security plugins one at a time and test again.
  3. Look for a Content Security Policy header that blocks frame-src for Google. Your host or a security plugin may be adding it.
  4. Confirm you are in a Custom HTML block and not a Paragraph block.

⚠️ Never paste random iframe code from a stranger into a Custom HTML block. An iframe can load anything, so only embed addresses you trust.

A man leaning toward his laptop with a puzzled expression in a sunlit kitchen

Quota and mobile problems

Popular public files can hit Google's view and download limits, and the preview then fails for a day or so. Phones add another wrinkle: the Drive preview window is small, the pop-out icon is tiny, and pinch zooming inside an iframe fights with page scrolling. If a large share of your visitors are on mobile, test on a real phone before you call it done.

💡 Add a plain text link under the embed, such as "Open the PDF in a new tab." It rescues visitors whenever the iframe fails.

Alternatives Worth Trying

Drive is only one way to show a PDF. Here are the most common options, with the tradeoffs spelled out.

Over-the-shoulder view of a tablet showing a digital brochure in a boutique

Native WordPress File block

Upload the PDF to your Media Library and add a File block. WordPress shows an inline viewer and a download button, using the browser's built-in PDF reader. It is simple and does not depend on Google. The downsides: the experience varies by browser, many mobile browsers show only a download link, and large files slow your hosting.

PDF embed plugins

Plugins such as PDF Embedder and similar tools render the file with a JavaScript viewer, which gives more consistent results than raw browser readers. Free versions are often limited, and premium tiers add toolbars, downloads control, and mobile layouts. You also add another plugin to maintain and update.

A hosted flipbook embed

A flipbook service turns the PDF into a page-turning reader that loads quickly and looks the same everywhere. Because it lives on its own domain, you avoid WordPress filtering and Google's framing rules. The embed is a short snippet you paste into the same Custom HTML block.

MethodSetup timeMobile experiencePrivacy optionsTrackingBest for
Drive iframe5 minutesFairPublic only in practiceNoneQuick public handouts
WordPress File block3 minutesOften download onlyDepends on hostingNoneSmall, simple files
PDF embed plugin10 minutesGoodVaries by planLimitedSites already using plugins
Flipbook embed5 minutesExcellentPassword protectionAnalytics on ProfessionalCatalogs, menus, reports

Create a PDF Flipbook Instead

If your PDF is a brochure, catalog, menu, or report, the reading experience matters as much as the embed. Here is how to create a flipbook with Flipbooks AI and place it in WordPress.

Colleagues reviewing a website with a catalog page on a large monitor

Upload and convert your PDF

  1. Go to Flipbooks AI and create an account.
  2. Click to start a new flipbook and upload your PDF. Download it from Drive first if that is where it lives.
  3. Wait a moment while the pages convert. The result is a realistic page-turning flipbook, with no watermarks, ever.

You can also open the PDF to Flipbook Converter directly if you want a focused starting point.

Customize the look

  • Add your logo and brand colors so the viewer matches your site.
  • Pick page effects and background styles.
  • Add video and audio to specific pages, which a Drive preview cannot do.
  • Check the layout on a phone, since flipbooks are mobile responsive by design.

Set sharing options

  1. Copy the direct link if you want to share by email or social media.
  2. Add password protection for private content such as client proposals or internal manuals.
  3. Copy the embed code and paste it into a Custom HTML block in WordPress, just like the Drive iframe. The Embed Flipbook on Website page explains the options.

Analytics and lead capture

On the Professional plan, you can see how many people opened the flipbook, which pages held their attention, and capture leads before a visitor reads. You can also allow offline downloads for readers who want a copy. Compare the options on the pricing page. Unlimited flipbooks come with the Standard plan and above.

FeatureDrive iframeFlipbooks AI
Watermarks or Google brandingDrive toolbar visibleNo watermarks
Password protectionNoYes
Page-turning effectNoYes
Video and audio on pagesNoYes
Reader analyticsNoProfessional plan
Lead generationNoProfessional plan
Offline downloadsVia Drive onlyYes
Custom brandingNoYes

Real Scenarios by Site Type

Different sites need different answers. A few examples:

A hand holding a smartphone showing a webpage with a document viewer on a cafe terrace

  • A restaurant posting a weekly menu can keep the Drive iframe if the menu is one page. For a multi-page wine list with photos, the Restaurant Menu Creator reads far better on phones.
  • A real estate agent sharing property brochures benefits from a flipbook with tracking, so they see which listings attract readers. The Real Estate Brochure Creator fits this case.
  • A school or club publishing a monthly newsletter can use the Drive iframe if the audience is small and public. A School Newsletter Creator adds polish.
  • A retailer with a seasonal catalog needs fast loading and clean mobile pages. A Digital Catalog Maker is a better home than a Drive preview.
  • A consultant sending proposals needs privacy. Drive's public link is a poor choice here, and a password-protected flipbook solves it.
Use caseRecommended methodReason
One page public flyerDrive iframe or File blockFast, free, good enough
Multi-page catalogFlipbook embedPage turning and speed
Private proposalPassword-protected flipbookAccess control
Frequently updated price listDigital Price List GeneratorEasy updates, clean layout
Annual reportFlipbook with analyticsTrack readers

Walnut desk with a laptop and printed reports under a warm desk lamp

A Quick Pre-Publish Checklist

Before you hit Publish, run through this list:

  • File sharing is set to Anyone with the link, Viewer role.
  • The iframe uses the /preview address.
  • The code sits in a Custom HTML block.
  • The container is responsive and tested on a phone.
  • You checked the page in a private window and in a second browser.
  • A fallback text link sits below the embed.

✅ Test again a week later. Sharing settings, plugin updates, and security headers change over time, and an embed that worked on launch day can quietly break.

Woman at a window desk reviewing a laptop with a simple analytics chart

Pick Your Method and Publish

For a single public PDF, the Drive iframe is perfectly fine: set sharing to public, use the /preview address, paste it into a Custom HTML block, and test in a private window. When it fails, the fix is nearly always one of the same few things: the wrong URL ending, restricted sharing, a stripped iframe, or a cookie issue.

When the document represents your business, such as a catalog, menu, or report, give readers a better experience. Ready to try it? Create your free account on Flipbooks AI, convert your PDF, and paste the embed code into WordPress. Browse all flipbook tools to find the template that fits your project, or compare pricing plans when you are ready for analytics, lead capture, and unlimited flipbooks.

Share this article

Choose your language

FreeTurn any PDF into a flipbookFree, No Credit CardRealistic Page TurnsShare With One LinkCreate a Flipbook