title: How to Prevent Wordpress to encode html in post
body: <p>As as title, how to prevent wp not to encode html in a post?</p>
  
  <p>currently i just need  to prevent <strong>'&amp;'</strong> change to <strong>'<code>&amp;amp;</code>'</strong>
  The result need to be looks like on editor with html tab mode selected. </p>
  
  <pre><code>$content = $wpdb-&gt;get_row("SELECT post_content FROM $wpdb-&gt;posts WHERE ID=xxx");
  $content = str_replace('amp;','',$content-&gt;post_content);//remove amp;
  
  $wpdb-&gt;query("UPDATE $wpdb-&gt;posts SET post_content = $content WHERE ID = xxx;");
  </code></pre>
  
  <p>but that code still encode the html.</p>
  
  <p>update:
  and also how to implement content filter(prevent to encode some text) in collaboration with <code>wp_insert_post()</code> function</p>
  
  <p>update[SOLVED]: <a href="https://wordpress.stackexchange.com/questions/9301/how-to-prevent-wordpress-to-encode-html-in-post">stackexchange</a></p>
  
  <pre><code>$content = get_post_field('post_content', XXX, 'raw');
  $content = str_replace('amp;', '', $content);
  $wpdb-&gt;update( $wpdb-&gt;posts, array( 'post_content' =&gt; $content ), array( 'ID' =&gt; XXX ) );
  </code></pre>