Servers

WP Ghost on Local by Flywheel Setup Guide

WP Ghost works with Local by Flywheel (now called Local) when using the Nginx server option. Local is a popular local WordPress development tool that runs WordPress sites on your computer for development and testing. When Local uses Nginx as its web server, you need to manually add WP Ghost’s config file include to the site’s Nginx configuration. If you use Local’s Apache option instead, WP Ghost works automatically via .htaccess with no extra setup needed.

Why Local by Flywheel Requires Extra Setup

Local by Flywheel lets you choose between Apache and Nginx as the web server for each site. When using Apache, WP Ghost writes rewrite rules to .htaccess and everything works automatically. When using Nginx, WP Ghost generates a config file (hidemywp.conf) containing the rewrite rules, but you need to manually include this file in Local’s Nginx configuration (conf/nginx/site.conf.hbs). You also need to tell WP Ghost that you’re running on Local by Flywheel so it generates the correct config file path.

Step 1: Set the Server Type to Local by Flywheel

  1. Go to WP Ghost > Advanced > Compatibility.
  2. Find the Server Type setting.
  3. Select Local by Flywheel.
  4. Click Save.

This step is essential. Setting the server type tells WP Ghost to generate the config file at the correct path for Local’s directory structure. Without this, WP Ghost may generate config for a standard Nginx server which uses a different file path.

Step 2: Activate Safe Mode or Ghost Mode

  1. Go to WP Ghost > Change Paths.
  2. Select Safe Mode or Ghost Mode.
  3. Customize paths if desired.
  4. Click Save.

After saving, WP Ghost displays a notification with the include line you need to add to the Nginx config file.

Step 3: Add the Config Include to site.conf.hbs

  1. Copy the include line from the WP Ghost notification: include includes/hidemywp.conf;
  2. Open your Local site folder and navigate to conf/nginx/site.conf.hbs.
  3. Open site.conf.hbs in a text editor.
  4. Add the include line before the WordPress rewrite rules (the location / block).
  5. Save the file.

Placement matters. The include line must be placed before the WordPress rewrite rules in the config file. If placed after, the WordPress rules process first and WP Ghost’s path security won’t work. See the screenshot above for the correct position.

Step 4: Restart the Local Server and Test

  1. In the Local application, click Stop Site then Start Site to restart the Nginx server.
  2. After the server loads, go back to WP Ghost and click Frontend Test.
  3. Check if the frontend and login pages load correctly. You can also verify in a different browser or incognito window.
  4. If everything loads correctly, click “Yes, it’s working”.
  5. If something is broken, click “No, abort” to roll back to previous settings.

Troubleshooting

Frontend test fails after adding the include

Check that the include line is placed before the WordPress rewrite rules in site.conf.hbs, not after. Also confirm the server was restarted after editing the file (stop and start the site in Local). Verify that the file path in the include line matches the location WP Ghost specified in its notification.

Nginx syntax error after editing site.conf.hbs

The include line may have a typo or be placed inside a block where it doesn’t belong. The line should be at the server block level, not inside a location block. Remove the line, restart the server to restore normal operation, then re-add it at the correct position.

Paths work but revert after Local updates

Local may regenerate the site.conf.hbs file during updates or when changing site settings. If your custom paths stop working after a Local update, check that the include line is still present in site.conf.hbs and re-add it if needed.

Frequently Asked Questions

Does this apply if I use Local’s Apache option?

No. If your Local site uses Apache as the web server, WP Ghost writes rewrite rules to .htaccess automatically. No extra setup is needed. This guide only applies to Local sites running on Nginx.

Is this the same as Flywheel hosting?

No. Local by Flywheel (now called Local) is a local development tool that runs WordPress on your computer. Flywheel hosting is a managed WordPress hosting service with its own server infrastructure. They have different setup requirements. For Flywheel hosting, see Flywheel Server Setup.

Do I need to re-edit site.conf.hbs every time I save WP Ghost?

No. The include line references the hidemywp.conf file, which WP Ghost updates automatically when you save settings. You only need to add the include line once. However, you do need to restart the Local server after changing WP Ghost path settings so Nginx reloads the updated config.

Does WP Ghost modify WordPress core files?

No. WP Ghost generates a separate hidemywp.conf file and uses WordPress hooks for application-level changes. No core files are modified. Deactivating WP Ghost restores all defaults instantly.

WP Ghost on other server environments:

John Darrel

Change the WordPress Database Prefix for Security

Replace the default wp_ database prefix with a random one to protect against SQL injection…

1 year

Customize WordPress Uploads Directory | WP Ghost

Change the WordPress uploads directory path with WP Ghost (rewrite rules, no files moved) or…

1 year

WP Ghost and WP Rocket Cache Setup Guide

Configure WP Ghost with WP Rocket cache. Enable file optimization, Change Paths in Cache Files.…

1 year

Why is website security important?

https://youtu.be/6ylhojSi-_E In this video, we’ll explore why website security matters and what can happen if…

1 year

Is WordPress Website Easily Hacked?

The security of your WordPress site depends on multiple factors, such as the strength of…

1 year

Set Up WordPress 2FA with Mobile Authenticator Apps

Step-by-step guides to connect WP Ghost 2FA with Google Authenticator, Authy, Microsoft Authenticator, or LastPass.…

1 year