Need help? Check out our Support site, then


Why are my posts automatically modified?

  1. Why does WordPress strip out certain elements from my posts, such as <center> and style attributes??

    What I type in:
    <br /> <center>this text is centered</center></p> <p>Here is a table with a background-image specified in the style block:<br /> <table id="thetable" name="thetable" style="background-image: url(http://is1.okcupid.com/graphics/politics/chart_political.gif);" border="0" cellpadding="0" cellspacing="0" height="375" width="375"><tbody><br /> <tr height="31"><br /> <td width="212"></td><br /> <td width="162"></td><br /> </tr><br /> <tr height="343"><br /> <td width="212"></td><br /> <td align="left" valign="top" width="162"><br /> <img src="http://is1.okcupid.com/graphics/politics_you.gif" border="0"><br /> </td><br /> </tr><br /> </tbody></table><br />

    What gets saved:
    <br /> this text is centered</p> <p>Here is a table with a background-image specified in the style block:<br /> <table border="0" cellpadding="0" cellspacing="0" width="375"><tbody><br /> <tr><br /> <td width="212"></td><br /> <td width="162"></td><br /> </tr><br /> <tr><br /> <td width="212"></td><br /> <td align="left" valign="top" width="162"><br /> <img src="http://is1.okcupid.com/graphics/politics_you.gif" border="0"><br /> </td><br /> </tr><br /> </tbody></table><br />

  2. It's being changed because inline styles are a security risk; people could sneak javascript into them and potentially hack other people's blogs. It's frustrating, but not quite as frustrating as being hacked.

    (On the other hand, I imagine <center>'s getting stripped because it's been deprecated since forever and nobody wants to whitelist it. See whether they let you have <div align="center"> instead.)

  3. Hmm, never heard of javascript hacking via inline styles.

    Is this a danger in comments or just in posting? And if I use wordpress on my own site, can I disable that "feature"?

    And if they're going to remove <center> for me, they should automatically replace that with <div style="text-align:center"> - wait, that's not allowed >:( - <div align="center">

Topic Closed

This topic has been closed to new replies.

About this Topic