How to redirect PDF files in Wordpress without breaking old links

Ever updated a PDF in WordPress and worried about breaking links on your website. Even worse, on external platforms you do not control? It’s a common challenge: WordPress doesn’t natively support redirects for media files like PDFs. But with a clever workaround. You can keep those old links working while seamlessly pointing users to your new file

Issue Background
A client needed to update a PDF stored in their WordPress Media Library. The problem? Changing the filename would break every instance where that file had been shared.

For example:
Old PDF URL: /wp-content/uploads/2024/02/old-document.pdf
New PDF URL: /wp-content/uploads/2025/03/updated-document-v2.pdf

Most WordPress hosts would not process redirects for static files like PDFs. Redirects usually work for pages. Not media assets.

Diagnosis
Standard redirect plugins and server redirects couldn’t handle this scenario. The fix required a creative solution at the file structure level—one that works with WordPress and preserves SEO.

Solution

✔️ Step 1: Rename the Old File
Using SFTP or your hosting file manager, locate the original PDF and rename it, like this:
old-document-old.pdf

✔️ Step 2: Create a “Fake” Directory
Inside the same folder, create a directory using the exact same name as the old file (yes—with the .pdf extension):
/wp-content/uploads/2024/02/old-document.pdf/

✔️ Step 3: Add a Redirect File
In that new folder, create an index.php file containing this redirect code:

php

CopyEdit

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: /wp-content/uploads/2025/03/updated-document-v2.pdf");
exit();
?>

Now, whenever someone clicks the old PDF link, they’ll land on your new, updated version automatically.

Why It Works
➡️ Browsers try to load /old-document.pdf but find a folder instead.
➡️ That folder serves the index.php, which executes a 301 redirect to your new file.
➡️ No broken links. No SEO losses. Just clean user experience.

Final Outcome
✔ No need to manually update old links on your website—or anywhere else.
✔ Users go directly to your new document.
✔ Search engines respect the 301 redirect, maintaining SEO continuity.

Need help improving your WordPress forms or custom workflows? We build clean, reliable, and growth-driven WordPress solutions—without breaking a sweat.

Let’s Talk

Other Resources Post

Fixing WordPress News Imports & Broken Links

Migrating legacy news posts to WordPress revealed messy data and broken links. With smart import tweaks and custom field logic, we transformed it into a clean, working archive.

Fix Missing UTM Tracking in GA4 & GTM

If your UTM tags show in URLs but not in GA4 reports, you're not alone. At Integriti Studio, we solved a real case where missing campaign data in GTM had a surprisingly simple fix.

Migrate WordPress—retain SEO.

Migrating your WordPress site doesn’t have to risk SEO—done right, it preserves rankings, traffic, and user experience while boosting performance, security, and reliability through
smart tools, and best practices.

Powered by Creativity,
Fueled by Caffeine.

Get Started