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

WordPress auto login user after registration only from a specific page

Ues this function to redirect admin to dashboard

function admin_login_redirect( $redirect_to, $request, $user )
{
    global $user;
    if( isset( $user->roles ) && is_array( $user->roles ) ) {
        if( in_array( "administrator", $user->roles ) ) {
            return $redirect_to;
        }
    }
}
add_filter("login_redirect", "admin_login_redirect", 10, 3);

For more/brief detail read this article.

Page ID don’t come in quotes, See this line of your

if (is_page('484')){

Change this line like this

//Removed quotes from Page ID
if (is_page(484)){

As an alternate this can be done with Page Slug also like this

//Slug will come in quotes
if (is_page('Type_Page_Slug_Here')){

Related Posts:

  1. Separate registration and login for different roles
  2. SSO / authentication integration with external ‘directory service’
  3. How to prefill WordPress registration with social details
  4. Woocommerce registration page [closed]
  5. WordPress registration message
  6. How to remove the WordPress logo from login and register page?
  7. Login email after registration never sent or received
  8. I want to disable E-Mail verifcation / activation when a user signs up for my WordPress site
  9. How do I check if a post is private?
  10. Receiving “This content cannot be displayed in a frame” error on login page
  11. How to customise wp-login.php only for users who are setting a password for the first time?
  12. What hooks should I use for pre-login and pre-registration actions?
  13. Change register form action url
  14. Problem with logging in WP users automatically
  15. Is it possible a one click user registration with Facebook or Twitter (or other Social Networks)?
  16. Register/Login using only phone number?
  17. Force users to register in order to view website [duplicate]
  18. How do I force “users must be registered and logged in” on subsites?
  19. auto login after registeration for wp-members plugin
  20. How To Change Wp Register/Login URL Permanently To My Custom Page
  21. How to modify the action attribute of the wp-login.php?action=register form?
  22. Correct passwords keep appearing as incorrect
  23. Disabling standard registration login with username/email and password?
  24. Login form doesn’t log in
  25. Get the url of custom login page in the registration page
  26. By registering always make uppercase the first letter of the login
  27. Show reCaptcha on Custom Frontend Login & Register Form [closed]
  28. Best option to implement external register/login to WP from self-made API
  29. Auto Login After Registration
  30. Disable all other page except index,register,login till user login
  31. What speaks against using a custom login.php / register.php to wordpress?
  32. How do I add Login fields and registration link to the header?
  33. How to make a user be able to register if such a login already exists?
  34. Sending new registration meta values to admin by email
  35. Are login functions considered part of the WP backend?
  36. WordPress registration page template
  37. Removing “public” user registration without completely turning it off?
  38. Disable registration on certain condition
  39. what is the best and safest way to allow users to register to site
  40. Updated : how to make email optional while user registration using default wordpress form
  41. Problem in auto login after registration
  42. How to invalidate `password reset key` after being used
  43. Updating usermeta from login redirect to billing address
  44. Chosen user password in registration is not being accepted on Login
  45. User account activation links are lacking query strings
  46. Login user after registration programmatically
  47. How to get rid of the username of registration form in theme my login wp plugin?
  48. Where do I find “log in” and “register” link which are located on the top right corner?
  49. How to force login after user browses for a few minutes or browses a few pages?
  50. Registration and Login form
  51. WordPress and Magento: let WordPress manage user registration and logins?
  52. how to add custom word press regisration form in word press 3.5 with out module [closed]
  53. Click on banner to register to the blog
  54. How to put Login, Register and newsletter widget on the same page?
  55. make a login system for site visitors
  56. How to create a fully functional user registration in WordPress?
  57. In Django, how do I know the currently logged-in user?
  58. Check if wp-login is current page
  59. Can I programmatically login a user without a password?
  60. Can’t log in: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
  61. Is there any way to rename or hide wp-login.php?
  62. How to login with email only no username?
  63. How can I redirect user after entering wrong password?
  64. Increase of failed login attempts, brute force attacks? [closed]
  65. Login page ERROR: Cookies are blocked due to unexpected output
  66. Preventing session timeout
  67. How reduce wordpress login session timeout time?
  68. Check for correct username on custom login form
  69. Disallow user from editing their own profile information
  70. I can’t access my site via wp-admin
  71. ‘Password field is empty’ error when using autofill in Chrome
  72. Removing username from the ‘wordpress_logged_in’ cookie
  73. How to show ‘login error’ and ‘lost password’ on my template page?
  74. What is $interim_login?
  75. How to change “You must be logged in to post a comment.”
  76. Custom login form
  77. How to prefill the username/password fields on the login page
  78. wp_signon returns user, but the user is not logged in
  79. Adding extra authentication field in login page
  80. Prevent wp_login_form() from redirecting to wp-admin when there are errors
  81. Redirect user using the ‘wp_login_failed’ action hook if the error is ’empty_username’ or ’empty_password’
  82. wp_signon() does not authenticate user guidance needed
  83. What exactly is ReAuth?
  84. What are the differences between wp_users and wp_usermeta tables?
  85. WordPress auto login after registration not working
  86. Login members using web services
  87. Make my wordpress blog remember my login “forever”
  88. How to check in timber if user is loggedin?
  89. How do I change the language of only the login page?
  90. Disable WordPress 3.6 idle logout / login modal window / session expiration
  91. Stop WordPress from logging me out (need to keep me logged in)
  92. How to disable autocomplete on the wp-login.php page
  93. Share login data/cookies between multiple installations
  94. Synchronize WordPress user accounts across multiple domains and installations without using WordPress MU
  95. How to pass users back and forth using session data?
  96. How do I change the logo on the login page?
  97. Why does WordPress hide the reset password key from the URL?
  98. Is it possible to sign in with user_email in WordPress?
  99. How to use current_user_can()?
  100. Avoid to load default WP styles in login screen
Categories login Tags login, user-registration
API WordPress is Limited? Return False
How to control Post view count incresing in sidebar widget posts too?

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