WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a script outside of Wordpress that generates an HTML file a few hundred times a day. I figured the best way to get the contents of this file in to a specific page would be a shortcode. I wrote one that looks something like this:

function get_special_content($atts) {
    remove_filter('the_content', 'wpautop');
    remove_filter('the_content', 'wptexturize');
    return file_get_contents('/somewhere/somefile.html');
add_shortcode('SPECIAL_SHORTCODE', 'get_special_content');

It works great, however the problem is that wptexturize is trashing the HTML. I have a few lines that look like this:

<tr data-notes="Blah - Blah">...</tr>

However the output that gets sent to the browser looks like this:

<tr data-notes="Blah &#8211; Blah>...</tr>

Notice that the closing " is removed!

I thought calling the remove_filter() inside the shortcode function would remove it but apparently not. I've also tried setting priorities to 1, 9, 10, 11, and 99. I've also tried this and this and nothing works. I'm running WordPress 3.4.1.

share|improve this question
Turns out it was my theme doing some extra processing – C G Sep 30 '12 at 22:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.