Title: Adding HTML to Menu
Last modified: January 19, 2019

---

# Adding HTML to Menu

 *  [multimediocrity](https://wordpress.org/support/users/multimediocrity/)
 * (@multimediocrity)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/adding-html-to-menu/)
 * Hi! I have a WordPress menu and I’m adding HTML to it, such as “Getting<br />
   Started”. This will put “Getting” and “Started” on their own lines. All works
   well, but every once in a while (for reasons I haven’t quite figured out), it
   will remove the HTML and turn in to “GettingStarted”. I don’t know what triggers
   it. Maybe updating my header.php file? Maybe uploading new posts? It’s annoying
   and temporarily breaks our site until I go in and fix it.
 * Is there something I’m doing wrong? Is something interfering? Should I be escaping
   my HTML characters somehow, or using a different command like “\n”?
    Yes, I’ve
   disabled my other plugins and it still does this. Yes, my WordPress is the latest
   version.
 * Thanks!
    -  This topic was modified 7 years, 4 months ago by [multimediocrity](https://wordpress.org/support/users/multimediocrity/).

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

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/adding-html-to-menu/#post-11105702)
 * Newlines (“\n”) are ignored by browser rendering engines, a break tag should 
   be honored. Did you simply enter “Getting<br />Started” into the navigation label
   field of the usual menu UI? I have a site with the exact same sort of labels 
   and have never encountered a problem.
 * Unless you can reliably reproduce the behavior, it’s going to be difficult to
   track down the cause. I’ve a couple ideas for possible work arounds. See if simply
   removing the space within the break tag helps any. Add some CSS that targets 
   only that one particular menu item. Set the container’s width and padding so 
   that the browser is forced to line feed the label to stay within the container
   even if the break tag were not there.
 * The CSS could become problematic should the menu be edited in certain ways, but
   it should solve the issue for the current menu.
 *  Thread Starter [multimediocrity](https://wordpress.org/support/users/multimediocrity/)
 * (@multimediocrity)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/adding-html-to-menu/#post-11106049)
 * The CSS is a good idea but impractical in this case. I tried it without the space
   also and it still removed it. I did try the \n too and realized that didn’t work.
 * Yes, I added “Getting<br />Started” into the navigation label field of the usual
   menu UI. It works, but it doesn’t stay, and I’m a bit bothered, haha.
 * OOOOH! IDEA! I said I disabled all my plugins but I couldn’t full-out test everything.
   Maybe Nested Pages is rewriting my headers?
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/adding-html-to-menu/#post-11108791)
 * Oh, you use that plugin to manage menus? That’s almost certainly the cause. You
   could try asking for suggestions in the plugin’s [dedicated support forum](https://wordpress.org/support/plugin/wp-nested-pages).
   But looking at other support topics there, it doesn’t look very promising 🙁
 * If you have some ability to code PHP, you could attempt to locate the offending
   code and disable it. Still, you would need to know what you do in the UI that
   causes the issue in order to have a starting point. There’s too much code to 
   just blindly start searching for the cause.
 * Or possibly easier, intercept the menu output stream and fix up the stream as
   needed. For example, if `\n` is reliably retained by the plugin, intercept the
   output and replace instances of `\n` with `<br/>`. If not `\n` then some other
   unlikely characters, `||` perhaps. Does this plugin’s menu still use the `wp_nav_menu()`
   call on templates to output the menu? If so, probably hooking the “pre_wp_nav_menu”
   filter with a late priority will allow interception of the menu output. I can’t
   be sure, but if `wp_nav_menu()` is still used, it’s very likely a solution.

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

The topic ‘Adding HTML to Menu’ is closed to new replies.

## Tags

 * [change](https://wordpress.org/support/topic-tag/change/)
 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [menu](https://wordpress.org/support/topic-tag/menu/)
 * [tags](https://wordpress.org/support/topic-tag/tags/)
 * [upload](https://wordpress.org/support/topic-tag/upload/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/adding-html-to-menu/#post-11108791)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
