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 User Registration plugin.
Navigate to Appearance > Menus > and select Menu (Primary Menu (header)) and check the menus from User Registration Endpoints, you want to appear in primary menu.
- In your WordPress backend navigate to User Registration > Settings > General > My Account Endpoints and you will see what the URL of the edit-address should be, it is often set to “/my-account/user-logout/”
- Once you find out what the URL is navigate to Appearance > Menus > and select Menu (Primary Menu (header))
- Add a new link to your menu using the “Links” menu creation option, see screenshot below to see how we’ve added a custom log out link to the menu.
You can similarly add all provided endpoints such as (Lost Password, Change Password etc.)and endpoints you created.