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. WordPress change role from administrator to author by itself (automatically)
  4. How to redirect/rewrite all /wp-login requests
  5. Unable to login to my wordpress site. reauth=1 redirection loop
  6. Custom login redirects to wp-admin on wrong password
  7. How to allow users login to WP from external domain and make REST requests
  8. Only allow administrators and editors to access wp-admin
  9. Users are redirected to homepage instead of wp-admin
  10. Moving wordpress from localhost to server throws admin panel access error?
  11. Display sortable User meta column in admin panel user’s page
  12. How to move wp-admin login page to another location? [closed]
  13. Can’t access admin dashboard with wp-admin without /index.php after it
  14. Adding body class to login page?
  15. Edit a WordPress site without the username and password?
  16. comment_form – show all fields when logged in
  17. Using /wp-admin works, using /login gives a 404. Why?
  18. Cannot log into WordPress Dashboard after removing/adding .htaccess
  19. Change WP-Login or WP-Admin
  20. How to inhibit dashboard and profile management access to normal users?
  21. Only allow administrators and editors to access wp-admin
  22. I cannot log into my wordpress site with my wp-login.php [closed]
  23. How do I set the homepage to the WordPress Admin Dashboard login?
  24. How to stop – Database Update Required – from happening again?
  25. Today, without warning, all admin panel logins redirect to home page after login. non-admin users logins work well
  26. Can’t login to Dashboard when changing site URL to HTTPS
  27. Detecting all admins that are logged in
  28. Redirect non-admin users away from wp-admin/index.php (main dashboard page) to wp-admin/profile.php
  29. WordPress and bbPress Login conflicts?
  30. Subscribers become Authors after Upgrade? / Mass Update of Users?
  31. I want to disable login of admin (/wp-admin) with email and make it accessible only with username
  32. Website looks fine, but login to wp-admin yields a blank screen
  33. admin_post action not usable if admin access denied to user
  34. cannot find the login page for local WordPress site
  35. Unable to locate WordPress Root directory
  36. Restrict Author role to only 3 wp-admin pages
  37. Users disappeared from wp-admin
  38. Modify WP-Admin login fields
  39. display dynamic WP Site logo on wp-admin using CSS
  40. How to Change The WordPress Login URL Without Plugin
  41. wp-admin – 404 after custom login form
  42. How to fix ‘WordPress redirection loop problem in wp-login.php page’?
  43. Logging into sandbox subdomain WP
  44. 404 redirect wp-login and wp-admin after changing login url [closed]
  45. Having troubles connecting to WordPress login page using Mamp
  46. Sorry, you are not allowed to access this page
  47. WP Admin/ WP Login Redirect to themselves
  48. An update has caused my client’s site to be non-existent after new update of WordPress [closed]
  49. wp-admin throwing 500 errors after update to 4.2.1
  50. Cookie Domain is preventing Admin login
  51. I can´t access my admin panel. I tried all possible solutions
  52. Require Login Redirect to Login Page
  53. Cannot access WordPress login pages
  54. Lost administrator privileges and can’t find a fix
  55. Cant login to wp-admin
  56. How to remove dashboard access (wp-admin) for author but not disable the capabilities?
  57. /wp-admin/ doesn’t work but /admin/ does
  58. Deploying WordPress for clients – what do they have access to?
  59. “WordPress installations is currently out of date” problem with difficult situation [closed]
  60. Why am I locked out of the system?
  61. Why can I log into wp-login.php and not wp-admin.php?
  62. Disable Admin CP authentication (or auto login)
  63. firing function at login within class
  64. WP-admin or any other is redirecting me to (This page doesn’t seem to exist.)
  65. How to Find The Email of a WP Admin Account
  66. wp-login not found – All usual solutions not working
  67. how can provide access to wp_admin page for non wp_users?
  68. Why when I try to access to this old WordPress site it is opened the installation page?
  69. Can’t connect to WP-Admin, blank error message
  70. Blank page when viewing wp-admin
  71. GoDaddy hosting wp-admin problem
  72. WP Admin Login keeps redirecting to login
  73. Error messages & can’t reach admin after upgrading to 3.4.1 WordPress
  74. Is WordPress secure enough for a multi-user article directory?
  75. CPU overload spam – redirect link to wp-admin and new post
  76. Admin Page access
  77. Not able to access WP Admin, it says “Sorry, you are not allowed to access this page.”
  78. How to logout the current user without notices and warnings?
  79. Login issue with subdomain installs
  80. How can I can I make changes to a WP project I pulled from GItHub?
  81. WordPress Admin Login Issue
  82. How to log into WordPress via GET/POST
  83. restrict admin panel sections to users
  84. wp-login.php entering password nothing happens
  85. Trying to login to my site redirects me to the first page
  86. stop customize.php redirect to login page if admin is not logged in
  87. Admin Login Checks
  88. WordPress logged in but no access to wp-admin
  89. Changed the path to wp-login and now can’t access WPress dashboard
  90. Unable to log in as admin
  91. Why my login panel has a wrong language?
  92. Handling multiple account logins?
  93. Not able to access WP admin Page, redirected and a drop down login menu appears 401 error
  94. Localhost install: Administrator lost administrator access; cannot access Dashboard
  95. WordPress Login for multiple sites
  96. Cannot login in WordPress even after changing hash password in phpmyadmin
  97. Can’t log into WordPress after domain change
  98. Why WordPress not logout after I have close my browser?
  99. is_admin() conditional statement
  100. Admin Login page not working at all
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
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 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