We are in the midst of a migration from WordPress to Craft. Much of the content contains line breaks, which are converted to <p> tags in Redactor (as seen in Redactor's view source plugin).

But when the entry is saved (or previewed, as seen in the attached image), those <p> tags are stripped back out and never make it to the database.

Is there a config setting to "retain the automatically applied formatting from redactor when the entry is saved"? (we want to keep these styles that were temporarily added in by redactor)

enter image description here


1 Answer 1


In the Advanced section of your field definition, there are settings for clean-up actions and Purify HTML.

I suggest trying to disable Purify (or use a custom config).

  • Also, make sure you use the raw filter in your Twig template: {{ entry.myRedactorField|raw }}.
    – lemp
    Commented Jun 4, 2020 at 20:33
  • 1
    All those settings (Remove inline styles, Remove empty tags, Replace non-breaking spaces with regular spaces, Purify HTML) were turned off, and we are using the raw filter for the output. The <p> tags are injected by javascript in redactor, but not sent forward to craft when the entry is saved. Commented Jun 4, 2020 at 20:40
  • 1
    I've also tried with all those settings checked... no difference Commented Jun 4, 2020 at 20:45
  • 1
    Here's what I found I can do as a workaround: -open the entry in the control panel -click preview -> content is bad (the <p> tags are in redactor, but not in the preview) -add a line of plain text to the content -click preview -> content is GOOD (and saves with newly added <p> tags) Commented Jun 4, 2020 at 22:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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