Do you want to learn how to add register, login, and logout links to the WordPress navigation menu?
We often receive questions from our customers and users about how to add login/logout and register or sign-up links to their WordPress navigation menu.
By login/logout, we mean displaying a login link when the user isn’t logged in and a logout link when they are. This functionality improves site navigation and enhances user experience, making it easy for users to access their accounts from any page.
Whether you’re running an online store, a membership site, or a blog with user accounts, adding these links can make your site more user-friendly.
In this guide, we’ll explore the benefits of adding login/logout and register links to your WordPress menu and how to add these links using ProfilePress, in both classic and block themes, and with a code snippet.
Benefits of Adding Login/Logout and Register Links to WordPress
Adding login, logout, and register links to your WordPress menu has many benefits that can make your website easier to use and navigate. Here are some of the main advantages:
Enhanced User Accessibility: Users can access login, logout, and registration options directly from the main menu. This reduces the need to search for account-related links, improving overall usability.
Simplified Navigation: Placing these links in the main navigation menu makes it convenient for users to switch between logging in and out or signing up, creating a smoother browsing experience. This is especially helpful for membership sites or online stores where users frequently need to access their accounts.
Increased User Engagement: By providing quick access to account actions, you encourage users to interact more with your site. Returning visitors can easily log in while new users are prompted to register, boosting user participation.
Adding Login/Logout and Register Links to Your WordPress Menu
To get started, ensure you have installed and activated the ProfilePress plugin on your WordPress site.
How you add the links depends on your theme. Classic themes have an Appearance >> Menus screen. Block themes, such as Twenty Twenty-Five, don’t; you build their menus with the Navigation block in the Site Editor instead.
Classic Themes
Navigate to Appearance >> Menu.
You will see a ProfilePress Links metabox on the left-hand side. Expand and add the login, signup, and logout links you want to include to your WordPress website menu.

You can also add the login, logout, lost password, edit profile, and my profile links via the Customizer.

Block Themes (Navigation Block)
Go to Appearance >> Editor >> Navigation and open your menu. You can also open the template part that holds your header and select the Navigation block in it.
You can add the ProfilePress links in two ways.
From the block inserter: select any link in your menu, then click the + (Block Inserter) button at the top left of the editor and search for “ProfilePress”. Selecting a link first matters: if the Navigation block itself is selected, the inserter adds blocks outside the menu and the ProfilePress links don’t appear. All six links are listed: Log In, Log Out, Log In | Log Out, Sign Up, My Profile and Edit Profile, each marked “(ProfilePress)”. Click one to add it to your menu.

By typing the link: click the + inside the menu to add a link, type one of the URLs below and press Enter. Then change the link text to what you want the menu to show.
| URL | Link |
|---|---|
#pp-login |
Log In |
#pp-signup |
Sign Up |
#pp-logout |
Log Out |
#pp-loginout |
Log In | Log Out |
#pp-myprofile |
My Profile |
#pp-editprofile |
Edit Profile |
Type the URL without a trailing #, because the editor’s link field won’t accept it. For #pp-loginout, set the link text in the form “Log In | Log Out”: the text before the | is shown to visitors and the text after it to logged-in users.

The links also work inside submenus. Save your changes when you’re done.
Here is the same menu on the front end. Visitors see Log In and Sign Up, while logged-in users see My Profile and Log Out instead.

Note: the login and sign-up page links are hidden when a user is logged in. Also, the logout, my profile, and edit profile links are only shown to logged-in users, while in login/logout, the logout link is shown to logged-in users and login to users who aren’t logged in. This works the same way in classic and block themes.
Adding Login/Logout and Register Links to Your WordPress Menu with a Code Snippet
The code snippet below, when added to your theme’s functions.php file or a site-specific plugin, will add signup and login/logout links to your WordPress menu. It only works with classic menus. In a block theme, use the Navigation block method above.
function add_login_logout_register_menu( $items, $args ) {
if ( $args->theme_location != 'primary' ) {
return $items;
}
if ( is_user_logged_in() ) {
$items .= '<li><a href="'. wp_logout_url() .'">Log Out</a></li>';
} else {
$items .= '<li><a href="'. wp_login_url() .'">Log In</a></li>';
$items .= '<li><a href="'. wp_registration_url() .'">Sign Up</a></li>';
}
return $items;
}
add_filter( 'wp_nav_menu_items', 'add_login_logout_register_menu', 199, 2 );
Note: Using a ProfilePress front-end login, registration, and password reset page as your default, the menu URLs will automatically point to them.
In conclusion, adding login/logout and registration links using ProfilePress or a code snippet provides flexible options to meet your needs.
Start adding these links to your WordPress menu today and enjoy the benefits of a more user-friendly and accessible site.