Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Redirect user to specific link after login

The login_redirect filter should works (add this code into your theme functions.php):

function my_login_redirect( $redirect_to, $request, $user ) {
    $redirect_to =  home_url($user->user_nicename);
    return $redirect_to;
}
add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );

For “PROFILE” in the menu (add this code into your template file where you want to display it):

if ( is_user_logged_in() ) {
    $current_user = wp_get_current_user();
    echo '<a href="' . esc_url( home_url( $current_user->user_nicename ) ) . '">PROFILE</a>';
}

UPDATE: If you manage menu from backend, I don’t know if any better solution, but this will works:

Add a custom menu item with name “PROFILE”, and add this code in your theme functions.php:

function filter_nav_menu_items( $menu ) {
  if ( $menu->title == 'PROFILE' ) {
    if ( is_user_logged_in() ) {
      $current_user = wp_get_current_user();
      $menu->url = home_url( $current_user->user_nicename );
    }
    else {
      $menu->_invalid = true;
    }
  }

  return $menu;
}
add_filter( 'wp_setup_nav_menu_item', 'filter_nav_menu_items', 999 );

Related Posts:

  1. Redirect user to original url after login?
  2. Login redirect to previous page
  3. Redirect to referring page after logging in
  4. check first time login only
  5. How to change the default logout link on WordPress Admin
  6. How to redirect after login, the working way?
  7. Password change when the user login first time
  8. Custom login form redirect to external site
  9. handling login/logout redirects
  10. Restrict Access to wp-login.php
  11. Using `auth_redirect` : keeps asking me to login even when I’m logged in
  12. Redirect users after first login
  13. Redirect to current page after wordpress login
  14. wp-login.php β€” redirect logged in users to custom URL
  15. Redirect user after login/registration globally
  16. Redirect to login page
  17. You do not have sufficient permissions to access this page
  18. Redirect user after logout
  19. how to do logout redirect to current url
  20. How to redirect user to specific page based on the input password
  21. How do I redirect a user when he is logged in after clicking on a menu
  22. How to modify the Register link in the login page?
  23. Changing “Lost Password Email Link” to custom password reset page
  24. How to redirect user to a specific page based on username?
  25. Redirect after password update
  26. How to redirect user after login to a specific page?
  27. Redirect Logged In User if page is wp-login.php and $_Get[‘level’] = X
  28. Redirect when accessing /login when logged in
  29. How to redirect after login getting a variable from url (for example with the language)
  30. If User is NOT Logged in and Page ID is not 6 – Redirect to Login
  31. Redirect to Current Page after Login
  32. How to include error message on login
  33. Is it possible to incorporate username in a login redirect?
  34. Login redirect problem
  35. How to redirect on login to a specific page if a specific meta user is empty
  36. redirect Login problems
  37. Redirect user to previous page after signup from custom form
  38. How can I force the user to log in, even if they’re already authenticated?
  39. User is logged in after Stripe payment, then redirected, but is then logged out again
  40. Login Redirect – Multiple Scenarios
  41. WooCommerce – Redirect to a product after login
  42. Usage of the login_redirect filter
  43. Login/Register redirect user with message
  44. Redirect user to original url after login?
  45. Prevent users from going to wordpress profile after login
  46. Custom form redirect after login
  47. Custom redirect user after login based on metadata
  48. Add Username to URL for redirect
  49. Custom Login Form – Redirect user to login page if not logged in
  50. Redirection on Custom page
  51. Load function with login_redirect
  52. Prevent “/login” to redirect to “/wp-login”
  53. Redirect User to login page
  54. All URLs Redirect to Main Page
  55. How to redirect user after login to the page called by his first name?
  56. redirect doesn’t work while using example code
  57. Why I am not able to direct user to my blog section without login?
  58. Redirect After Login Error
  59. Redirect certain pages if user logged in
  60. Force User Login
  61. wp_login_form redirect
  62. custom login form redirect problem
  63. Login redirect to previous page
  64. Trying to re-direct users to specific page based on an ACF variable
  65. Disable redirect to homepage after successful Login, Stay on Current Page
  66. Redirect to custom login page if not logged in and redirect to home if logged in user try to login, how?
  67. Redirect users with “.” (dot) in their username and replace with “-” (dash) to correct profile
  68. wp_login_form() redirect same page
  69. How force WordPress redirect to current custom page after login
  70. Hide a Post everywhere except on redirect
  71. Conditional Login Redirect
  72. Keep the old referrer after failed login
  73. How do I share a site only to one User at the time? Please help πŸ₯ΊπŸ™Œ
  74. Determine user destination on wp-login.php
  75. Redirect user after login to prior page through a wp_login hook
  76. How can force redirected to login for two or more pages to view or access
  77. How to redirect user to Referrer Page using wp_signon in Custom Login Page in WordPress
  78. Redirect after login when WordPress in subdirectory
  79. HOW do you Redirect buddypress login to EDIT tab not PROFILE tab on profile page? [closed]
  80. Login redirects to home page and doesn’t log in
  81. WordPress not loggin user and redirecting after custom registration
  82. redirect_to ignoring the SSL
  83. Redirect user on login using extra field value on login form
  84. Woocommerce login to specific page or referrer
  85. wp-login.php redirect problem
  86. login redirect problem – db charset issue?
  87. How to modify the WordPress comes with redirect
  88. Conditional redirect on login using referring URL
  89. Redirect problem: How to redirect to the original URL after login
  90. Custom Login Plugin Redirects to wp-login.php After Site Migration
  91. Login Form Redirection
  92. Redirect user to login and then to page where they came from
  93. WordPress Login Page redirecting after failed login
  94. How to block direct access to files upload in edd folder
  95. How to Block WordPress from subdomain?
  96. Logging back into WordPress after logging out and having issues with ‘loggedout=true’ in redirect URL
  97. login page not working [closed]
  98. Redirect after user changes password
  99. redirect users to the login page
  100. WordPress redirect to splash page once a day for the first week
Categories redirect Tags login, redirect, user-access, username
Add (grand)child pages automatically to nav menu
Can’t alter $lostpassword_url

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
Β© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress