Tweaks

Hide Source Map References

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.

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.

John Darrel

Change Database Prefix in WordPress

Because hackers often use bots to search for security flaws in your website, it is…

1 year

Customize WordPress Uploads Directory

The easiest way to change the default media uploads path is to use the WP…

1 year

WP Ghost and WP Rocket Cache

To hide all CSS and JS you need to follow the steps to Combine the…

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

Setting up Two-Factor Authentication (2FA) for WordPress Using Mobile Apps

When you enable two-factor authentication (2FA) for your WordPress website, it adds an extra layer…

1 year