Title: Visual Editor removes Font Awesome code
Last modified: August 30, 2016

---

# Visual Editor removes Font Awesome code

 *  [gfields108](https://wordpress.org/support/users/gfields108/)
 * (@gfields108)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/visual-editor-removes-font-awesome-code/)
 * I have found that the Visual Editor will remove FontAwesome code if the parent
   tag has no content. For example,
 * `<div style="margin-bottom: 25px;"><i class="fa fa-flag fa-4x"></i></div>`
 * will become
 * `<div style="margin-bottom: 25px;"></div>`
 * if you visit the Visual Editor. Needless to say this can be very troublesome.
   A simple solution that I found from [https://generatepress.com/forums/topic/font-awesome-stack/](https://generatepress.com/forums/topic/font-awesome-stack/)
   is to add an HTML comment inside the surrounding tags like this:
 * `<div style="margin-bottom: 25px;"><i class="fa fa-flag fa-4x"></i><!-- icon --
   ></div>`
 * The Visual Editor will then preserve the FontAwesome code.

Viewing 1 replies (of 1 total)

 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/visual-editor-removes-font-awesome-code/#post-6608875)
 * Thanks for sharing your work-around!
 * For another work-around, try this plugin: [https://wordpress.org/plugins/fonticode/](https://wordpress.org/plugins/fonticode/)

Viewing 1 replies (of 1 total)

The topic ‘Visual Editor removes Font Awesome code’ is closed to new replies.

## Tags

 * [FontAwesome](https://wordpress.org/support/topic-tag/fontawesome/)
 * [visual editor](https://wordpress.org/support/topic-tag/visual-editor/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [James Huff](https://wordpress.org/support/users/macmanx/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/visual-editor-removes-font-awesome-code/#post-6608875)
 * Status: not a support question

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
