WooCommerce integration

Sell protected files in WooCommerce — without exposing the download URL

Need to block PDF downloads in WordPress or WooCommerce? WooCommerce's built-in downloadable products hand out direct file links that anyone can share. Media Guard replaces that with server-level file denial, a hardened in-browser viewer, and purchase-gated access — so your customers can view what they paid for, but can't redistribute it.

The problem

WooCommerce downloads aren't protected

WooCommerce's built-in downloadable product feature gives each customer a download link after purchase. That link points to the actual file. Here's what goes wrong:

Links get shared

A customer pastes the download URL in a forum, group chat, or reseller site. Anyone who clicks it gets your file for free.

Files get downloaded and resold

Once a PDF or eBook lands on someone's hard drive, they can upload it anywhere. You lose control permanently.

No viewing protection

WooCommerce has no built-in viewer. It just serves the raw file. No print blocking, no watermarks, no access tracking — nothing.

The solution

Media Guard adds real protection to WooCommerce

Instead of handing out download links, Media Guard streams protected files through a hardened viewer — tied directly to WooCommerce purchase history.

01

Server-level file denial

Protected files live in a directory blocked by .htaccess or NGINX rules. No direct URL access — even if someone guesses the path. The file is never served as a download; it's streamed through an authenticated PHP endpoint.

02

Purchase-gated access

Gate each file to a specific WooCommerce product. Only customers who completed purchase of that product can view the file. Works with HPOS (High-Performance Order Storage) out of the box.

03

Hardened in-browser viewer

PDFs render in a stripped-down PDF.js viewer with the toolbar removed, download button disabled, and print intercepted. The file streams page by page — the full PDF never leaves your server.

04

Print, save, and right-click blocking

Ctrl+S, Ctrl+P, right-click, and drag-to-desktop are all intercepted at the browser level. Combined with the viewer, there's no easy way to extract the content.

05

CSS & dynamic watermarks

Overlay the viewer with the customer's email, name, or purchase date. If they screenshot and share it, the watermark traces it back to them. Agency tier adds burned-in PDF watermarks.

06

Customer download library

Drop the [mediaguard_library] shortcode on any page. It builds a personalized grid of every protected file each customer has purchased — with instant inline viewing.

Setup

Three steps to protected WooCommerce downloads

1

Upload your files

Go to Media Guard → Files in wp-admin. Upload any PDF, EPUB, MP4, MP3, DOCX, or other supported format. Set the access rule to a WooCommerce product.

2

Embed with a shortcode

Paste [mediaguard id="42"] on any page or post. For a full customer library, use [mediaguard_library] — it auto-shows every file the logged-in customer purchased.

3

Customers view — not download

After checkout, your customer sees the file in the hardened viewer. No download link, no exposed URL, no raw file on their device. They view it in the browser, and you stay in control.

30+ file types

Protect more than just PDFs

Every format streams through a secure, authenticated endpoint. No direct download links.

PDF
EPUB
MP4
MP3
DOCX
XLSX
PPTX
WEBM
OGG
WAV
M4A
+ more
Who this is for

Built for anyone selling files in WooCommerce

eBook & digital publishers

Sell PDFs and EPUBs through WooCommerce without worrying about unauthorized redistribution. Customers read in the browser; the file never leaves your server.

Course creators & coaches

Protect lesson PDFs, workbooks, and video modules behind WooCommerce purchases. Gate each module to a different product or bundle.

Agencies & studios

Deliver client reports, brand guidelines, and project files through a branded download portal — all purchase-gated and watermarked.

Membership & subscription sites

Combine WooCommerce Subscriptions with role-based access rules. Subscribers see their files; everyone else sees a purchase prompt.

Compatibility

Works with the WooCommerce you already run

HPOS — High-Performance Order Storage (custom order tables) fully supported.
Block checkout — works with WooCommerce's block-based checkout, no classic checkout dependency.
Stripe & standard gateways — any payment gateway that creates a completed WooCommerce order triggers access.
WooCommerce Subscriptions — combine subscription status with role gating for recurring access control.
WooCommerce 8.0+ — tested and maintained against recent WooCommerce releases.
Questions

WooCommerce + Media Guard FAQ

01 Can Media Guard block PDF downloads in WordPress or WooCommerce?

Yes. You still create a WooCommerce product and sell it through checkout, but Media Guard replaces the shareable file link with a protected viewer. That lets you block PDF downloads in WordPress, intercept print and save actions, and keep the raw file URL hidden from buyers.

02 Do my customers need an account to view files?

Yes — WooCommerce purchase gating requires a logged-in user so the plugin can check their order history. WooCommerce can create accounts automatically at checkout, so there's no extra friction for the buyer.

03 Can I gate different files to different products?

Yes. Each protected file has its own access rule. You can tie File A to Product #1 and File B to Product #2. The [mediaguard_library] shortcode automatically shows each customer only the files they've purchased.

04 What happens if a customer's subscription expires?

If you're using role-based gating tied to a WooCommerce Subscriptions role, access is revoked automatically when the subscription lapses. The customer sees a "purchase required" message instead of the viewer.

05 Does this work with WooCommerce variable products?

Access is gated at the product level. If a customer purchases any variation of a product that's linked to a protected file, they get access to that file.

06 Can customers still download files if I want them to?

The default behavior blocks downloads to protect your content. If you want to allow downloads for specific files, you can use WooCommerce's built-in downloadable product feature alongside Media Guard for files that don't need protection.

Ready?

Start selling protected files today

Install the free version and protect your first two PDFs behind a WooCommerce purchase in under five minutes. Upgrade to Pro when you need unlimited files.