<p>Firstly, I used WP Export All / Feed Me to migrate blog posts from a wordpress site to a craft site. The HTML from the wordpress content field has all been imported properly. Text is wrapped in p tags, headers in heading tags etc etc. However, even though the P tags are present in the html version of the redactor editor, on the page the p tags seem like they are stripped. I'll attach images to show what I mean.</p>
<p>This is my code in the redactor field.</p>
<pre><code>&lt;p&gt;Just a quick update on a large fit out project we are undertaking in Castle Donington to allow two companies to move into the space.&lt;/p&gt;
&lt;p&gt;The majority of the first fix M&amp;E has been completed and we are currently installing the framework to allow the toughened glass walls to be installed. As you can see from the photos, this is a high specification project that is going to completely transform the space, and create a modern and clean office environment.&lt;/p&gt;
</code></pre>
<p>This is my code for displaying the redactor field</p>
<pre><code>{% if entry.type == 'blog' %}
            &lt;div class=&quot;container mx-auto blog-post w-full my-4 {{block.customTextClass}} text-block text-{{block.position.value}}&quot;&gt;
                {{ block.text }}
            &lt;/div&gt;
{% else %}
</code></pre>
<p><a href="https://i.sstatic.net/G54DH.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/G54DH.png" alt="image displaying the outputted html" /></a></p>
<p>Any help with this would be massively appreciated. Right now a workaround I have found is to delete the text, save the entry, then re-add the text and save. When I do this the p tags remain.</p>

CC BY-SA 4.0
2021-03-30T06:25:31.320Z
Strange, can you try to run `./craft resave/entries` ([docs](https://craftcms.com/docs/3.x/console-commands.html#resave-entries)) and see if that makes a difference?
Oli
CC BY-SA 4.0
2021-03-30T10:18:38.030Z
Thanks for the idea, unfortunately this didn't work. From what I can tell I have to actually change some text in the field and save it, and then the <p> tags get saved into the database. Very very weird.
Thurc1996
CC BY-SA 4.0
2021-07-02T15:45:12.480Z
Did you manage to resolve this at all? Issue is also listed here: https://github.com/craftcms/feed-me/issues/669
Malcolm Maclean
CC BY-SA 4.0
2021-07-05T11:21:43.347Z
I didn't, I tried for a while but ended up just having to do it manually. @MalcolmMaclean
Thurc1996
CC BY-SA 4.0
2024-05-13T06:04:41.983Z
You need to use `{{ block.text|raw }}` to maintain the `p` tags.
InanisAtheos
<redactor>
Redactor field removing P tags
# Redactor field removing P tags

(Asked by: username_0 on 2021-03-29)

Firstly, I used WP Export All / Feed Me to migrate blog posts from a wordpress site to a craft site. The HTML from the wordpress content field has all been imported properly. Text is wrapped in p tags, headers in heading tags etc etc. However, even though the P tags are present in the html version of the redactor editor, on the page the p tags seem like they are stripped. I'll attach images to show what I mean.
This is my code in the redactor field.
Just a quick update on a large fit out project we are undertaking in Castle Donington to allow two companies to move into the space.
The majority of the first fix M&E has been completed and we are currently installing the framework to allow the toughened glass walls to be installed. As you can see from the photos, this is a high specification project that is going to completely transform the space, and create a modern and clean office environment.

This is my code for displaying the redactor field
{% if entry.type == 'blog' %}
            
                {{ block.text }}
            
{% else %}


Any help with this would be massively appreciated. Right now a workaround I have found is to delete the text, save the entry, then re-add the text and save. When I do this the p tags remain.

**Tags:** redactor

> **Comments:**
> **username_1**: Strange, can you try to run `./craft resave/entries` ([docs](https://craftcms.com/docs/3.x/console-commands.html#resave-entries)) and see if that makes a difference?  
> **username_0**: Thanks for the idea, unfortunately this didn't work. From what I can tell I have to actually change some text in the field and save it, and then the <p> tags get saved into the database. Very very weird.  
> **username_2**: Did you manage to resolve this at all? Issue is also listed here: https://github.com/craftcms/feed-me/issues/669  
> **username_0**: I didn't, I tried for a while but ended up just having to do it manually. @MalcolmMaclean  
> **username_3**: You need to use `{{ block.text|raw }}` to maintain the `p` tags.  

---

## 0 answers

