What is Text Mapping in WP Ghost?

Text Mapping in WP Ghost is a powerful feature that helps hide or replace identifiable class names and IDs in your website’s source code.
It is designed to hide the fact that your site is built with WordPress, making it more secure and less vulnerable to attacks or theme detection tools.
How Does Text Mapping Work?
Text Mapping works by replacing default WordPress class names, such as wp-image
or wp-block
, with custom names defined by you. It dynamically updates these class names and IDs in your site’s code, including HTML, JavaScript, and CSS files, to ensure seamless functionality while hiding traces of WordPress.
Why is it Essential to Use Text Mapping?
Hackers and theme detectors often scan website source codes to identify WordPress sites by looking for specific class names and IDs. Text Mapping helps prevent this by masking or randomizing these class names, thereby reducing your website’s visibility to bots and potential attacks.
- Improved Security – Reduces the risk of automated attacks targeting WordPress vulnerabilities.
- Hide WordPress CMS– Hides WordPress-specific markers, making detection difficult.
- Customization – Allows you to replace class names with custom labels or even random names.
- Flexibility – Offers options to hide classes entirely or assign unique, randomized names.
- Easy Configuration – Simple setup through WP Ghost’s user-friendly interface.
How to Use Text Mapping in WP Ghost
Activate Safe Mode or Ghost Mode
Begin by activating Safe Mode or Ghost Mode to open the path customization process.
- Access your WordPress dashboard after installing and activating the WP Ghost plugin.
- Select Safe Mode or Ghost Mode. Safe Mode provides basic protection, while Ghost Mode offers more advanced security features.

Activate Text Mapping
After enabling Safe Mode or Ghost Mode in WP Ghost and customizing the paths, check the source code for class names used by WordPress and dedicated plugins like Elementor or Woocommerce. Activate Text Mapping to replace these class names that might expose your site’s structure to bots or scanners.
- Go to WP Ghost > Overview > Features section.
- Switch on the Text Mapping feature.
- Click on Start Features Setup link to access the feature setting.

Add New Text Mapping
To change a class name using Text Mapping, follow these steps:
- Go to WP Ghost > Mapping > Text Mapping feature.
- Identify the class name in the source code that need to be replaced.
- Add the class name you want to change into the left field.
- Add the custom class name into the right field.

Note! Some Theme Detectors are looking for classes that are used by WordPress plugins and they will jump to say that you’re using WordPress CMS even if you don’t have any WordPress common path.
To make this task even easier, you’ll find predefined WordPress classes in this section of WP Ghost that you can automatically add to text mapping. (shown in the screenshot below)

To add a predefined WordPress class to text mapping, click on the class you want to add to the list.
Once you’ve added a predefined WordPress class from the list, it will disappear from the list. This way, you’ll know which predefined classes you’ve already added to text mapping.
As some themes may use different classes listed here, we recommend that you:
- verify the frontend after changing the classes to ensure that the theme you are using is not affected;
- check to make sure the class changes have been correctly implemented in your site’s source code.
To completely hide a class, you can use the pattern {blank} which will hide the class name but won’t change its name.
e.g. class_name => {blank}
To give a class a random name, you can use the pattern {rand}. This way, the new name will be different every time.
e.g. class_name => {rand}
Read more: WP Ghost Advanced Text Mapping
Text Mapping in CSS and JS files
It’s essential to decide how far you want to go to hide class names like wp-block, elementor, and woocommerce.
To hide plugins that use the class name in Javascript and Style, you must also dynamically change the classes and IDs in all JS and CSS files to prevent Javascript and Style errors.
- Go to WP Ghost > Mapping > Text Mapping.
- Switch on the Text Mapping in CSS and JS files option.


NOTE! Enabling this option will create dynamic CSS and JS files, which will may slow down the site’s loading time. This is why we recommend you use a cache plugin to optimize your website’s loading speed and cache the CSS and JS files.
Read more: Hide plugins like WooCommerce and Elementor
Optimize CSS and JS files
If this option is activated, WP Ghost will activate the caching process for the website’s static files, such as CSS, JS, and Images.
Note! Use this option only if you don’t have a cache plugin installed.
To activate this feature,
- Go to WP Ghost > Mapping > Text Mapping.
- Switch on the Optimize CSS and JS files option.

The optimization process will add in the config file optimizations such as:
Header append Vary: Accept-Encoding SetOutputFilter DEFLATE AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript ExpiresDefault "access plus 1 month"
+ and more.
This will definitely help the website’s loading speed for static files like CSS, JS, especially if you are loading these files dynamically using the Text Mapping in CSS and JS files option.
Here are a few tools that you can use to test your website’s speed: