What is a Source Map Reference?

Many WordPress themes and plugins load minified CSS and JavaScript files for better performance. To make debugging easier in the browser, developers often add “source map references” at the end of those files.

These references tell the browser where to find extra debugging files (usually .map files) that can recreate the original, unminified source code inside DevTools.

Common examples you may see in your source:

//# sourceMappingURL=app.min.js.map
//# sourceURL=app.bundle.js

And in CSS:

/*# sourceMappingURL=style.min.css.map */

These lines are not visible to normal visitors, but they are visible in the page source and DevTools.

Why Hide Source Map References?

Enabling Hide Source Map References in WP Ghost removes sourceMappingURL and sourceURL directives from frontend output.

Key benefits:

  • Reduced information exposure: Source map references can reveal internal file names, build details, and project structure. If .map files are publicly accessible, they can expose more readable source code in DevTools.
  • Fewer unnecessary requests and 404 noise: Browsers often try to fetch .map files automatically. If they are missing, you can get repeated 404 requests in logs and DevTools.
  • Cleaner frontend output: Removes debugging metadata that is not needed for visitors.

Important note: This does not change how your site works for visitors. It mainly affects debugging convenience in DevTools.

Hide Source Map References

  1. Go to WP Ghost > Tweaks > Hide Options.
  2. Switch on Hide Source Map References.
  3. Click Save to apply the changes.
Hide Source Map References

How to verify it worked

  • Open your site in a browser
  • View page source (or inspect loaded CSS/JS)
  • Search for sourceMappingURL or sourceURL

If the option is enabled, those references should no longer appear in the frontend output.