Fix Theme Not Loading or Slow Website After Activating WP Ghost
June 6, 2020
This tutorial has moved to the new WP Ghost Knowledge Base where each feature is presented in detail.
If your theme is not loading correctly or your site loads slower after activating WP Ghost, the rewrite rules are likely not being read by the server. Check that your server config file contains the WP Ghost rules and that the server is processing them, not WordPress.
What Causes This Issue
WP Ghost rewrites URLs through server configuration files: .htaccess on Apache/LiteSpeed, hidemywp.conf on Nginx, or web.config on IIS. When these rules are loaded by the server, they execute instantly with zero performance impact.
If the server does not read the configuration file (because AllowOverride is disabled, the Nginx config was not reloaded, or the rules were removed by another plugin), WP Ghost falls back to handling redirects through WordPress PHP. These PHP-based redirects use more server resources and load noticeably slower. They can also cause the theme to render incorrectly because CSS and JS files may not resolve properly.
WP Ghost detects this situation and shows a warning notification:

If you see this notification, your rewrite rules need to be fixed. Follow the instructions below for your server type.
Fix for Apache and LiteSpeed Servers
On Apache and LiteSpeed, WP Ghost writes rewrite rules to the .htaccess file in your WordPress root directory. If these rules are missing or the server is ignoring .htaccess, the redirects fall back to WordPress PHP.
Check 1 – Verify the Rules Exist in .htaccess
Open your .htaccess file using sFTP or File Manager. Look for a block starting with #BEGIN HMWP_RULES and ending with #END HMWP_RULES:
# BEGIN HMWP_RULES <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^([_0-9a-zA-Z-]+/)?ajax$ /wp-admin/admin-ajax.php [QSA,L] RewriteRule ^([_0-9a-zA-Z-]+/)?custom-admin/(.*) /wp-admin/$2 [QSA,L] .......... </IfModule> # END HMWP_RULES
If these rules are missing, another plugin (like BulletProof Security) may have removed them when it saved its own settings. Go to WP Ghost > Change Paths and click Save to regenerate the rules.
After saving, set .htaccess to read-only (permission 0444) to prevent other plugins from overwriting the rules. See How to Set .htaccess to Read-Only.
Check 2 – Make Sure AllowOverride Is Enabled
Even if the rules exist in .htaccess, Apache will ignore them if AllowOverride None is set in the server configuration. You need AllowOverride All for .htaccess rules to work.
Follow these guides to enable AllowOverride:
Set AllowOverride All on Apache Servers
Enable AllowOverwrite on Google Cloud Platform
Check 3 – LiteSpeed with CyberPanel (OpenLiteSpeed)
If you use CyberPanel with OpenLiteSpeed, you need to specify the .htaccess path in the OpenLiteSpeed configuration. OpenLiteSpeed does not auto-detect .htaccess the same way Apache does.
Configure .htaccess in OpenLiteSpeed
Fix for Nginx Servers
On Nginx, WP Ghost generates a hidemywp.conf file that must be included in your Nginx server block. If the include directive is missing or Nginx was not reloaded after the rules were generated, the redirects fall back to WordPress PHP.
1. Verify that your Nginx server block contains the line include /path/to/wordpress/hidemywp.conf;
2. Reload Nginx with sudo nginx -s reload
For the complete Nginx setup, see these guides:
Setup WP Ghost on Nginx Server
Setup WP Ghost on Nginx with VPS
Fix for Windows IIS Servers
On IIS servers, WP Ghost writes rewrite rules to the web.config file. The IIS URL Rewrite 2 module must be installed for these rules to work.
1. Verify that the rules exist in web.config.
2. Confirm that the IIS URL Rewrite 2 module is installed on the server.
3. Restart IIS after making changes.
Setup WP Ghost on Windows IIS Server
Fix for Managed Hosting Providers
Managed hosting providers use custom server configurations that may require additional steps. If your site loads slowly or the theme breaks after activating WP Ghost, follow the setup guide for your specific host:
Amazon Bitnami Server, WP Engine, InMotion Hosting, GoDaddy, AWS Lightsail, Flywheel, Kinsta, WPMUDEV, RunCloud, Ploi.
Text Mapping in CSS and JS Files Can Slow Down Your Site
There is a separate issue that can cause slower loading, independent of server configuration. If you activate Text Mapping in CSS and JS files in WP Ghost > Mapping, all CSS and JS files are loaded dynamically through PHP instead of being served as static files. This adds processing time on every page load.
This feature replaces class names and IDs inside CSS and JS files to remove WordPress fingerprints from stylesheets. While it improves detection resistance, it has a performance cost. If you use a cache plugin like Autoptimize or WP Rocket that combines CSS and JS into single files, the impact is minimized because the combined files get cached.
If performance is your priority, we recommend switching off the Text Mapping in CSS and JS option. It does not improve security, it only hides class names from theme detectors. The path security and firewall features provide the actual hack prevention. For more details, see the Text Mapping and URL Mapping tutorial.
Frequently Asked Questions
How do I know if the rules are loaded by the server or by WordPress?
WP Ghost detects this automatically. If the rewrite rules are being handled by WordPress PHP instead of the server config file, you will see a warning notification in the WP Ghost settings page after visiting your site as a logged-out visitor. If no warning appears, the rules are being loaded correctly by the server.
Another plugin keeps removing my WP Ghost rules from .htaccess. What do I do?
Some security plugins (notably BulletProof Security) overwrite the entire .htaccess when they save their settings, removing WP Ghost’s rules. Two solutions: set .htaccess to read-only (0444) after saving WP Ghost settings, or enable Add Rewrites in WordPress Rules Section in WP Ghost which places the rules inside the WordPress rewrite block where other plugins are less likely to remove them.
My site works but CSS and images load slowly. Is that normal?
No. If the server rules are loaded correctly, CSS and images should load at the same speed as before. Slow loading means the rules are being processed through WordPress PHP instead of the server. Check the appropriate section above for your server type.
Should I disable Text Mapping in CSS and JS?
If you notice a performance impact, yes. Text Mapping in CSS and JS only hides class names from theme detectors. It does not add security against hack attacks. Path security and the 8G Firewall are what prevent actual attacks. If you want to keep Text Mapping active, use a cache plugin that combines CSS and JS files to minimize the performance cost.
Does WP Ghost modify WordPress core files?
No. WP Ghost uses server rewrite rules and WordPress hooks. No core files are moved, renamed, or modified. Deactivating the plugin restores all default paths instantly.