victorunique
victorunique

Reputation: 320

Prevent auto html entities in wordpress

Apache 2
Php 5.2.9
Mysql 5.077
Wordpress 3.5.1

After I installed wordpress, I chose a theme named 'Sliding Door'. Then, I turned to write a front page. After I finished it and pressed 'Publish', the raw html content suddenly turned into html entities, just like this:

When edit in Text Editor, not Visual Editor:

This is an example page.It might say something like this: <blockquote>

After press 'Publish', still in Text Editor:

This is an example page. It might say something like this: &lt;blockquote&gt;

This also happened when I wrote Posts and Text Widget, like some global configures preventing me to submit html codes. It always converted my content into plain text automatically. So weird.

Is there something wrong with the apache? Or something wrong with php? Or something wrong with Wordpress? Or with Mysql?

Upvotes: 0

Views: 1228

Answers (2)

ZZ-bb
ZZ-bb

Reputation: 2167

So you're not filtering your input at all right now? That's risky. I would filter everything even if I were the only user of the blog/application.

I don't know how Wordpess works but try and set your default editor from WYSIWYG to HTML if you prefer using HTML code. Or allow more HTML tags in the editor. See for example: http://www.catswhocode.com/blog/killer-hacks-to-enhance-wordpress-editor

You could also try Pure HTML plugin.

Upvotes: 0

victorunique
victorunique

Reputation: 320

I finally find the solution. It was the php filter that changed my content. To solve it, I just changed the 'filter.default' variable in /etc/php.ini from 'special_chars' to 'unsafe_raw', and then restarted httpd.

Upvotes: 0

Related Questions