WP Ghost allows you to change the default configuration file/path when the website root path is not writable.
For this, you need access to your server’s Nginx configuration.
Create a Custom Configuration File
- Connect to your server using SSH or your preferred method.
- Create a new file named
hidemywp_custom.conf
inside thewp-content
directory using the following command:
touch /path_to_root/wp-content/hidemywp_custom.conf
Modify Nginx Configuration
Open your Nginx server configuration file using a text editor. The location of this file may vary depending on your system setup. Commonly, it’s located at /etc/nginx/nginx.conf
or in a directory like /etc/nginx/sites-available/
.
- Inside the
server
block of your Nginx configuration, add the following line:
server {
# Other existing configurations...
include /path_to_root/wp-content/hidemywp_custom.conf;
# Other existing configurations...
}
path_to_root
Change path_to_root with the actual path to website root (WordPress instalation folder).
Edit wp-config.php

- Access your WordPress installation folder on the server.
- Locate the
wp-config.php
file and open it in a text editor. - Add the following code snippet at the end of the file, or after WP_DEBUG definition:
add_filter('hmwp_config_file', function(){
return ABSPATH . 'wp-content/hidemywp_custom.conf';
});
Save WP Ghost Settings
- Log in to your WordPress dashboard.
Restart Nginx
- To apply the changes and load the new config path into memory, restart Nginx using the following command:
sudo service nginx restart
Congratulations! You have successfully added a custom config path in WP Ghost for Nginx servers. This custom path enhances the security of your WordPress website by moving the configuration file to a different location, making it harder for potential attackers to locate it.
Please note that whenever you make changes to the custom config path, you must restart Nginx to ensure the modifications take effect.