• Resolved ewwink

    (@ewwink)


    Hello all,

    I want to filter the_content to allow like <p> tags only but with code below

    add_filter('the_content','strip_tags');

    it strip all tags so how to allow <p>?

    thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Something like this

    function my_strip_tags($content='') {
       return strip_tags($content, '<p>');
    }
    add_filter('the_content','my_strip_tags');

    I didn’t test the code – its to demonstrate the principle. That will leave P tags in place and strip all others.

    Thread Starter ewwink

    (@ewwink)

    thanks stvwlf its work

    SUPER TRICK!
    Does anybody know how to force to paste as plain text?
    I know there’s the ‘T’ button, but since some client doesn’t want to learn how to… I need to force him!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to Strip_Tags The_Content’ is closed to new replies.