How do I remove the active class in the main menu? One item in the menu has sub-items that point to the same page (just with different arguments) ex:

Products
- List item 1  \products?pid=1 
- List item 2  \products?pid=2
- List item 3  \products?pid=3

Drupal assigns the "active" class in the  and  tag of the menu items since all the items have the same page url (\products) 

I'm overwriting the menu_link function in template.php to remove the active class but the class remains in the  tag

function mytheme_menu_link(array $variables) {
  $element = $variables['element'];
  $sub_menu = '';

  if ($element['#below']) {

    if (strtolower($element['#title']) == 'Products') {

      if (isset($_GET['pid'])) {
        $currID = $_GET['pid'];

        foreach ($element['#below'] as $Taxonomy) {

          if ($currTaxonomyID != $Taxonomy['#localized_options']['query']['pid']) {
            $mlid = $Taxonomy['#original_link']['mlid'];
            $key = array_search('active', $Taxonomy['#attributes']['class'], TRUE);            
            if ($key) {
              unset($element['#below'][$mlid]['#attributes']['class'][$key]);
              $element['#below'][$mlid]['#localized_options']['attributes']['class'][$key] = '';
            }
            // remove active-trail class
            $key = array_search('active-trail', $Taxonomy['#attributes']['class'], TRUE);            
            if ($key) {
              $element['#below'][$mlid]['#attributes']['class'][$key] = '';              
            }
          }          
        }
      }      
    }
    $sub_menu = drupal_render($element['#below']);         
  }
  $output = l($element['#title'], $element['#href'], $element['#localized_options']);  
  return '&lt;li' . drupal_attributes($element['#attributes']) . '&gt;' . $output . $sub_menu . "&lt;/li&gt;\n";
}


Final Result:

&lt;ul class="menu nav"&gt;
   &lt;li class="first leaf menu-mlid-44253"&gt;
      &lt;a href="/products?pid=1" title="Best Practices" class="active"&gt;Best Practices&lt;/a&gt;
    &lt;/li&gt;
    &lt;li class="leaf menu-mlid-44254"&gt;
      &lt;a href="/products?pid=2" title="Checklists" class=" active"&gt;Checklists&lt;/a&gt;
    &lt;/li&gt;
....


How can I remove the class "active" from the  tag?

My menu Structure:

-Clients
-Products
  -prod1 (url:\\products?pid=1)
  -prod2 (url:\\products?pid=2)
  -prod3 (url:\\products?pid=3)
  -prod4 (url:\\products?pid=4)
-About
I had the same problem: the l() function automatically assigns an active class when a link is pointing to the current page.

I got around this using an (ugly) hack:

As noted in the documentation, $options['language'] is additionally compared with $language_url-&gt;language before assigning the active class.

So, the hack is to supply a deliberately incorrect language when calling l().

You can find out what the current language of your site is using dpm():

global $language_url;
dpm($language_url-&gt;language);


In my case, I know that the language of the site is definitely not und, so I appended array('language' =&gt; 'und') to my call to l():

l('link text', 'path/to/page', array('language' =&gt; 'und'))

After this, the a element no longer had the active class.