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.

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.

Step 1: Set sharing to public
- Open Google Drive and right-click your PDF.
- Choose Share.
- Under General access, switch from "Restricted" to Anyone with the link.
- Set the role to Viewer.
- 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:
- Edit the page or post.
- Click the plus icon and add a Custom HTML block.
- Paste the iframe code.
- Use the Preview tab inside the block to check it renders.
- 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.
| Setting | Recommended value | Why |
|---|
| URL ending | /preview | /view is blocked inside frames |
| Width | 100% with a max width | Fits desktop and mobile |
| Height or ratio | 640px or 3/4 | Shows a full portrait page |
| Border | 0 | Removes the default frame outline |
| Sharing | Anyone with the link, Viewer | Visitors 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.

| Symptom | Likely cause | Fix |
|---|
| "drive.google.com refused to connect" | Used the /view URL | Switch to /preview |
| "You need access" or request access screen | File is still restricted | Set to Anyone with the link |
| Gray box, nothing loads | Iframe stripped by WordPress or a plugin | Use Custom HTML block, check roles |
| Works for you, not for visitors | You are logged in to Google | Test in incognito |
| Sign-in loop on Safari | Third-party cookies blocked | Offer a direct link as backup |
| "Too many users" message | Drive download quota hit | Wait, 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:
- Edit the page while logged in as an Administrator.
- Disable security plugins one at a time and test again.
- Look for a Content Security Policy header that blocks
frame-src for Google. Your host or a security plugin may be adding it.
- 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.

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.

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.
| Method | Setup time | Mobile experience | Privacy options | Tracking | Best for |
|---|
| Drive iframe | 5 minutes | Fair | Public only in practice | None | Quick public handouts |
| WordPress File block | 3 minutes | Often download only | Depends on hosting | None | Small, simple files |
| PDF embed plugin | 10 minutes | Good | Varies by plan | Limited | Sites already using plugins |
| Flipbook embed | 5 minutes | Excellent | Password protection | Analytics on Professional | Catalogs, 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.

Upload and convert your PDF
- Go to Flipbooks AI and create an account.
- Click to start a new flipbook and upload your PDF. Download it from Drive first if that is where it lives.
- 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
- Copy the direct link if you want to share by email or social media.
- Add password protection for private content such as client proposals or internal manuals.
- 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.
| Feature | Drive iframe | Flipbooks AI |
|---|
| Watermarks or Google branding | Drive toolbar visible | No watermarks |
| Password protection | No | Yes |
| Page-turning effect | No | Yes |
| Video and audio on pages | No | Yes |
| Reader analytics | No | Professional plan |
| Lead generation | No | Professional plan |
| Offline downloads | Via Drive only | Yes |
| Custom branding | No | Yes |
Real Scenarios by Site Type
Different sites need different answers. A few examples:

- 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 case | Recommended method | Reason |
|---|
| One page public flyer | Drive iframe or File block | Fast, free, good enough |
| Multi-page catalog | Flipbook embed | Page turning and speed |
| Private proposal | Password-protected flipbook | Access control |
| Frequently updated price list | Digital Price List Generator | Easy updates, clean layout |
| Annual report | Flipbook with analytics | Track readers |

A Quick Pre-Publish Checklist
Before you hit Publish, run through this list:
✅ 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.

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.