Support » Themes and Templates » Tabs vs Spaces for Indentation in Theme HTML

  • The WordPress coding standard doc says to use real tabs and not spaces for HTML (and PHP), but when I “view source” for my theme in the browser those tab characters result in really messy HTML (see screenshot: ).

    Is the only solution to use less indentation in the source code? If those tabs were replaced with spaces, the code, when viewing source, suddenly becomes far more readable (

    I understand the reasoning behind keeping a standard, I’m just wondering if anyone else has come up against this problem and what discussion, if any, has been had about it. If someone can point me to existing discussion on this topic, that would be great.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Andrew Nevins


    Forum moderator

    I’m not sure the view-source code matters, aren’t the standards referring to the actual template files?

    I was less concerned with how it looked and more concerned with the performance impact of all that unnecessary whitespace.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Tabs vs Spaces for Indentation in Theme HTML’ is closed to new replies.