I am creating a theme from scratch and the navigation menu is disturbing me because it is displaying the permalinks after the menu item name. See this picture


Link name (#permalink) is the result of wp_nav_menu()

Setting e.g. $before/$after - yields text before/after (#permalink)

The (#permalink) part is not displayed in the source.

Since it's only Pages I tried wp_list_pages(), but that gives me the same result.

Any ideas on how to remove those permalinks? I believe there is some 'default' setting for how links/menu items should be displayed but I don't know where to look.


1 Answer 1


Since the (#url) isn't displayed in the source, I suspect this is being placed there by CSS with a rule like:

#menu a:after { content: "#"attr(href); }

If I had to guess it's a print stylesheet run amok, possibly from a plugin.

  • Yes you're right. As a matter of fact, all links have that "bug". How come?
    – H.Rabiee
    Commented May 16, 2012 at 19:25
  • It's a theming or plugin issue. Use a tool like Firebug to track down which style sheet it's in and then work backwards from there. Like I said, it's a common thing in Print stylesheets, so if you have a plugin that does that, I'm guessing it's the culprit.
    – mrwweb
    Commented May 16, 2012 at 20:38
  • If you send me a link, I can track it down very quickly.
    – mrwweb
    Commented May 16, 2012 at 20:45

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.