diff --git a/includes/menu_token.admin.inc b/includes/menu_token.admin.inc
index c6e6952..5c1dd41 100644
--- a/includes/menu_token.admin.inc
+++ b/includes/menu_token.admin.inc
@@ -7,7 +7,7 @@
 
 
 /**
- * Implementation of hook_form_FORM_ID_alter().
+ * Implements of hook_form_FORM_ID_alter().
  */
 function menu_token_form_menu_edit_item_alter(&$form, &$form_state) {
   if ($form['module']['#value'] == 'menu') {
@@ -48,7 +48,7 @@ function menu_token_form_menu_edit_item_alter(&$form, &$form_state) {
       if (isset($form_state['values']['menu_token_type_' . $type])) {
         $default = $form_state['values']['menu_token_type_' . $type];
       }
-      else if (!empty($options['menu_token_data'][$type])) {
+      elseif (!empty($options['menu_token_data'][$type])) {
         $default = $options['menu_token_data'][$type]['plugin'];
       }
 
@@ -93,7 +93,7 @@ function menu_token_form_menu_edit_item_alter(&$form, &$form_state) {
       }
     }
 
-    // Create new fieldset
+    // Create new fieldset.
     $form['menu_token_replacement_patterns'] = array(
       '#type' => 'fieldset',
       '#title' => t('Replacement patterns'),
@@ -112,6 +112,14 @@ function menu_token_form_menu_edit_item_alter(&$form, &$form_state) {
       '#token_types' => array_keys($types),
     );
 
+    $form['menu_token_options']['clear'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Remove token if replacement is not present'),
+      '#description' => t('If the replacement token is not available on the page being viewed, the token will be removed if checked.'),
+      '#default_value' => isset($options['menu_token_options']['clear']) ? $options['menu_token_options']['clear'] : '',
+    );
+
+
     // Add custom validation and submit functions.
     array_unshift($form['#validate'], 'menu_token_form_menu_edit_item_validate');
     array_unshift($form['#submit'], 'menu_token_form_menu_edit_item_submit');
@@ -189,12 +197,18 @@ function menu_token_form_menu_edit_item_submit($form, &$form_state) {
         }
       }
     }
+    if (!empty($values['clear'])) {
+      $values['options']['menu_token_options']['clear'] = 1;
+    }
+    else {
+      $values['options']['menu_token_options']['clear'] = 0;
+    }
   }
 }
 
 
 /**
- * Implementation hook_form_FORM_ID_alter().
+ * Implements hook_form_FORM_ID_alter().
  */
 function menu_token_form_menu_overview_form_alter(&$form, $form_state) {
   foreach ($form as &$item) {
diff --git a/menu_token.module b/menu_token.module
index 65919a2..30ac11d 100644
--- a/menu_token.module
+++ b/menu_token.module
@@ -11,7 +11,7 @@ module_load_include('inc', 'menu_token', 'includes/menu_token.admin');
 
 
 /**
- * Implementation of hook_theme().
+ * Implements hook_theme().
  */
 function menu_token_theme() {
   return array(
@@ -117,7 +117,7 @@ function menu_token_menu_token_plugins() {
       ),
     );
   }
-  
+
   if (module_exists('taxonomy')) {
     $plugins['term_context'] = array(
       'type' => 'term',
@@ -167,8 +167,8 @@ function menu_token_translated_menu_link_alter(&$item, $map) {
   if (empty($menu_admin) && isset($item['options']['menu_token_link_path'])) {
     $info = token_get_info();
     $data = array();
-    
-    // Load data objects used when replacing link
+
+    // Load data objects used when replacing link.
     if (isset($item['options']['menu_token_data'])) {
       foreach ($item['options']['menu_token_data'] as $type => $options) {
         if (!empty($info['types'][$type]) && $handler = menu_token_get_handler($options['plugin'])) {
@@ -179,16 +179,24 @@ function menu_token_translated_menu_link_alter(&$item, $map) {
       }
     }
 
-    // If item is generated by admin menu module, tokens should not be replaced and
-    // indicator that tokens are used should be shown.
-    $item['title'] =  token_replace($item['title'], $data);
-    $url = token_replace($item['options']['menu_token_link_path'], $data);
+    $tr_options = array();
+    if (isset($item['options']['menu_token_options']['clear']) && $item['options']['menu_token_options']['clear'] == 1) {
+      $tr_options['clear'] = TRUE;
+    }
 
-    // Override active trail if showing front page but translated link is not to front page.
-    // NOTE: This relies on any parent of a tokenised menu item having "option" flag "alter" set,
-    // which is most easily achieved by setting it to use token translation but not specifying a token.
-    // Otherwise parent does not get processed through this function and because its untranslated child has
-    // an href of <front>, the menu system thinks it is part of the active trail to the front page.
+    // If item is generated by admin menu module, tokens should not be replaced
+    // and indicator that tokens are used should be shown.
+    $item['title'] = token_replace($item['title'], $data, $tr_options);
+    $url = token_replace($item['options']['menu_token_link_path'], $data, $tr_options);
+
+    // Override active trail if showing front page but translated link is not to
+    // front page.
+    // NOTE: This relies on any parent of a tokenised menu item having "option"
+    // flag "alter" set, which is most easily achieved by setting it to use
+    // token translation but not specifying a token. Otherwise parent does not
+    // get processed through this function and because its untranslated child
+    // has an href of <front>, the menu system thinks it is part of the active
+    // trail to the front page.
     if (drupal_is_front_page() && $item['href'] != drupal_get_normal_path(variable_get('site_frontpage', 'node'))) {
       $item['in_active_trail'] = FALSE;
     }
@@ -199,7 +207,7 @@ function menu_token_translated_menu_link_alter(&$item, $map) {
       return;
     }
 
-    // Split url into parts and save in proper format
+    // Split url into parts and save in proper format.
     $url_parts = parse_url($url);
     $item['href'] = $item['link_path'] = $item['router_path'] = $url_parts['path'];
     if (isset($url_parts['query'])) {
