Is there a default.json file for the html purifier settings in Craft? Now we can configure this I want to extend to include the stripping on non-breaking spaces. However, I don't want to just extend my requirements and not replace the default.

As I understand I would create a new json file in craft/config/htmlpurifier and this file would contain the following;

  "AutoFormat.RemoveEmpty.RemoveNbsp": true,

Is this all that is required?

1 Answer 1


Craft won't merge your HTML Purifier config settings with the default ones, but the default ones are pretty simple, so I'd just include them with yours.

    "AutoFormat.RemoveEmpty.RemoveNbsp": true,
    "Attr.AllowedFrameTargets": ["_blank"],
    "HTML.AllowedComments": ["pagebreak"]
  • Would love to see this in the documentation somewhere. A search for Purifier doesn't return anyhing.
    – Jan_dh
    Commented Oct 1, 2019 at 6:49

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.