If you would like to create a log out link in your main menu there is a very simple way to do this using the WooCommerce plugin.
- In your WordPress backend navigate to the Appearance>Menu section. Here, you should have a view of the “WooCommerce Endpoints section. Below is a screenshot on this.
If you are not in a position to trace the section, please ensure that you have it enabled within the “Screen Options” section on top of the page. Below is a screenshot on this:
- With this accomplished, enable the “logout” menu endpoint and click on the “Add to menu” button to have the endpoint added to your menu
Note that using the if Menu plugin you will need to control the visibility of the menu item so that the log out menu link only shows for logged in user.
You can then save your menu and have a view of it on the front-end.