If you haven’t already, install and activated the WP Ghost plugin. Then, follow these solutions:
Using Whitelist Paths to Disable WP Ghost
To disable WP Ghost features on specific pages and paths, you need to add the paths to the whitelist paths section.
- Go to WP Ghost > Change Paths > Whitelist Options.
- Enter the slug or relative URL of the pages where you want to disable WP Ghost.
(e.g., if you wish to exclude “sample-page”, you would add “/sample-page/“). - Click Save Settings to apply the changes.

That’s the general method to exclude specific pages from being affected by WP Ghost. However, if you want more flexibility and control, you can use the add_filter
function in your theme’s functions.php
file or a custom plugin.
Using add_filter
to Disable WP Ghost:
Access Your Theme’s functions.php
File
From your WordPress Dashboard, navigate to Appearance > Theme Editor. Find and click on the functions.php
file in the right-hand column.
Add the Custom Filter
At the end of the file, paste the following code:
function disable_hmwp_on_specific_pages($process) {
// Check if we're viewing a specific page by its slug
if (is_page('your-page-slug')) {
return false;
}
return $process;
}
add_filter('hmwp_process_init', 'disable_hmwp_on_specific_pages');
Modify the Code
Replace 'your-page-slug'
with the slug of the page where you want to disable WP Ghost.
If you have multiple pages, you can add additional conditions.
Click ‘Update File’ to save the changes you’ve made to functions.php
.
With that, WP Ghost will be disabled on the specific pages you’ve chosen.
Remember to always back up your website before making any code changes and test it afterward to ensure everything works as expected.