# Formatting the WP excerpt for Discourse

**URL:** https://meta.discourse.org/t/formatting-the-wp-excerpt-for-discourse/55940
**Category:** WordPress
**Created:** [2017年一月18日 02:02 UTC](https://meta.discourse.org/t/formatting-the-wp-excerpt-for-discourse/55940 "2017-01-18T02:02:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [2017年一月18日 02:02 UTC](https://meta.discourse.org/t/formatting-the-wp-excerpt-for-discourse/55940/1 "2017-01-18T02:02:52Z")

</div>

We use the Discourse-WP plugin and currently the {excerpt} is being displayed with no line breaks.

Here is an example:  
WP [Building Skills Of An Online Community Team | FeverBee](https://www.feverbee.com/skills/)  
Discourse [https://experts.feverbee.com/t/building-skills-of-an-online-community-team/4915](https://experts.feverbee.com/t/building-skills-of-an-online-community-team/4915)

This doesn’t seem to be the case in other installs that I’ve seen.

Does anyone know of a fix?

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [2017年一月18日 04:41 UTC](https://meta.discourse.org/t/formatting-the-wp-excerpt-for-discourse/55940/2 "2017-01-18T04:41:47Z")

</div>

I don’t know the fix, but it sounds like wpautop (WordPress automatic p tags) is involved.

For example, a post is entered with 2 newlines to separate paragraphs.  
Instead of 2 `<br>` tags, (which granted, is not semantic), wpautop converts them to `<p>` tags while removing whitespace characters in the process.  
Discourse removes the `<p>` tags.

Maybe disable wpautop on the WordPress side, or whitellst p tags Discourse side?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [2017年一月18日 06:06 UTC](https://meta.discourse.org/t/formatting-the-wp-excerpt-for-discourse/55940/3 "2017-01-18T06:06:54Z")

</div>

If you manually create an excerpt for the post, the formatting of that excerpt will be retained.

 ![](https://global.discourse-cdn.com/meta/original/3X/a/e/ae6824451b12dfe00eebbae50b98b06bc85ca488.png)

 ![](https://global.discourse-cdn.com/meta/original/3X/8/e/8e24a27c9e1a89b5904e41354ba84cebbf0330ee.png)

If, instead, you let the wp-discourse plugin create an excerpt for you, all formatting will be stripped. Possibly this is something that should be fixed.

---

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [2017年一月18日 16:50 UTC](https://meta.discourse.org/t/formatting-the-wp-excerpt-for-discourse/55940/4 "2017-01-18T16:50:10Z")

</div>

That did the trick thanks!
