Skip to content Skip to main navigation Skip to footer

Customize WordPress Uploads Directory with WP Ghost (Virtual Path Method)

Moved

This tutorial has moved to the new WP Ghost Knowledge Base where each feature is presented in detail.

View on new site

Change the WordPress uploads directory URL with WP Ghost (formerly Hide My WP Ghost) to hide /wp-content/uploads/ from your source code. WP Ghost uses virtual URL rewrite rules, so your files stay in place and nothing breaks. No need to edit wp-config.php or physically move files. Deactivating restores all original URLs instantly.

Two Approaches: Physical vs Virtual

There are two ways to change the WordPress uploads directory. They do fundamentally different things:

wp-config.php method (physical)WP Ghost method (virtual, recommended)
Changes where WordPress stores new uploadsChanges how upload URLs appear in source code
Old files stay in old location, new files go to new folderAll files stay in /wp-content/uploads/, URLs change everywhere
Requires FTP access and file editingOne field in WP Ghost settings, no code editing
Cannot be reversed without moving files backDeactivating WP Ghost restores all defaults instantly
Does not hide existing media URLsHides all media URLs, existing and new

For security purposes, the WP Ghost method is the right choice. It changes the URL that appears in your page source without moving any files. Bots and scanners see the custom path. Your server reads from the original location. Nothing breaks, and everything is reversible.


How to Change the Uploads Path with WP Ghost

Go to WP Ghost > Change Paths > WP Core Security. Find the Custom Uploads Path field. Enter a custom name (e.g., “storage” instead of “uploads”). Click Save.

WP Ghost Custom Uploads Path field showing uploads changed to storage

Your media URLs immediately change from yourdomain.com/wp-content/uploads/ to yourdomain.com/wp-content/storage/ (or whatever custom name you choose). If you have also changed the wp-content path, the entire URL changes. For example, if wp-content is renamed to “core” and uploads to “storage”, your media URLs become yourdomain.com/core/storage/.

No files are moved

WP Ghost does not physically change the uploads directory. It uses URL rewrite rules. Your media files stay in /wp-content/uploads/ on the server. The FTP directory structure is unchanged. Deactivating WP Ghost restores all original URLs instantly.

After saving, clear your cache and verify in a private browser window. Right-click any image on your site, select “Copy image address,” and confirm the URL shows your custom path.


Alternative: The wp-config.php Method

If you need to physically change where WordPress stores uploads (not just the URL), you can add this to wp-config.php:

define( 'UPLOADS', 'wp-content/storage' );

This tells WordPress to store new uploads in a folder named “storage” inside wp-content. For a folder outside wp-content (e.g., yourdomain.com/storage/), use:

define( 'UPLOADS', 'storage' );

Important: this method only affects new uploads. Existing media files stay in the old location. It also does not hide existing media URLs in your source code. For security purposes, the WP Ghost virtual path method is more effective because it changes all URLs (existing and new) without moving files.


Frequently Asked Questions

Can I use both methods at the same time?

It is not recommended. The wp-config.php method changes the physical upload location. WP Ghost changes the URL path. Using both creates a mismatch that may cause issues. Choose one approach. For security, use WP Ghost. For actually relocating files to a different server directory, use wp-config.php.

Will existing images break with the WP Ghost method?

No. WP Ghost uses URL rewrite rules that serve files from the original /wp-content/uploads/ location through the new URL. Your physical files do not move. Every existing image keeps loading normally. If you see issues, clear your cache.

Should I also change the wp-content path?

Yes, for complete protection. Changing just the uploads path still leaves /wp-content/ visible in the URL. Change the wp-content path first, then change uploads within it for maximum CMS hiding.

Does this work with WooCommerce product images?

Yes. WooCommerce stores product images in wp-content/uploads. WP Ghost’s path change automatically applies to product images, gallery thumbnails, and downloadable files.

Is this a free feature?

Yes. Changing the uploads path is available in the free version of WP Ghost.

Does WP Ghost modify WordPress core files?

No. All URL changes use rewrite rules. Your files, directories, and FTP structure are completely untouched. Deactivating restores all defaults.


Change the wp-content/uploads Path – the detailed uploads path tutorial with troubleshooting and Nginx guidance.

Change the wp-content Path – hide the parent directory for complete URL obfuscation.

Redirect Images from Old Paths – redirect external links pointing to old image URLs.

Customize All WordPress Paths – change every path in one guide.

Website Security Check – verify your configuration after making changes.