---
title: "How to Find Details of Menus Using WP-CLI"
description: "In This Tutorial: List Menus List Menu Locations List Menu Items Knowing certain details about your menu(s) is important for managing them via the command line. For instance, if you want to display a..."
url: https://www.inmotionhosting.com/support/edu/wordpress/wp-cli/how-to-find-details-of-menus-using-wp-cli/
date: 2018-02-20
modified: 2021-08-16
author: "InMotion Hosting Contributor"
categories: ["WP-CLI"]
type: post
lang: en
---

# How to Find Details of Menus Using WP-CLI

## In This Tutorial:

[List Menus](#list-existing-menus) [List Menu Locations](#list-menu-locations) [List Menu Items](#list-menu-items)

Knowing certain details about your menu(s) is important for managing them via the command line. For instance, if you want to display a particular menu on your website, you must know the available locations to include in the syntax of the command. However, thanks to the available sub-command *list*, we can gather the details we need, without having to leave the command line. In this guide, you will learn the steps to **find important details about your menu(s)** to manage them using **WP-CLI**.

## List Existing Menus

The menus you have created can be listed using the *wp menu list* command. Follow the steps below to list your menus and obtain the additional information needed to manage them.

1. [SSH into your server](/support/server/ssh/shared-reseller-ssh/) as the cPanel user that owns the website you would like to work with.
2. Use the cd command to switch to the [document root directory of your website](/support/website/where-to-upload-files/). Example: cd **public_html/wp** **NOTE: **Be sure to replace **public_html/wp** with the actual path to the document root directory of your website.
3. Run the following command: wp menu list The output will be similar to the example below: exampl3@example.com [~/public_html/wp]# wp menu list +---------+------------------+------------------+-----------+-------+ | term_id | name | slug | locations | count | +---------+------------------+------------------+-----------+-------+ | 8 | Primary New Menu | primary-new-menu | | 0 | | 4 | primary-nav | primary-nav | top | 0 | | 7 | primary-new | primary-new | | 0 | | 5 | social-media | social-media | social | 0 | +---------+------------------+------------------+-----------+-------+ Notice that the output is formatted nicely displaying the details of the existing menus. For instance, the menu named: **primary-nav** is assigned to the location: **top**. This means that the *primary-nav* menu will be displayed where the *top* menu is located according to the active theme.

## List Available Menu Locations

In order to display a menu on your website you assign the menu a location. Since you must first know the location(s) available to specify in the command, you need to find the location details. The instructions below will guide you through the process of identifying the available menu locations (for the theme that is currently activated), using WP-CLI.

1.
   1. [SSH into your server](/support/server/ssh/shared-reseller-ssh/) as the cPanel user that owns the website you would like to work with.
   2. Use the cd command to switch to the [document root directory of your website](/support/website/where-to-upload-files/). Example: cd **public_html/wp** **NOTE: **Be sure to replace **public_html/wp** with the actual path to the document root directory of your website.
   3. Run the following command: wp menu location list

The output below, provides an example that lists the available menu locations for your enabled theme.

exampl3@example.com [~/public_html/wp]# wp menu location list +----------+-------------------+ | location | description | +----------+-------------------+ | *top* | Top Menu | | *social* | Social Links Menu | +----------+-------------------+
Here, you can see the two (2) available locations, *top* and *social*.

## List Menu Items

You can review the items included in a particular menu by using the *wp menu item list* sub-command. Follow the steps below to **find the items included in a menu**, using **WP-CLI**.

1. [SSH into your server](/support/server/ssh/shared-reseller-ssh/) as the cPanel user that owns the website you would like to work with.
2. Use the cd command to switch to the [document root directory of your website](/support/website/where-to-upload-files/). Example: cd **public_html/wp** **NOTE: **Be sure to replace **public_html/wp** with the actual path to the document root directory of your website.
3. Run the following command: wp menu item list *primary-nav* **NOTE: **Be sure to replace *primary-nav* with the actual [name of the menu](#list-existing-menus) you would like to list items for. The output below provides an example of the menu items and details listed: exampl3@example.com [~/public_html/wp]# wp menu item list primary-nav +-------+-----------+--------------+---------------------------------+----------+ | db_id | type | title | link | position | +-------+-----------+--------------+---------------------------------+----------+ | 38 | post_type | Home | https://w...com/wp/ | 1 | | 43 | post_type | About Us | https://w...com/wp/about-us/ | 2 | | 45 | post_type | Clients | https://w...com/wp/clients/ | 3 | | 47 | post_type | Gallery | https://w...com/wp/gallery/ | 4 | | 49 | post_type | Resume | https://w...com/wp/resume/ | 5 | | 51 | post_type | Info | https://w...com/wp/info/ | 6 | | 53 | post_type | Testimonials | https://w...com/wp/testimonials/ | 7 | | 55 | post_type | Contact Us | https://w...com/wp/contact-us/ | 8 | | 23 | taxonomy | Blog | https://w...com/wp/./blog/ | 9 | +-------+-----------+--------------+---------------------------------+----------+

Now that you are familiar with **how to find the details for your menu(s)**, you can utilize **WP-CLI** to manage your menu(s) from the command line. 

Learn more about [WP-CLI](https://www.inmotionhosting.com/support/edu/wordpress/wp-cli/), the command-line interface for WordPress, and how to streamline your WordPress maintenance workflows!
