Support » Fixing WordPress » Strip HTML Tags but Keep adsense/ infolinks /other scripts

  • Hi!
    I had worst complains but HTML which run in my posts and damage the template of blog. I search about to strip HTML tags I got following code
    that put in single.php of theme.

    <?php
    ob_start();
     the_content(''.__('Read more <span class="meta-nav">ยป</span>', 'sandbox').'');
    $old_content = ob_get_clean();
    $new_content = strip_tags($old_content, '<p><a><b><br /><input><form><img><textarea><li><ol><ul><table>');
    echo $new_content;
    ?>

    I get this code from http://wordpress.org/support/topic/way-to-strip-html-from-the_content-1?replies=6
    This work fine for me but remove ad sense / other scripts that are present in posts. I search about this but no clue find.
    please help me

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Strip HTML Tags but Keep adsense/ infolinks /other scripts’ is closed to new replies.