Skip to content Skip to main navigation Skip to footer

Hide Image Paths in Elementor, Divi, and Page Builders with WP Ghost

Moved

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

View on new site

Hide WordPress image paths in Elementor, Divi, Thrive, and other page builders using WP Ghost’s (formerly Hide My WP Ghost) Change Paths in Cached Files feature. Page builders save background images and custom CSS in static cache files that WP Ghost cannot rewrite in real time. Enable one toggle and WP Ghost rewrites paths inside those cached files automatically, with no speed impact.

Why Page Builders Need Extra Configuration

WP Ghost changes WordPress paths in real time during page generation. But page builders like Elementor, Divi, Thrive Architect, and WPBakery save their output as static CSS and HTML files in cache directories. When a visitor loads your page, the server delivers these pre-built files directly without running them through WordPress. That means WP Ghost never gets a chance to rewrite the paths inside them.

The result: your page source shows custom paths for most content, but background images and builder-generated CSS still reference /wp-content/uploads/ or /wp-content/plugins/. Scanners and theme detectors spot these inconsistencies.

How to Fix: Enable Change Paths in Cached Files

Go to WP Ghost > Tweaks. Switch on Change Paths in Cached Files. Click Save.

WP Ghost now rewrites paths inside all cached CSS, JS, and HTML files in the background. This covers Elementor CSS cache, Divi static CSS, WP Rocket minified files, LiteSpeed Cache, WP Super Cache, and any other caching or builder plugin that generates static files.

Path rewriting happens in the background after cache files are generated, not during page loads. Visitors experience the same cached performance. The only difference is cached files contain custom paths instead of default WordPress paths.

Elementor background image paths showing wp-content/uploads references that need to be hidden

This replaces the old HMW_FORCEPATH method

Earlier versions of WP Ghost required adding define(‘HMW_FORCEPATH’, true) to wp-config.php. The Change Paths in Cached Files feature replaces this workaround entirely. It is faster, does not affect loading speed, and works automatically. You no longer need the wp-config.php constant.


After Enabling

Clear your page builder’s CSS cache after enabling this feature. In Elementor, go to Elementor > Tools > Regenerate CSS. In Divi, go to Divi > Theme Options > Builder > Advanced > Static CSS File Generation and toggle it off then on. For other builders, look for a “Regenerate” or “Clear CSS” option in their settings. WP Ghost will process the newly generated files with custom paths.

Verify by viewing your page source and searching for “wp-content”. If no matches appear in background-image CSS properties, the feature is working correctly.


Troubleshooting

Background images still show old paths

The builder’s CSS cache was generated before the feature was enabled. Regenerate the builder’s CSS cache (Elementor: Tools > Regenerate CSS; Divi: toggle Static CSS off/on). Then clear your WordPress caching plugin cache and CDN cache. View source in a private browser to confirm.

Elementor editor stopped working after changing paths

The Elementor editor relies on admin-ajax.php and REST API calls. If you changed the wp-admin path or admin-ajax.php path in Ghost Mode, the editor may not connect properly. Try switching to Safe Mode temporarily while editing, then switch back to Ghost Mode after saving. Also ensure the REST API is not disabled for logged-in users.

Custom cache directory not detected

If your builder or caching plugin uses a non-standard cache directory, WP Ghost may not find it automatically. In WP Ghost > Tweaks, click Set Custom Cache Directory and enter the path to your builder’s CSS cache folder.


Frequently Asked Questions

Does this slow down my website?

No. Path rewriting happens in the background after cache files are generated, not during page loads. Visitors experience the same cached performance. This replaced the older HMW_FORCEPATH method which did affect loading speed by forcing dynamic file loading.

Which page builders are compatible?

All of them. WP Ghost works with Elementor, Divi, Thrive Architect, WPBakery (Visual Composer), Beaver Builder, Brizy, Oxygen, and any other builder that generates static CSS files. The feature rewrites paths in any cached file regardless of which plugin created it.

Do I still need the HMW_FORCEPATH constant in wp-config.php?

No. The Change Paths in Cached Files feature replaces HMW_FORCEPATH completely. If you previously added this constant, you can safely remove it from wp-config.php.

Do I need this if I do not use a caching plugin or page builder?

No. If your site generates all pages dynamically without any caching, WP Ghost rewrites paths in real time during WordPress page generation. This feature is specifically for sites that serve pre-built static files.

Does WP Ghost modify WordPress core files?

No. WP Ghost modifies contents of cached files generated by your caching or builder plugin, not WordPress core files. Original CSS, JS, and PHP files remain untouched. Only static copies in the cache directory are rewritten.


Change Paths in Cached Files – the full tutorial covering all caching plugin scenarios.

Change the Uploads Path – set the custom uploads path that builder images reference.

Compatibility Plugins List – confirmed compatible builders and caching plugins.

Customize All WordPress Paths – change all paths before enabling cache rewriting.

Website Security Check – verify your configuration after making changes.