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.

<p>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.</p>
<p>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.</p>

This is my code for displaying the redactor field

{% if entry.type == 'blog' %}
            <div class="container mx-auto blog-post w-full my-4 {{block.customTextClass}} text-block text-{{block.position.value}}">
                {{ block.text }}
{% else %}

image displaying the outputted html

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.

  • Strange, can you try to run ./craft resave/entries (docs) and see if that makes a difference?
    – Oli
    Mar 30, 2021 at 6:25
  • 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
    Mar 30, 2021 at 10:18
  • Did you manage to resolve this at all? Issue is also listed here: github.com/craftcms/feed-me/issues/669 Jul 2, 2021 at 15:45
  • I didn't, I tried for a while but ended up just having to do it manually. @MalcolmMaclean
    – Thurc1996
    Jul 5, 2021 at 11:21


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.