Plugin Loading Hook

Control when WP Ghost initializes during the WordPress loading process to resolve conflicts with caching plugins and site management tools. By default, WP Ghost loads at the standard WordPress init hook. If a caching plugin processes content before WP Ghost can modify paths, or if a management tool like ManageWP conflicts with the loading order, changing the Plugin Loading Hook fixes the issue. Four loading options are available, from Must Use Plugin (earliest) to Late Loading (latest). This is a free feature.

What Is the Plugin Loading Hook?

What is the WP Ghost Plugin Loading Hook and how it controls initialization timing for cache compatibility

The Plugin Loading Hook controls at which point during WordPress execution WP Ghost starts its output buffering and path modification process. WP Ghost needs to capture and modify the HTML output before it’s sent to the browser. If another plugin (especially a caching plugin) captures that output first, WP Ghost’s path changes don’t get applied. Changing the loading hook forces WP Ghost to start earlier or later in the execution sequence to work around these conflicts.

When to Change the Loading Hook

Most users never need to change this setting. WP Ghost’s default Normal Loading works with the majority of hosting environments and plugins. Change it only when you see one of these specific symptoms:

Custom paths appear in the source code but old WordPress paths still show. Your caching plugin processes the HTML before WP Ghost can replace the paths. Try switching to Must Use Plugin or Priority Loading to make WP Ghost capture output earlier.

ManageWP or similar site management tools conflict with WP Ghost. ManageWP loads as a Must Use plugin and can interfere with WP Ghost’s initialization. Switch WP Ghost to Must Use Plugin Loading so both run at the same level.

Path changes work on uncached pages but not on cached pages. The cache was generated before WP Ghost processed the output. Try Priority Loading so WP Ghost starts its buffer before the caching plugin. Also see Change Paths in Cached Files for an alternative approach.

The Four Loading Options

From earliest to latest in the WordPress execution sequence:

Must Use Plugin – WP Ghost loads from the wp-content/mu-plugins directory, before any regular plugin initializes. This is the earliest possible loading point. Use this for ManageWP compatibility or when all other options fail to resolve caching conflicts.

Priority Loading – WP Ghost starts its output buffer before other regular WordPress plugins initialize. Earlier than Normal but doesn’t require the mu-plugins directory. Try this first when caching plugins prevent path changes.

Normal Loading (default) – WP Ghost starts its output buffer on the init hook with priority 10. This is the standard WordPress plugin loading behavior and works for most environments.

Late Loading – WP Ghost starts its output buffer on the template_redirect hook with PHP_MAX_INT priority. This is the latest possible loading point. Use this when other plugins need to run their initialization before WP Ghost processes the output.

Start with Normal Loading. Only change if you experience a specific conflict. If Normal doesn’t work, try Priority Loading next, then Must Use Plugin. Use Late Loading only when explicitly recommended by WP Ghost support.

How to Change the Loading Hook

  1. Go to WP Ghost > Advanced > Compatibility.
  2. Select the loading option from the Plugin Loading Hook dropdown.
  3. Click Save.
WP Ghost Plugin Loading Hook dropdown in Advanced Compatibility showing Must Use, Priority, Normal, and Late Loading options

After saving, clear your site’s cache (if using a caching plugin) and verify in an incognito browser that custom paths are working correctly in the HTML source code.

Compatible Caching Plugins

WP Ghost is optimized to work automatically with the most popular caching plugins. These require no loading hook changes under normal circumstances: WP-Rocket, Autoptimize, CDN Enabler, Breeze, Cache-Enabler, Comet Cache, Hummingbird, Hyper Cache, LiteSpeed Cache, Powered Cache, W3 Total Cache, WP Super Cache, WP Fastest Cache, and SiteGround Optimizer.

If you use one of these plugins and path changes aren’t applying, the issue is more likely a cache that needs clearing than a loading hook problem. Clear all caches first before changing the loading hook. For detailed cache configuration, see Change Paths in Cached Files.

Troubleshooting

Site breaks after changing the loading hook

Some loading options can conflict with specific hosting configurations. If your site shows errors or a white screen after changing the hook, use the Safe URL parameter to temporarily bypass WP Ghost, then change the loading hook back to Normal Loading. If you can’t access the dashboard, use the emergency disable guide or add a constant in wp-config.php.

Must Use Plugin option creates a file in mu-plugins

This is expected behavior. The Must Use Plugin option creates a loader file in wp-content/mu-plugins/ so WP Ghost initializes before regular plugins. If you switch back to Normal Loading, WP Ghost removes the mu-plugins file automatically. If it doesn’t get removed (rare), you can safely delete it manually via FTP.

Paths still show in cached pages after changing the hook

The old cached pages still contain the original paths. Clear all caches after changing the loading hook: your caching plugin’s cache, server-level cache (Varnish, Nginx FastCGI), and CDN cache. Then verify in an incognito browser. Also enable Change Paths in Cached Files if available.

Frequently Asked Questions

What loading option should I use?

Normal Loading for most sites. Only change if you experience a specific caching or compatibility conflict. The escalation path is: Normal > Priority Loading > Must Use Plugin. Late Loading is a special case for when other plugins need to initialize first.

Is Must Use Plugin safe?

Yes. Must Use plugins are a standard WordPress feature. WP Ghost creates a small loader file in the mu-plugins directory that initializes its output buffering early. It doesn’t modify any other files. Switching back to Normal Loading removes the file automatically.

Does this work with WooCommerce?

Yes. All four loading options are compatible with WooCommerce. If you experience checkout or cart issues after changing the hook, switch back to Normal Loading. WP Ghost is fully compatible with WooCommerce.

Does WP Ghost modify WordPress core files?

No. The Must Use Plugin option creates a loader file in the mu-plugins directory (a standard WordPress location for early-loading plugins), but no WordPress core files are modified. All other loading options work entirely through WordPress hooks.

Resolve caching and compatibility issues: