WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Normally when using a rich text editor, when you hit return (i.e. do a full paragraph return) Your text is wrapped i.e. <p> my text </p> however this does not happen in wordpress.

Is there any way to trigger this functionality?

share|improve this question
up vote 1 down vote accepted

This happens at the time the content is output the browser. At that point, the content is passed through several filters, one of which is called wpautop. This filter function is defined in wp-includes/formatting.php. In combination with the other default WordPress filters, this generally means that you can compose content in the HTML (non-wysiwyg) editor as if you were writing plain text, and it will format the final HTML output in a logical, intuitive manner.

On the other hand, you can also feel free to manually compose HTML tags in your output, and WP will preserve your tags. There are some edge-cases that can get you sometimes (using non-standard tags or attributes), but for the most part, the editor and the filters are pretty smart.

share|improve this answer
yes - apparently the get_the_content function does not filter the content using wpautop I had to do: apply_filters('the_content', get_the_content()); – Ash Jun 30 '11 at 9:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.