Create clean navigation html code

Right now I’m using the below code for my navigation in my theme:

<?php wp_nav_menu( array( 'sort_column' => 'menu_order', 'menu_class' => '', 'menu_id' =>'', 'container' => '', 'theme_location' => 'primary-menu' ) ); ?>

From that code, this horrible mess of a code is produced by wordpress:


<ul id="menu-main" class="">
     <li id="menu-item-6" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-6"><a href="http://mydomain.com/?page_id=2">Sample Page</a></li>
     <li id="menu-item-7" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7"><a href="http://mydomain.com/?cat=1">Uncategorized</a></li>
</ul>

What I’d like to see produced instead is something like this:

<ul>
     <li class="current"><a href="http://mydomain.com/?page_id=2">Sample Page</a></li>
     <li><a href="http://mydomain.com/?cat=1">Uncategorized</a></li>
</ul>

Is it possible to produce clean navigation html code in Wordpress and if so, how?

I am guessing this comes down to the teme you are using.

Can you explain how you came to this idea?

It might be that the theme is using those class values for CSS or maybe even javascript.

True, they do look a bit more complex then I would like, but removing them may break things for you so save backups.

IMHO its not like they’re inline style declarations, just a multitude of class values. Not really “messy” code by my definition.