I have noticed that wordpress loads a bunch of files into the head of a site. This looks really sloppy and discloses vital information about the file structure of a website.

Depending how many plugins are installed a site can easily have 10+ <link> and <script> tags. I understand how these files may work together, but it does look excessive and unorganized.

That said, is there a way to optimize this and somehow combine certain files to reduce the number of files loaded?

There are benefits that can be gained from this, such as improved performance and security.

If anyone has any suggestions please let me know.

2 Answers 2


First of all, search this site. This questions has been answered many times in the past: https://wordpress.stackexchange.com/search?q=clean+wp_head and https://wordpress.stackexchange.com/search?q=security+obscurity

Secondly, there is a difference in what WP loads and what a theme and a plugin will load. Look in the theme functions file to see what the theme loads, i.e. javascripts and CSS. Look in the browser source to see what plugins load; they often load a lot of code via wp_head or wp_footer.

Use Firebug with Firefox, or use the developer tools in Chrome or Safari or IE to see what's loading on your site.


Try using a cache plugin to compress and combine files. You'll get a significant amount of performance, but you have to be aware of javascript and CSS conflicts, test everything first and use the settings that are more appropriate for your site.

Let's say your site is 1.5mb total, you may save 500kb to 1mb with a gzip.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.