Title: HTML code dissapearing!
Last modified: August 19, 2016

---

# HTML code dissapearing!

 *  [studiomanifesto](https://wordpress.org/support/users/studiomanifesto/)
 * (@studiomanifesto)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/html-code-dissapearing/)
 * I usually use the HTM Editor for creating posts and pages on wordpress. Often,
   I’ll use line breaks in the HTML editor, but when I switch to the Visual Editor,
   the line breaks disappear. Is there any reason for this?
 * I was told to use the `<code></code>` function for inserting HTML, but it dosen’t
   work. Here’s an example of that it looks like in the HTML Editor:
 * `<h2>Topic 1</h2>`
    `<p>Blah Blah Blah</p>` `</br>` `<h2>Topic 2</br>`
 * This works fine on the page during the preview, but once switched to the Visual
   Editor, and back to the HTML Editor, the breaks are gone.
 * Any help or suggestions?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [oztwo](https://wordpress.org/support/users/oztwo/)
 * (@oztwo)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/html-code-dissapearing/#post-926280)
 * yes, this happens a lot. what I do to get around this problem is to change to
   html view at the end and add your code. Then save the post from there. Else if
   you go back to the Visual editor, it will be so very nice to auto format for 
   you taking out all the code you just added.
 *  Thread Starter [studiomanifesto](https://wordpress.org/support/users/studiomanifesto/)
 * (@studiomanifesto)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/html-code-dissapearing/#post-926300)
 * Fantastic, just glad to know I’m not going crazy. Thanks for the reply.
 *  [iridiax](https://wordpress.org/support/users/iridiax/)
 * (@iridiax)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/html-code-dissapearing/#post-926320)
 * > Often, I’ll use line breaks in the HTML editor, but when I switch to the Visual
   > Editor, the line breaks disappear. Is there any reason for this?
 * Yes, switching back and forth between the visual and html editors will mess up
   your code. Use only one or the other.
 * > I was told to use the  function for inserting HTML…
 * You were told wrong unless you want to [display the code example in your text](http://codex.wordpress.org/Writing_Code_in_Your_Posts).
 * BTW, line breaks `<br />` can be automatically generated in WordPress by a single
   enter (return) when typing in your text.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘HTML code dissapearing!’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [iridiax](https://wordpress.org/support/users/iridiax/)
 * Last activity: [17 years, 5 months ago](https://wordpress.org/support/topic/html-code-dissapearing/#post-926320)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
