Support » Requests and Feedback » Content type: shouldn’t it be text/xml xhtml ?

  • I do like WordPress, I really do. I also like the fact that xhtml is used for semantic interpretation of the pages. But I’m wondering one thing:

    Why aren’t the pages served with the content type text/xml+xhtml as xhtml should be served? I may be a bit too puristic, but doing this would be a nice final touch in my opinion… (and of course IE could be excepted by browser sniffing) .

    I won’t mind modifying the wordpress php files myself, but it’d be helpful if anyone knew where to put the php command for altering the content type 😉 .

Viewing 4 replies - 1 through 4 (of 4 total)
  • You’re looking for header('Content-type: application/xhtml+xml'); which should go into your /wp-blog-header.php file.

    Good luck!

    (also, if you’re interested in it, you can serve to IE as application/xml and then use a simple XSLT stylesheet to trick IE into serving the content as XML see my site here:

    A better option is to change the content type that WordPress sends automatically. To do that in WordPress, visit the following address on your WP installation:


    You’ll see a long list of option settings. Scroll down to ‘html_type’ and edit that (as enricopulatzo noted, it should be application/xhtml+xml). The Update Settings button is all the way at the bottom.

    Just be sure you know what you’re getting with this.

    As WordPress doesn’t check for validity and well-formedness of user input, you cannot rely on WP to always produce valid and well-formed XHTML. This means that the smallest mistake will make (part of) your site inaccessible — all browsers that accept real XHTML will display an error message instead of the content. Do you really want to go that way?

    I know what I’m talking about, because I have used real XHTML myself for some time. It is not impossible, but it is impractical.

    All: here’s a simple plugin to set the correct MIME type if the user agent accepts application/xhtml+xml.

    I also plan on adding IE support (but that takes xslt added to the mix).


Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Content type: shouldn’t it be text/xml xhtml ?’ is closed to new replies.