---
title: "How to Assign Menus to Locations Using WP-CLI"
description: "Once you have created a menu, you can display it on your website by assigning it to an available location. The available locations are determined by the theme you are using. WordPress themes include..."
url: https://www.inmotionhosting.com/support/edu/wordpress/wp-cli/how-to-assign-menus-to-locations-using-wp-cli/
date: 2018-02-20
modified: 2021-11-19
author: "InMotion Hosting Contributor"
categories: ["WP-CLI"]
type: post
lang: en
---

# How to Assign Menus to Locations Using WP-CLI

Once you have [created a menu](/support/edu/wordpress/wp-cli/how-to-create-and-delete-menus-using-wp-cli/), you can display it on your website by assigning it to an available location. The available locations are determined by the theme you are using. WordPress themes include various menu locations built-in, where you can assign menus to appear. In this guide, you will learn how to **assign a location to a menu using WP-CLI** to display it on your WordPress website.

## Assign Menu a Location

The following instructions will show you how to use the *wp menu location* sub-command to list the available locations for menus.

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 assign *primary-nav* *top* **NOTE: **Be sure to replace *primary-nav* with the actual [name of your menu](/support/edu/wordpress/wp-cli/how-to-find-details-of-menus-using-wp-cli/#list-existing-menus) and *top* with the actual [name of the location](/support/edu/wordpress/wp-cli/how-to-find-details-of-menus-using-wp-cli/#list-menu-locations). The output will be similar to the example below: exampl3@example.com [~/public_html/wp]# wp menu location assign primary-nav top Success: Assigned location to menu.

**Congratulations!** Now you know how to **assign a location to a menu using WP-CLI** to display the menu on your website.

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!
