---
title: "How to Add and Delete Menu Items Using WP-CLI"
description: "In This Tutorial: Add Menu Item Delete Menu Item WordPress Hosting plans offered by InMotion Hosting feature WP-CLI. This means that you can manipulate various aspects of your WordPress website,..."
url: https://www.inmotionhosting.com/support/edu/wordpress/wp-cli/how-to-add-and-delete-menu-items-using-wp-cli/
date: 2018-02-21
modified: 2021-11-19
author: "InMotion Hosting Contributor"
categories: ["WP-CLI"]
type: post
lang: en
---

# How to Add and Delete Menu Items Using WP-CLI

## In This Tutorial:

[Add Menu Item](#add-menu-item) [Delete Menu Item](#delete-menu-item)

[WordPress Hosting plans](https://www.inmotionhosting.com/wordpress-hosting) offered by InMotion Hosting feature WP-CLI. This means that you can manipulate various aspects of your WordPress website, directly from the command line. In this guide, you will learn how to use the *wp menu* command to **add and delete menu items, using WP-CLI**.

## Create Menu Item

If you would like to add an item to your menu, you can use the *wp menu item* sub-command. The following steps will guide you through the process of **adding a custom URL, a Post, and a Page to your 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. Click on the button below for the menu item you would like to add, to expand and display the command used for each one.

## Remove Menu Item

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 delete *120* **NOTE: **Be sure to replace *120* with the actual [db_id of the menu item](/support/edu/wordpress/wp-cli/how-to-find-details-of-menus-using-wp-cli/#list-menu-items) you would like to delete from your menu. exampl3@example.com [~/public_html/wp]# wp menu item delete 120 Success: Menu item(s) deleted.

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!
