How to Assign Menus to Locations Using WP-CLI Updated on November 19, 2021 by InMotion Hosting Contributor 1 Minutes, 9 Seconds to Read 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 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. SSH into your server as the cPanel user that owns the website you would like to work with. Use the cd command to switch to the document root directory of your website. 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. 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 and top with the actual name of the location. The output will be similar to the example below: [email protected] [~/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, the command-line interface for WordPress, and how to streamline your WordPress maintenance workflows! Share this Article IC InMotion Hosting Contributor Content Writer InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals! More Articles by InMotion Hosting Related Articles Install and Configure WP-CLI How to Create and Delete a WordPress Page Using WP-CLI Install a Theme Using WP-CLI Install WordPress Using WP-CLI Manage WordPress Comments Using WP-CLI Update WordPress Using WP-CLI Manage WordPress Users Using WP-CLI WP-CLI search-replace Command Delete WordPress Transients Using WP-CLI Manage WordPress Plugins with WP-CLI