Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer 1

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, 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.