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

Admin Panel 404 Error after login

I should have changed false to true in the line $login = wp_signon( $creds, false );

so the final working code is

if($_POST){
    if (!empty($_POST['username']) && !empty($_POST['password'])) {
        $creds = array(
            'user_login'    => $_POST['username'],
            'user_password' => $_POST['password'],
            'remember'      => true
            );
        $login = wp_signon( $creds, true);
        if ( is_wp_error( $login ) ) {
            $exiturl = get_site_url().'/account/auth';
            header("Location: $exiturl");
            exit();
        }
} else {
    echo "access denied";
}

Related Posts:

  1. Changing user_nicename
  2. automated tests as a user?
  3. User management system similar to wordpress one?
  4. Programmatic Login from 3rd Party site
  5. Change CSS based on is_user_logged_in
  6. How to block specific user id in custom login form?
  7. Call WP Rest-Api to GET /users/me returned NOTHING in console
  8. is_user_logged_in() not working in homepage
  9. List users in a dropdown for login
  10. User registration followed by automatic login
  11. How to change the wp-login.php page title?
  12. How build a custom login/register form with error handling?
  13. Add extra field to users
  14. What is the most efficient way to search users by their display name?
  15. Network installation giving errors when viewing or adding a user
  16. Showing user ID on user main page from screen options
  17. Getting the Current User
  18. How do I hide specific user profile fields?
  19. WordPress 4 invalid username special charachters issue
  20. Authenticating to WordPress, using my own authentication two-factor system
  21. Using a nonce in a Custom Login Form
  22. How can I default to all WordPress roles when parameter is not included in shortcode?
  23. there’s a way to include a minimal WP for check only the current user, its roles (caps?) and then release/free it?
  24. Remove username in emails or swap username for email
  25. Delete option value from array using update_option()
  26. woocommerce and is_user_logged_in() if not redirect to homepage
  27. get_users(…) only returns one user
  28. Check if user is logged in when clicking certain links on certain pages
  29. List User order by ID in Descending order (Backend)
  30. How to get a list of all possible values of a specific user meta key?
  31. Is it necessary to sanitize wp_set_password user input?
  32. How to give new users two specific user role options upon WordPress user registration
  33. Wp-login appears White Screen, Error: Cannot modify header information
  34. Custom user login page by creating a plugin
  35. Cannot access wp-admin/wp-login.php (WordPress backend) anymore, what could be wrong?
  36. How to debug my custom login form looping intermittently
  37. user_profile_update_errors hook not executing
  38. add_cap not working
  39. wordpress archive a user
  40. Login to wordpress by clicking a link and specifying usernaname and password in url
  41. Call to undefined function get_userdata() in plugin
  42. Log in / Log Out Custom Button
  43. Should `wp_login` be used since it’s deprecated?
  44. How to show a users bio on a page
  45. How can I open up my administrative panel to everyone?
  46. How do you create two separate Register pages?
  47. How can I add a new row in a separate database when someone registers via WordPress?
  48. Shortcode to log user into current URL
  49. I installed WordPress locally now how do I login?
  50. Change homepage content if user is logged in – BuddyPress
  51. php return username of currently viewed author profile
  52. How to list users like an archive page 10 users on page and have navigations
  53. Redirect to current user page upon link click
  54. is_user_logged_in returning nothing on custom page
  55. Use of antispambot with $curauth->email
  56. Generate a QR code when creating a new WordPress user
  57. Change wordpress’ database data using ajax – how to get current user id?
  58. Sort column in Users admin Tab
  59. Allow a user or role to view drafts and previews, but not other admin privileges?
  60. PHP warning – Use of undefined constant ‘FORCE_SSL_LOGIN’ ‘FORCE_SSL_ADMIN’ on wp-config.php
  61. Get current user id in function php
  62. how can I call a function when time expire
  63. Having trouble creating two shortcodes, one for logged in user and one for visitors
  64. Uploading/integrating custom user registration page
  65. Restrict wordpress access to logged users only
  66. Page template not working when logged out
  67. Display current user metadata on WordPress page
  68. Refresh page after login with litespeed cache
  69. Redirect after login depending on the URL
  70. Need help with AJAX login to call php in functions.php to handle redirects based on user cap (role)
  71. Add another role to a user when they click a button?
  72. wordpress more than one ajax request at the same time issue
  73. Can’t get_users info by using json_encode
  74. Check if a user is logged into my WordPress site which is on a different server
  75. Changing WordPress author name in database
  76. Newbie question. Login/Registration. New PHP page
  77. Loop 1 user randomly
  78. How to set max users to 17.000
  79. Not logged in when using http
  80. add bootstrap modal after login in wordpress
  81. How to ‘remember’ a site member’s last visited page?
  82. How to connect database table to each registered wordpress user.
  83. White screen after login attempt
  84. Display a list of users with avatar filterable with alphabets
  85. Redirect users not logged in to the standard login page (and back) from some posts and pages
  86. Parse error: syntax error, unexpected ‘}’ in C:\wamp64\www\Proiect\aplicatie\user_check.php on line 18 [closed]
  87. Check if username doesn’t exists
  88. WP query with variables gives no result for specific user
  89. Import users and custom user meta from csv
  90. Prevent users from display default wordpress login form
  91. login redirect based on user role not work as expected
  92. How to lock users account until approvation
  93. rest_cannot_create_user – Sorry, you are not allowed to create new users. CURL WORDPRESS REST API
  94. Getting invalid user ID error when creating a new user with wp_insert_user
  95. How to change wp-admin and wp-login urls
  96. How to create a User Role and give permission to only use Web Stories plugin?
  97. How to add custom user role into wordpress
  98. Redirect to current URL and append specified URL parameter on unsuccessful login through Elementor login form widget
  99. Redirect WordPress page to the latest created post by the logged in author/user
  100. Can’t programmatically log user in php
Categories PHP Tags login, php, users
echo product parent category
Get data from custom table and update relative post_meta based on meta_key

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