Yes. When you change the /wp-content/uploads/ path in WP Ghost, all links to PDFs, images, videos, audio files, and other documents are rewritten automatically on the frontend. Every link in your posts, pages, RSS feed, sitemap, and theme templates updates to use the new path. No manual editing, no database search-and-replace, and no broken links. Your files stay physically where they are, only the URLs change.
How the Rewrite Works
WP Ghost creates virtual paths through URL rewrite rules. When you set a custom uploads path, the plugin tells your web server: “when a request comes in for /storage/2025/03/file.pdf, serve it from /wp-content/uploads/2025/03/file.pdf.” Your PDF stays exactly where WordPress put it. Only the URL visible to visitors and bots changes. This means:
Every link updates automatically. WP Ghost processes the HTML output before it reaches the visitor. Any link containing /wp-content/uploads/ gets replaced with your custom path (for example /storage/) as the page is served.
Files never move. Your PDFs, images, and documents stay at their original /wp-content/uploads/ location on disk. No FTP shuffling, no risk of losing files, no permissions issues.
Deactivating the plugin restores the original URLs instantly. Since no files were moved, turning off WP Ghost or the uploads path change reverts every link back to /wp-content/uploads/ with no cleanup needed.
Example: Before and After
| File Type | Default URL | After WP Ghost (path renamed to /storage/) |
|---|---|---|
| PDF document | /wp-content/uploads/2025/03/brochure.pdf | /storage/2025/03/brochure.pdf |
| Image in a post | /wp-content/uploads/2025/03/photo.jpg | /storage/2025/03/photo.jpg |
| Video file | /wp-content/uploads/2025/02/demo.mp4 | /storage/2025/02/demo.mp4 |
| Downloadable ebook | /wp-content/uploads/2024/12/guide.epub | /storage/2024/12/guide.epub |
| WooCommerce product image | /wp-content/uploads/2025/01/product.jpg | /storage/2025/01/product.jpg |
What Gets Rewritten Across Your Site
The uploads path rewrite covers every place an uploads URL can appear:
Inline content. PDF links embedded in posts and pages, inline images, video embeds, and audio players. If you inserted a media file through the block editor or a page builder like Elementor, it gets rewritten.
Featured images and galleries. Post thumbnails, gallery blocks, and slider plugins that pull images from the media library all use the new path.
WooCommerce assets. Product images, variation images, gallery thumbnails, downloadable files (PDFs, zip files sent to customers after purchase) all get the custom path treatment.
RSS feeds and sitemaps. Image URLs in your RSS feed entries use the new path. If you run Yoast, Rank Math, or another SEO plugin that generates image sitemaps, those reflect the change automatically.
Theme templates. Images hardcoded in theme files (like logos or hero banners) that point to uploads directory URLs also get rewritten.
How to Set Up the Uploads Path Rewrite
- Go to WP Ghost > Change Paths > Level of Security and activate Safe Mode or Ghost Mode.
- Open WP Ghost > Change Paths > WP Core Security.
- Find the Custom Uploads Path field. WP Ghost suggests a random name by default, but you can use anything (avoid predictable words like “media”, “files”, “images”, or “uploads”). Something like
storage,assets-box, orvaultworks well. - Click Save.
- Clear your cache (WordPress cache plugin, CDN cache, browser cache) so cached pages pick up the new URLs.
Full walkthrough in the Change wp-content/uploads Path with WP Ghost tutorial.
What About Links From External Sites
If another site links directly to one of your PDFs at the old /wp-content/uploads/ URL, you have two options. By default, old URLs still work because WP Ghost creates new URLs without blocking the old ones. If you want maximum security (old URLs returning 404 instead), enable Hide WordPress Common Paths. If you need old links to keep working but serve through the new path, set up automatic redirects with the redirect images from old paths feature. That way external backlinks keep their SEO value while everything routes through the secured path.
Why This Matters for Hack Prevention
Upload URLs are the most visible WordPress fingerprint in your public content. Every image a visitor sees, every PDF they download, every media embed exposes /wp-content/uploads/ right in the page source. Bots scanning for WordPress sites use these patterns as one of their primary confirmation signals. Changing the path removes that fingerprint from every blog post, product page, and downloadable document. Combined with renaming /wp-content/, /plugins/, and /themes/, your entire file structure becomes unrecognizable to automated scanners.
Frequently Asked Questions
Does WP Ghost rewrite PDF links automatically?
Yes. When you change the uploads path, WP Ghost rewrites every PDF link (and every other media URL) on the frontend automatically. You do not need to edit posts, update links, or run a search-and-replace on the database. The rewrite is handled at the server level as pages are served.
Will my existing PDF links break?
No. WP Ghost uses URL rewrites, not file moves. Your PDFs stay in the original /wp-content/uploads/ directory on your server. The plugin creates virtual URLs that point to the same files through the new path. Visitors click a link and see the new URL, but they download the same file from the same physical location.
Does this work with WooCommerce downloadable products?
Yes. WooCommerce stores downloadable files (PDFs, zip files, ebooks) in the uploads directory like any other media. The rewrite applies to them too, so customers receive download links with the custom path, and the actual downloads work without issues. WP Ghost is fully compatible with WooCommerce.
What about PDFs linked from external sites?
By default, old /wp-content/uploads/ URLs still work, so external backlinks continue loading the files. If you want stronger security, enable Hide WordPress Common Paths to return a 404 on old URLs. For backlink-sensitive sites, use the redirect from old paths feature, which sends traffic through the new path while preserving SEO value.
Will this affect SEO or Google Image Search rankings?
Not negatively. Content URLs do not change, only asset URLs do. Search engines re-crawl your media and update the index over time. To speed this up, resubmit your sitemap in Google Search Console after making the change. If you use the redirect feature for old paths, image authority consolidates to the new URLs cleanly.
Does the rewrite apply to PDFs in cached pages?
Only after the cache refreshes. Cached HTML pages still contain the old paths until regenerated. Clear your cache immediately after saving the WP Ghost setting. Enable Change Paths in Cache Files under WP Ghost > Tweaks so future cache regenerations include the custom paths. See the Change Paths in Cached Files guide.
Does this work with a CDN?
Yes, with one setup step. Your CDN needs to know about the new path so it can serve the files. Most CDNs (Cloudflare, BunnyCDN, KeyCDN) handle this through origin-pull rules automatically. If yours caches by path and still serves old URLs, purge the CDN cache. See the CDN URL Mapping tutorial for setup.
Does WP Ghost modify WordPress core files or move my PDFs?
No. WP Ghost never moves, renames, or modifies any file. Your PDFs and all other media stay in /wp-content/uploads/ where WordPress put them. The rewrite is handled through URL rules in .htaccess (Apache/LiteSpeed) or hidemywp.conf (Nginx). Deactivating WP Ghost restores original URLs instantly.