If you sell digital products in WooCommerce, there is a real risk that customers share their download links with others. When that happens, unauthorized users can access your files for free, without ever making a purchase. The good news is you can stop this completely by requiring users to log in before any download is allowed.
In other words, once login is required, a shared link simply does not work for anyone who is not authenticated. The system checks identity before granting access.
๐บ Watch the Full Tutorial
See the complete setup in action, including a live test of a blocked shared link, in the video below:
๐ Why WooCommerce Download Links Can Be Shared (and Abused)
By default, WooCommerce generates download links that are tied to an order but not to a logged-in session. That means a customer can copy the link and forward it to anyone. Anyone with that link, whether they paid or not, can potentially download your file.
This is a significant vulnerability for anyone selling eBooks, courses, templates, audio files, or any other digital product. The solution is to add an authentication layer so the download system checks who is requesting the file before allowing access.
๐ The Solution: Prevent Direct Access Plugin
The most reliable way to stop WooCommerce download links from being shared is to use the Prevent Direct Access plugin. It integrates directly with WooCommerce and lets you assign file access permissions by user role โ so only logged-in, authorized users can download your products.
Here is how the logic works: when a user clicks a download link, the plugin intercepts the request, checks whether the user is logged in, and either grants or denies access based on the permission rules you set. Shared links shown to non-logged-in users return an error message instead of the file.
โ๏ธ Step-by-Step Setup to Require Login for WooCommerce Downloads
Step 1: Change the WooCommerce Download Method
In your WordPress dashboard, go to WooCommerce โ Settings โ Products โ Downloadable Products. Change the Download Method to Redirect Only. Save your changes.
This setting ensures that WooCommerce redirects download requests through a controlled URL rather than serving the file directly โ a necessary foundation for permission-based access.
Step 2: Protect Your File in the Media Library
- Go to your Media Library and select the digital file you want to protect.
- Click Protect, then open Configure File Protection.
- In the pop-up window, navigate to File Access Permission.
- Set access to Logged-In Users.
That means only users who are actively logged into your site can access the file. Anyone who is not logged in โ including someone who received a shared link โ will be blocked immediately.
Step 3: Upload the Protected File to Your WooCommerce Product
Once the file is protected, upload it to your WooCommerce product as you normally would. The Prevent Direct Access plugin automatically appends _pda to the file path. This suffix signals to WooCommerce that the file is now under permission control and should not be served without authentication.
๐งช Testing: Does the Blocked Link Actually Work?
After setup, the recommended way to verify everything is working is to complete a real test purchase, copy the generated download link, and then open it in an incognito browser window โ where you are not logged in.
The result should be an error message, not a file download. That confirms the permission layer is active and shared links are effectively blocked for unauthorized users.
๐ซ What Happens When Someone Tries to Use a Shared Link
When an unauthorized user attempts to access a protected download link, they will see an error message. They are not redirected to the file โ they are denied at the permission check. This applies whether the link was shared via email, message, or social media.
That means even if your customer forwards the exact download URL to a friend, that friend cannot access the file without being logged in to an account that has the correct access permissions.
โ Summary: How to Stop WooCommerce Download Links from Being Shared
To protect your digital products and stop unauthorized file sharing in WooCommerce:
- Install the Prevent Direct Access plugin (free version available; Gold version recommended for full protection)
- Set the WooCommerce download method to Redirect Only
- Assign Logged-In Users file permission to your protected media files
- Upload the
_pda-tagged file to your WooCommerce product
Once this is configured, shared download links stop working for anyone who is not logged in and authorized. Your digital products stay protected, and only paying customers with active sessions can access what they purchased.