Fix Frontend Theme Not Loading After Activating 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

If your frontend theme, CSS, or layout stops loading correctly after activating WP Ghost (formerly Hide My WP Ghost), the issue is almost always related to server rewrite rules not being applied. This guide covers every common cause and fix for Apache, Nginx, and LiteSpeed servers.

When WP Ghost changes paths, it writes rewrite rules to your server config file (.htaccess for Apache/LiteSpeed, hidemywp.conf for Nginx). If those rules are not loading, the new CSS and JS paths return 404 errors. The browser cannot find the stylesheets, and the theme appears broken or unstyled. The paths themselves are correct; the server just is not processing the rules.

Step-by-Step Troubleshooting

1. Clear All Caches

This is the most common cause. Clear your browser cache, WordPress caching plugin (WP Rocket, LiteSpeed Cache, W3 Total Cache, etc.), CDN cache (Cloudflare, BunnyCDN), and server-level cache. The path change significantly alters the site structure, and cached pages still reference old URLs until refreshed.

2. Run the Frontend Test

Go to WP Ghost > Change Paths and click the Frontend Test button. WP Ghost checks if the new paths are loading correctly and shows server configuration instructions if any are needed. Follow the instructions for your server type.

3. Check Your .htaccess File (Apache/LiteSpeed)

Open your .htaccess file via FTP or File Manager. Look for the WP Ghost rewrite rules block. It starts with # BEGIN HMWP_RULES and ends with # END HMWP_RULES. If this block is missing, WP Ghost could not write to the file. Re-save WP Ghost settings to trigger the rules being written again.

Also check for duplicate WordPress rewrite blocks. Some WordPress versions create duplicate entries in .htaccess. Look for two copies of this block:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

If you see this block duplicated, remove one copy and save the file.

4. Verify AllowOverride All (Apache)

On Apache servers, .htaccess rules only work if AllowOverride All is set for your website directory. If it is set to None (the default on some hosts and cloud platforms), all .htaccess rules are ignored, including WP Ghost’s rules and even WordPress permalinks. See the AllowOverride guide or the Google Cloud setup for instructions.

5. Add Rules to Nginx Config (Nginx Servers)

Nginx does not use .htaccess files. WP Ghost generates a hidemywp.conf file that needs to be included in your Nginx server block. Add the include line to your nginx.conf or sites-enabled config, then restart Nginx with sudo nginx -s reload. See the Nginx server setup guide for full instructions.

6. Check Text Mapping Rules

If the layout loads but looks broken (wrong colors, spacing, or missing elements), the issue may be Text Mapping rules that renamed CSS class names in the HTML but not in the CSS files. Go to WP Ghost > Mapping > Text Mapping and check if any rules are affecting class names your theme depends on. Try disabling Text Mapping temporarily to confirm.

7. Switch to Safe Mode or Lite Mode

If the issue only happens in Ghost Mode, switch to Safe Mode temporarily. Ghost Mode changes wp-admin and admin-ajax.php paths, which some themes and plugins may not handle correctly. Safe Mode skips these two paths while still protecting everything else. If Safe Mode works, the issue is specifically with the wp-admin or admin-ajax.php path change.

8. Emergency Recovery

If your site is completely broken and you cannot access the dashboard, use the Safe URL parameter to bypass WP Ghost temporarily. If that does not work, rename the WP Ghost plugin folder via FTP (wp-content/plugins/hide-my-wp/ to hide-my-wp-disabled/). This deactivates the plugin and restores all default paths. See the Emergency Disable guide for full instructions.


Frequently Asked Questions

Why does the theme break only in Ghost Mode but not Safe Mode?

Ghost Mode changes the wp-admin and admin-ajax.php paths in addition to everything Safe Mode changes. Some themes and plugins make AJAX calls using hardcoded wp-admin/admin-ajax.php URLs. When this path changes, those calls fail. Switch to Safe Mode and keep wp-admin and admin-ajax.php at their defaults while customizing everything else.

I see the WP Ghost rules in .htaccess but the theme is still broken. What else could it be?

Check for other plugins that modify .htaccess and may have overwritten or repositioned WP Ghost’s rules. Plugins like BulletProof Security, iThemes Security, or caching plugins can reorganize .htaccess. Re-save WP Ghost settings after saving any other plugin that modifies .htaccess to restore the correct rule order.

How do I know if my server is Apache or Nginx?

SSH into your server and run apachectl -v (Apache) or nginx -v (Nginx). If you do not have SSH access, check your hosting control panel or ask your hosting provider. Many managed hosts (WP Engine, Kinsta, Flywheel) use Nginx.

Can I prevent this from happening in the future?

Enable Prevent Broken Website Layout in WP Ghost > Advanced > Rollback Settings. This automatically rolls back path changes if the frontend fails to load correctly after saving.

Does WP Ghost modify WordPress core files?

No. WP Ghost writes rewrite rules to .htaccess (Apache) or hidemywp.conf (Nginx). No core files are modified. Deactivating restores all default paths.


Set AllowOverride All on Apache – fix .htaccess rules being ignored.

Nginx Server Setup – add WP Ghost rules to Nginx config.

Emergency Disable Guide – recover access if paths cause issues.

Advanced Settings and Rollback – Safe URL, rollback, and recovery options.

Compatibility Plugins List – known plugin conflicts and fixes.