I need to escape some text within a channel entries loop so it doesn't break the JSON schema I created for each page:

{exp:channel:entries limit="1" channel="posts" }
  {title} //replace " quotes with \"

Liquid and Twig make this easy but I don't see anything readily available in the EE docs.

1 Answer 1


Any chance one of the following variable modifiers would do the trick for you?

:json https://docs.expressionengine.com/latest/templates/variable-modifiers.html#json

:replace https://docs.expressionengine.com/latest/templates/variable-modifiers.html#replace

  • That is exactly what I needed! I know there had to be some string filters but all I could find was the date format in the channel entries docs.
    – Edward
    Mar 21, 2022 at 23: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.