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?
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?
Add to functions file:
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
You could also filter the_content and use preg_replace to remove all instances of <p> tag