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 really like having my code all properly indented and all, but all the code generated by wordpress, like the one that appears on the header when we use wp_head(), loses all the indentation.

I think it doesn't really matter, neither the users nor the search engines give a s**t about the code being indented or not, but when it comes to debugging, it really helps a lot.

Do you know of any plugin or option or something to fix this?

share|improve this question
up vote 2 down vote accepted

I don't think correct global indentation is possible without massive (and inefficient) output buffering to change it.

Since you are primarily interested in this for debug purposes I suggest using some tool that will format and color-code output (of any page btw, not just those that you control).

Firebug and View Source Chart work nicely for me.

share|improve this answer
thanks, I didn't knew this plugin, thanks! He's right though, as WordPress doesn't separate html from php it's almost impossible without rewriting a whole bunch of code. I've made some minor attempts located here klanten.corvannoorloos.com/html5, but it has made me rewriting a whole lot of code (starting with almost every widged) – Cor van Noorloos Jan 31 '12 at 19:57

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.