Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End How to output WordPress content as plain text?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #193003
    randomdude
    Participant

    I need to make WordPress output the content of a page as plain text, not inside a <p>, or anything, but can’t figure out how to do this. Does anyone know how?

    #193005
    Alen
    Participant

    Add to functions file:

    remove_filter( 'the_content', 'wpautop' );
    remove_filter( 'the_excerpt', 'wpautop' );
    

    Or

    You could also filter the_content and use preg_replace to remove all instances of <p> tag

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.