• I saw a solution i believe which i found from a different Theard on this forum.

    Here are 2 codes but I dont know where to insert them on wordpress? which template?

    <?php
    ob_start();
     the_content(''.__('Read more <span class="meta-nav">&raquo;</span>', 'sandbox').'');
    $old_content = ob_get_clean();
    $new_content = strip_tags($old_content);
    echo $new_content;
    ?>

    and

    $new_content = strip_tags($old_content, '<p><a><b><br /><input><form><img><textarea><li><ol><ul><table>');

Viewing 2 replies - 1 through 2 (of 2 total)
  • where to put the code depends on where you want to show the content stripped of html tags.

    if you want to show it on the front page, the template is likely to be index.php; for single post view, it would be single.php.

    what are you trying to achieve? could you post more details?

    Thread Starter sazuka

    (@sazuka)

    Actually because People are allowed to register on my wordpress and make guest posts and i want to stop them from adding some wierd html codes including iframe forms etc…

    Is there no way to make it auto strip it inside the database with a plugin.. I just wasnt able to find such a plugin yet..

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Strip html codes from Posts’ is closed to new replies.