Hide Style IDs from META Tags in WordPress with WP Ghost

Moved

This tutorial has moved to the new WP Ghost Knowledge Base where each feature is presented in detail.

View on new site

Remove style IDs and other meta identifiers from your WordPress source code with WP Ghost. WordPress adds ID attributes to every enqueued stylesheet and script tag. These IDs contain plugin and theme names, making your stack identifiable even when paths are changed.

How to hide IDs from META tags

Go to WP Ghost > Tweaks > Hide Options. Switch on Hide IDs from META Tags. Click Save.

This removes the id=”” attribute from <link>, <style> and <script> tags in your HTML source. For example, id=”woocommerce-general-css” is removed, so the stylesheet tag no longer names WooCommerce. WP Ghost marks this option not recommended: some caching plugins and themes use these IDs to find and load specific styles or scripts. Turn it on, then test your pages.

What it removes

Style IDs on <link> tags (e.g., elementor-frontend-css, woocommerce-layout-css), script IDs on <script> tags, and other meta identifiers that reveal plugin and theme names in the HTML head.

Frequently asked questions

Will removing IDs break my site’s styling?

Usually not, because the IDs aren’t used for CSS styling. Some caching plugins and themes do use them to find and load specific styles or scripts. If a layout or script breaks after you turn the option on, switch it off again and clear your cache.

Does this also remove the generator META tag?

No. Generator META removal is a separate option: Hide WordPress Generator META Tags in the same Hide Options tab. See the Remove Generator META tutorial.

Does WP Ghost modify WordPress core files?

No. IDs are stripped from the HTML output at runtime. Actual files untouched. Disabling restores all original IDs.

Related Articles