---
title: "How to Create and Delete Menus Using WP-CLI"
description: "WordPress Hosting by InMotion Hosting includes WordPress Command Line Interface (WP-CLI). This convenient tool allows you to work on your WordPress website(s) directly from the command line. Once you..."
url: https://www.inmotionhosting.com/support/edu/wordpress/wp-cli/how-to-create-and-delete-menus-using-wp-cli/
date: 2018-02-20
modified: 2021-11-19
author: "InMotion Hosting Contributor"
categories: ["WP-CLI"]
type: post
lang: en
---

# How to Create and Delete Menus Using WP-CLI

[WordPress Hosting](https://www.inmotionhosting.com/wordpress-hosting) by InMotion Hosting includes **WordPress Command Line Interface** (*WP-CLI*). This convenient tool allows you to work on your WordPress website(s) directly from the command line. Once you are familiar with the syntax and available commands, you will be able to quickly modify common elements of your website(s), like *menus*.

**Menus** are essential for providing a focal point for your visitors to locate important information contained within your website. In this guide, you will learn **how to create and delete a menu with WP-CLI**, using the command *wp menu*.

## Create a New Menu

Creating a new menu is simple using the sub-command *wp menu create*. The steps below will guide you through the process of **creating a new menu** from the command line, **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 create *primary-nav* **NOTE: **Be sure to replace *primary-nav* with the actual name you would like to give to the menu you are creating.

## Delete a Menu

If you are unsatisfied with a menu you have created, you can remove it by using the *wp menu delete* sub-command. The following steps will guide you through the process of **deleting a menu** via the command line, **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 delete *primary-nav* **NOTE: **Be sure to replace *primary-nav* with the actual [name of the menu](/support/edu/wordpress/wp-cli/how-to-find-details-of-menus-using-wp-cli/#list-existing-menus) you are deleting.

**Congratulations!** Now, you know how to **create and delete menus** from your **WordPress** website via the command line using **WP-CLI**.

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!
