diff --git a/src/menu/menu.c b/src/menu/menu.c
index 72bd67f8..9e6734af 100644
--- a/src/menu/menu.c
+++ b/src/menu/menu.c
@@ -42,7 +42,6 @@ static bool in_item;
 static struct menuitem *current_item;
 static struct action *current_item_action;
 
-static int menu_level;
 static struct menu *current_menu;
 
 static bool waiting_for_pipe_menu;
@@ -585,56 +584,6 @@ traverse(xmlNode *n, struct server *server)
 	xml_tree_walk(n->children, server);
 }
 
-static int
-nr_parents(xmlNode *n)
-{
-	assert(n);
-	int i = 0;
-	for (xmlNode *node = n->parent; node && i < INT_MAX; ++i) {
-		node = node->parent;
-	}
-	return i;
-}
-
-/*
- * Return true for the highest level static menu definitions in the format
- * below. We use the fact that the id-attribute has two nodal parents (