Title: HTML tags in Fields
Last modified: August 20, 2016

---

# HTML tags in Fields

 *  [SandBird](https://wordpress.org/support/users/sandbird/)
 * (@sandbird)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/html-tags-in-fields/)
 * Thanks for this great plugin, amazing work!
 * I am using it in combination with the Dynamic Text Extension to populate some
   data using a shortcode. The data from the shortcode is formatted in simple HTML(
   it has html tags).
    What I’m trying to do is use the pre-exisitng generated format
   in the email message. I made sure that “Use HTML content type” is checked but
   all I get is a stripped version of text, in that specific field reference data.
   When I use other HTML tags in the message body it works but not if the tags exist
   in any field references codes. I assume, for security reasons, that all HTML 
   tags within the reference fields are automatically stripped. Is there any way
   to bypass that for that specific field (especially since I’m the one who’s populating
   it)?
 * Note: In the form, the dynamic field does show the HTML markings/tags and it 
   does show it in the email body if I uncheck the “Use HTML content type” but then
   I get no HTML formatting and just visible tags.
 * Any help/input is much appreciated, thanks again!
 * [http://wordpress.org/extend/plugins/contact-form-7/](http://wordpress.org/extend/plugins/contact-form-7/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [SandBird](https://wordpress.org/support/users/sandbird/)
 * (@sandbird)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/html-tags-in-fields/#post-3167537)
 * I’ve found out that if I comment out line 581 in classes.php, where it says:
   `
   $replaced = strip_tags( $replaced );` I manage to get the behavior I want; the
   email represents the HTML syntax in that field. However, I’m sure there is a 
   reason for this line to exist and wanted to know if there’s any other approach
   to this? or if it’s safe to leave it as is?
 * Thanks again!

Viewing 1 replies (of 1 total)

The topic ‘HTML tags in Fields’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

 * [html](https://wordpress.org/support/topic-tag/html/)

 * 1 reply
 * 1 participant
 * Last reply from: [SandBird](https://wordpress.org/support/users/sandbird/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/html-tags-in-fields/#post-3167537)
 * Status: not resolved