Support » Fixing WordPress » WP-Admin Dashboard 404 Error after logging in

  • Resolved generalchiller

    (@generalchiller)


    Apologies if this issue has been resolved once before, but I’ve been trying for weeks now and can not seem to find a solution. It’s a bit of a hefty one, so scroll to the bottom for TL;DR.

    A few weeks back I encountered an issue that meant that I had to restore my site from a backup. I managed to salvage all of my wp-content files and also my database.

    After re-importing the database, I foolishly carried out a repair via PHPMyAdmin which seemed to mess up my site beyond repair. The blog page was not loading, as well as many other pages, and the infinite loading that it resulted in was maxing out my resource usage on Cpanel.

    I restored an older database from a month prior after making WordPress Imports (XML) of all my newer content like posts, pages, tables, UX templates and other things.

    The issue that I am now having is that whenever I log in to my site via wp-admin, I get in but I can not access the dashboard; there is a 404 error. My site runs fine on the surface, I just can’t access my dashboard for the life of me.

    I have spent weeks attempting to fix this. I have done everything recommended on these forums and elsewhere.

    Here is a list of what I have tried up to now:

    • Made sure that file permissions are correct
    • Disabled all of my plugins
    • Changed the theme back to a default one via the database
    • Tweaked the .htaccess file to reflect default values
    • Ensured that site_url is correct in database
    • Ensured that user credentials are correct in database
    • Re-uploaded clean versions of the wp-admin folder and wp-login PHP file from the WordPress website
    • Ensured that the DB Prefix was set up correctly in wp-config.php
    • Deleted my WPS-Hide-Login plugin to ensure this was not causing conflicts
    • After extensive trial and error, I have come to the conclusion that there was a problem with the database somewhere because, after a fresh install, I can access the wp-admin dashboard with no issues at all, but as soon as I import my DB backup, the issue returns.

      I have delved into the database quite deeply and made sure that all of the values are correct but am still having issues.

      This problem really has me stumped and I can not find any resolution online or otherwise. I really don’t want to have to build my website from scratch as it was a WooCommerce site with around 4,000 products (which I have the backups for).

      Whenever I do try and start afresh, I get all sorts of issues when importing my content and products. My media library is empty despite the content being there in FTP (pictures still show on posts but not in library), WooCommerce products won’t import properly (which I’ve logged a ticket with them for), and there are just broken links everywhere.

      I even tried merging different parts of the databases by straight-up copying the DB queries from the different DB backup files and inserting them manually via PHPMyAdmin (for wp_termmeta, wp_terms, wp_term_relationships).

      As you can hopefully tell, I am not just a novice that has fumbled around here, I have gone deep with this and am still no closer to figuring out the issue. Any help would be much appreciated.

      TL;DR
      After restoring my database from an old backup I am unable to access the WP dashboard. I am able to log in as normal and my site works fine, but I get a 404 error when trying to access the dashboard or the updates section.

      Everything that there is to try I have tried and am still no closer to finding a solution. The only thing left to do is a fresh install and a re-build, which I am trying to avoid at all costs.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Deleted my WPS-Hide-Login plugin to ensure this was not causing conflicts

    As the frontend works fine and both login pages return a 404 page, I would say the settings for the plugin are still in the database. Using phpMyAdmin do a database Search for WPS and delete any entries found for it.

    After the Search, do a database Export using phpMyAdmin so you have a current (and working) database backup.

    Thread Starter generalchiller

    (@generalchiller)

    Hi @website-rob,

    Thanks for the response!

    The login page itself is fine, I am able to enter my credentials and gain access to the backend. It’s my dashboard page that is returning the 404 error.

    I will try your solution anyway to see if it makes a difference.

    Cheers

    Thread Starter generalchiller

    (@generalchiller)

    Managed to fix the issue. Did a fresh install and imported all of the backups I had made in WordPress export before my problems started.

    Because the database was new, many of my images weren’t showing in the media library, which became another major problem.

    After some scouring the forums I managed to resolve this by exporting only the wp_postmeta and wp_posts tables from the old DB, dropping them both from the fresh DB, and then importing the .XML file with the two new wp_postmeta and wp_posts tables.

    Now I have all my posts, images are showing correctly, and my site is back to the same state that it was before all this started. I did have to import the WordPress menu backup a second time as the setting in the DB messed up my menus, but after that, I’m back to normal.

    My takeaways are:

    • Always take backups. WPress backups, database backups, wp-content backups etc.
    • If you’re not sure what you’re doing, don’t do it. Especially with databases
    • Don’t overwrite backups with newer ones, just in case. Name them something else (I just add a number at the end).
    • If you get frustrated after doing tons of research without getting anywhere, take a day or two off and let your research float around for a bit and form new approaches. Don’t try working tirelessly day and night rushing to fix it, you’ll get really bad tunnel vision

    Good to hear you were able to troubleshoot the problem and resolve the issue. Your follow up post as to what you did may help someone in the future with the same problem.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WP-Admin Dashboard 404 Error after logging in’ is closed to new replies.