Auto-Expiring Private Links in WordPress: 4 Easy Steps Without Passwords
By default, auto-expiring private links in WordPress do not exist. Once someone has a protected file link, they have access forever – unless you use a tool designed to change that. That is exactly what Private Magic Links, an extension for Prevent Direct Access Gold, solves. It automatically expires and renews every protected file link on your site, with no manual work required.
🔒 Why Don’t Private File Links Expire by Default in WordPress?
WordPress does not have a built-in mechanism to expire download links. When you protect a file using a plugin like Prevent Direct Access Gold, the file itself is blocked from direct access. That means the real file URL is hidden. However, the private download link that gets generated – the one you share with users – has no expiry date by default. In other words, once that link is out there, it works indefinitely.
Here is why that matters: if an authorized user shares that link with someone who should not have access, there is nothing stopping that person from downloading your file. The link keeps working. That is not a security flaw in the plugin – it is simply how private links work unless you add an expiry layer on top.
🪄 What Is Private Magic Links and How Does It Work?
Private Magic Links is an extension for the Prevent Direct Access Gold plugin. It adds one key layer of protection: every protected file link on your site is automatically replaced with a temporary token – a magic link – that expires after a preset time. When the token expires, it is automatically removed and a new one is generated in its place. Your authorized users always see a valid link. Anyone trying to use an expired link gets an error.
That means the link is self-destructing and self-renewing at the same time. You set the expiration time once, and the extension handles everything from that point forward – across all your pages and posts, automatically.

Before you read further.... Free Download (PDF)
Secret Side Door
Secret Google Search Tactic That Will Skyrocket Your Sales, Connect You to the Perfect Partners, Influencers & Affiliates and Send Your Google Rankings Soaring! FREE when you sign up for Digital Creators Edge, a free newsletter for Digital Creators who wish to take their business to the next level.
How to Create Auto-Expiring Private Links in WordPress Without a Password
Here is the full step-by-step process to set up auto-expiring private links in WordPress using Prevent Direct Access Gold and the Private Magic Links extension.
Step 1: Install and Activate the Plugin and Extension
Install and activate the PDA plugin – both the free and Gold versions – in your WordPress dashboard, along with the Private Magic Links extension. Once activated, go to PDA Settings and enable Auto-protect New File Uploads and Generate Download Link Once Protected. Hit Save Changes. This ensures every file you upload from this point forward is protected automatically.
Step 2: Configure Your Magic Links Settings
Go to PDA Settings, then click the Magic Links tab. Set the default expiration time – this is how long each magic link stays valid before it expires and is replaced. Then select which user roles are allowed to access your magic links. Search and Replace is already enabled by default. That means the extension automatically replaces your protected file URLs with magic links across all your pages and posts. Hit Save Changes. Set it once – it applies to every protected file going forward.
Step 3: Protect Your File and Embed It
Go to Media Library and upload your file. Since Auto-protect New File Uploads is already enabled, your file is protected automatically. Next, go to the page where you want to embed it. Embed your protected file and Save or Publish.
Now go to the frontend and right-click on the download link. Open the URL in a new window – notice it is not pointing to the real file. It is a private token. That is your magic link. Once the expiration time runs out, try that same URL again – you get an error. The link is dead. Go back to the original page and reload it. Open the file URL once more – the token has changed. A new magic link was generated automatically. No manual work needed.
Step 4: Set Per-User Download Limits and Share the Link
Need more control over who downloads what and how many times? Back in the Media Library, click Configure File Protection on the protected file and go to the Shared Private Link tab. Select which user roles can access the file, set a download limit – for example, 2 downloads – and a download expiry in days. Hit Save. A shared private link is generated instantly. Copy it and send it directly to your audience. Each user’s download limit and expiry tracking starts from their very first click – independently from everyone else.
🔗 How to Share Private WordPress Files Without a Password
The answer is to use auto-expiring magic links instead of static private links. With Private Magic Links, you do not need to set a password on your files or pages. Instead, every authorized user sees a link that is valid for a preset time. When it expires, the link stops working for anyone who has it – and a new one is automatically generated for your content. No passwords. No manual updates. No shared links that live forever.
❓ Frequently Asked Questions
Do private file links in WordPress expire by default?
No. By default, private file links in WordPress do not expire. Once someone has the link, they have access indefinitely. You need an extension like Private Magic Links to add automatic expiry.
What is a magic link in WordPress?
A magic link is a temporary private URL generated by the Private Magic Links extension for Prevent Direct Access Gold. It replaces the real file URL with a token that expires after a preset time and is automatically renewed.
How do I create auto-expiring download links in WordPress?
Install Prevent Direct Access Gold and the Private Magic Links extension. Go to PDA Settings, click the Magic Links tab, set your expiration time, and hit Save. The extension automatically replaces all protected file URLs with expiring magic links across your site.
Can I set per-user download limits with Private Magic Links?
Yes. Using the Shared Private Link tab inside the file configuration popup, you can set which user roles can access a file, how many times each user can download it, and how many days their access lasts from their first click.
Does Private Magic Links work without a password?
Yes. Private Magic Links does not require passwords. It uses expiring tokens to control access. Authorized users see a valid link. Anyone trying to use an expired link gets an error – no password required on either end.
Video Transcript
By default, private file links don’t expire. Once someone has the link, they have access forever. Here’s how to change that.
Prevent Direct Access Gold blocks direct access to your files. Private Magic Links is an extension that automatically expires and renews your protected file links – no manual work needed. Let’s set it up.
Step 1: Install and activate the PDA plugin – both the free and Gold versions – in your WordPress dashboard, along with the Private Magic Links extension.
Step 2: Configure your Magic Links settings. Go to PDA Settings, then click the Magic Links tab. Set the default expiration time, and select which user roles can access your magic links. Search and Replace is already enabled by default – it automatically replaces your protected file URLs with magic links across all your pages and posts. Hit Save Changes. Set it once – it applies to every protected file going forward.
Step 3: Protect your file and embed it. Go to Media Library and upload your file. Once it’s in your library, select it and click Configure File Protection. Then click Protect this file. The file is now blocked – nobody can access it directly. Next, go to the page where you want to embed it. Embed your protected file and Save or Publish. Now go to the frontend and right-click on the download link. Open the URL in a new window – notice it’s not pointing to the real file, it’s a private token. That’s your magic link. Once the expiration time runs out, try that same URL again – you get an error. The link is dead. Now go back to the original page and reload it. Open the file URL once more – the token has changed. A new magic link was generated automatically – no manual work needed.
Step 4: Set per-user download limits and share the link. Need more control over who downloads what and how many times? Back in the Media Library, click Configure File Protection on the protected file and go to the Shared Private Link tab. Select which user roles can access the file, set a download limit – for example, 2 downloads – and a download expiry in days. Hit Save. A shared private link is generated instantly. Copy it and send it directly to your audience. Each user’s download limit and expiry tracking starts from their very first click – independently from everyone else.
Subscribe for more WordPress security tutorials.