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

After Upgrade: $user becomes unknown (id: 0) after successful login?

Editing the core files is not recommended. You may try downloading a clean install of WordPress files. If you can, set the current theme to TwentySeventeen so your database is ready to work with a clean install.

Make sure to back up your database if you have not already.

Follow the codex instructions to delete the old WordPress files. They have a nice list of all the files you want to keep for the clean install. Although, rather than deleting, I recommend changing the directory name to something like wordpress-backup and then installing the new files with the original directory name wordpress or whatever it’s currently called.

Then you can start copying over the essential files. Be sure to do this before trying to run the site again. Especially if you could not switch to the TwentySeventeen theme first. You will want to make sure the theme you’re currently using will be found. Here are the files to copy to the clean install:

  • wp-config.php file;

  • wp-content folder;

  • wp-includes/languages/ folder–if you are using a language file, and
    it is here rather than in wp-content/languages/, do not delete this
    folder (you might want to move your language files
    to wp-content/languages/ for easier upgrading in the future);

  • .htaccess file–if you have added custom rules to your .htaccess, do
    not delete it.

  • Custom Content (themes) and/or Plugins–if you have any images or other custom
    content or Plugins inside the wp-content folder, do NOT delete them.

Now test the site and try changing the theme to TwentySeventeen theme if you couldn’t do that before. It’s always best to test the defaults first to rule out an incompatible theme or plugin as you did earlier.

Related Posts:

  1. Can’t access WordPress as an admin – but I can log in as a user!
  2. define two login page url
  3. How to redirect/rewrite all /wp-login requests
  4. Custom login redirects to wp-admin on wrong password
  5. How to allow users login to WP from external domain and make REST requests
  6. Only allow administrators and editors to access wp-admin
  7. Users are redirected to homepage instead of wp-admin
  8. Moving wordpress from localhost to server throws admin panel access error?
  9. Display sortable User meta column in admin panel user’s page
  10. How to move wp-admin login page to another location? [closed]
  11. Can’t access admin dashboard with wp-admin without /index.php after it
  12. Adding body class to login page?
  13. Edit a WordPress site without the username and password?
  14. comment_form – show all fields when logged in
  15. Using /wp-admin works, using /login gives a 404. Why?
  16. Cannot log into WordPress Dashboard after removing/adding .htaccess
  17. Change WP-Login or WP-Admin
  18. How to inhibit dashboard and profile management access to normal users?
  19. Only allow administrators and editors to access wp-admin
  20. I cannot log into my wordpress site with my wp-login.php [closed]
  21. How do I set the homepage to the WordPress Admin Dashboard login?
  22. How to stop – Database Update Required – from happening again?
  23. Today, without warning, all admin panel logins redirect to home page after login. non-admin users logins work well
  24. Can’t login to Dashboard when changing site URL to HTTPS
  25. Detecting all admins that are logged in
  26. Redirect non-admin users away from wp-admin/index.php (main dashboard page) to wp-admin/profile.php
  27. WordPress and bbPress Login conflicts?
  28. I want to disable login of admin (/wp-admin) with email and make it accessible only with username
  29. Website looks fine, but login to wp-admin yields a blank screen
  30. admin_post action not usable if admin access denied to user
  31. cannot find the login page for local WordPress site
  32. Unable to locate WordPress Root directory
  33. Restrict Author role to only 3 wp-admin pages
  34. Users disappeared from wp-admin
  35. display dynamic WP Site logo on wp-admin using CSS
  36. How to Change The WordPress Login URL Without Plugin
  37. wp-admin – 404 after custom login form
  38. How to fix ‘WordPress redirection loop problem in wp-login.php page’?
  39. Logging into sandbox subdomain WP
  40. 404 redirect wp-login and wp-admin after changing login url [closed]
  41. Having troubles connecting to WordPress login page using Mamp
  42. Sorry, you are not allowed to access this page
  43. WP Admin/ WP Login Redirect to themselves
  44. An update has caused my client’s site to be non-existent after new update of WordPress [closed]
  45. wp-admin throwing 500 errors after update to 4.2.1
  46. I can´t access my admin panel. I tried all possible solutions
  47. Require Login Redirect to Login Page
  48. Cannot access WordPress login pages
  49. Lost administrator privileges and can’t find a fix
  50. Cant login to wp-admin
  51. How to remove dashboard access (wp-admin) for author but not disable the capabilities?
  52. /wp-admin/ doesn’t work but /admin/ does
  53. Deploying WordPress for clients – what do they have access to?
  54. Why am I locked out of the system?
  55. Why can I log into wp-login.php and not wp-admin.php?
  56. Disable Admin CP authentication (or auto login)
  57. firing function at login within class
  58. WP-admin or any other is redirecting me to (This page doesn’t seem to exist.)
  59. How to Find The Email of a WP Admin Account
  60. wp-login not found – All usual solutions not working
  61. how can provide access to wp_admin page for non wp_users?
  62. Why when I try to access to this old WordPress site it is opened the installation page?
  63. Can’t connect to WP-Admin, blank error message
  64. Blank page when viewing wp-admin
  65. WP Admin Login keeps redirecting to login
  66. Is WordPress secure enough for a multi-user article directory?
  67. CPU overload spam – redirect link to wp-admin and new post
  68. Admin Page access
  69. Not able to access WP Admin, it says “Sorry, you are not allowed to access this page.”
  70. How to logout the current user without notices and warnings?
  71. Login issue with subdomain installs
  72. How can I can I make changes to a WP project I pulled from GItHub?
  73. WordPress Admin Login Issue
  74. How to log into WordPress via GET/POST
  75. restrict admin panel sections to users
  76. wp-login.php entering password nothing happens
  77. Trying to login to my site redirects me to the first page
  78. stop customize.php redirect to login page if admin is not logged in
  79. Admin Login Checks
  80. WordPress logged in but no access to wp-admin
  81. Changed the path to wp-login and now can’t access WPress dashboard
  82. Unable to log in as admin
  83. Why my login panel has a wrong language?
  84. Handling multiple account logins?
  85. Not able to access WP admin Page, redirected and a drop down login menu appears 401 error
  86. Localhost install: Administrator lost administrator access; cannot access Dashboard
  87. WordPress Login for multiple sites
  88. Cannot login in WordPress even after changing hash password in phpmyadmin
  89. Can’t log into WordPress after domain change
  90. Why WordPress not logout after I have close my browser?
  91. is_admin() conditional statement
  92. Admin Login page not working at all
  93. Impossible User Registration
  94. Couple questions about .htaccess, login page, updates
  95. WordPress blog fails to open
  96. Is it possible to tell if a user is logged into WordPress from looking at the cookies which are set?
  97. Redirect users based on their roles, is_admin()
  98. WordPress site shows a white page for site/wp_admin. A login returns again to the login screen
  99. Admin access to secondary site user_can_access_admin_page losing login
  100. login_enqueue_scripts changes are not reflecting
Categories wp-admin Tags login, upgrade, user-access, wp-admin
javascript and css not loading properly in WordPress site
Display posts, subcategories and categories of custom post type and taxonomy

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