title: Stop filtering WordPress function wp_insert_post
body: <p>I have to make a few minor changes to a website built in WordPress, and I came across some problems with the wp_insert_content function.  This function sanatizes input, taking some HTML tags completely out (like ) and deleting attributes on others.  I would like to switch this off, and everywhere I find a link to <a href="http://pp19dd.com/2010/06/unfiltered-wp_insert_post/" rel="noreferrer">http://pp19dd.com/2010/06/unfiltered-wp_insert_post/</a> where the solution is to add</p>
  
  <pre><code>'filter' =&gt; true
  </code></pre>
  
  <p>to the posts input array.</p>
  
  <p>This article is from 2010 though, and from what I found an extra line was added in 2011 (<a href="http://web.archiveorange.com/archive/v/TDTh42SUwDEc1GFmSrvU" rel="noreferrer">http://web.archiveorange.com/archive/v/TDTh42SUwDEc1GFmSrvU</a>).  This line reads:</p>
  
  <pre><code>unset( $postarr[ 'filter' ] );
  </code></pre>
  
  <p>and is called right after merging the input with the defaults, and before sanitizing.  It seems to me that this line cancels the 'filter' => true statement above.  Indeed, sanitizing happens if the line is there, and disappears if the line is taken out.</p>
  
  <p>So the easy solution would be to add the 'filter' => true and delete the extra line in the function.  Problem though is that I have no idea where else the function is used, and I wonder if it's smart at all to hack right in the WP code.  An update of WP would restore it anyway.  So ... is there any other way to stop this function from sanitizing the input?</p>