Users post XML data in my comments section frequently due to the nature of my content, but due to the way the comments work, the elements are consumed and do not appear properly. In fact, when I look at the comments through dashboard, the tags are completely gone.

For example, if you wrote

   some name

All I would see is

some name

If I use pre tags, that works fine, so presumably the comments are being consumed as HTML, and I've also enabled markdown to make it a bit easier, but I figured it's easier for my visitors to just remove this HTML comment formatting.

How can this be done?

1 Answer 1


If you're wanting your users to be able to add the xml tags into the comment form, without having them removed, it would be best to add a filter to pre_process_comment so as to add <pre> tags around the comment before it's posted to the DB.

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.