Shortcodes for Log In and Log Out

Dynamic Log In and Log Out button in WordPress menu

Insert dynamic Log In and Log Out link in your WordPress menu (Go to Appearance > Menu in your wp-admin) by inserting the following shortcode in the “navigation label” field when you add the Custom Link.

[loginout login="Log in" logout="Log out"]


You can see the result of inserting the shortcode in the “Navigation Label” on this website.

Log Out and Log In link in menu