WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 2 down vote accepted

First of all, search this site. This questions has been answered many times in the past: http://wordpress.stackexchange.com/search?q=clean+wp_head and http://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.

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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