With WP-CLI you can manage a number of aspects of your WordPress website, directly from the command line.

 

Creating an item to your menu

To add and delete menu items using the wp menu command, just follow the instructions below:

- Log in to the server via SSH with the cPanel user who owns the website you want to work on.

- Use the cd command to access the root folder of your website:

cd public_html/wp

Replace public_html/wp with the actual path to the root folder of your website.

Run the following command:

wp menu create main-menu
[email protected] [~/public_html/wp]#  wp menu create main-menu Success: Created menu 4.

Deleting an item to your menu

- Log in to the server via SSH with the cPanel user who owns the website you want to work on.

- Use the cd command to access the root folder of your website:

cd public_html/wp

Replace public_html/wp with the actual path to the root folder of your website.

Run the following command:

wp menu item delete xxx

Replace xxx with the real id of the menu item you want to delete from the menu.

[email protected] [~/public_html/wp]# wp menu item delete xxx Success: Menu item(s) deleted.

 

For assistance in applying the above instructions on HostX servers please contact us. HostX offers the fastest WordPress hosting and can help you solve your problems.

Was this answer helpful? 0 Users Found This Useful (0 Votes)