Critical Error Warning

How to Access WordPress Admin with a Critical Error Warning

Encountering a “Critical Error” warning in WordPress can feel overwhelming, especially when you can’t access your admin dashboard to fix the issue. Don’t worry, though.

This guide will show practical steps to regain access and resolve the error.

Step 1: Enable Debugging Mode

Debugging mode helps identify what’s causing the error. Here’s how to enable it:

  1. Access Your Site’s Files: Use an FTP client like FileZilla or your hosting provider’s File Manager.
  2. Locate the wp-config.php File: This file is in your WordPress root directory.
  3. Enable Debugging: Add the following lines before the “/* That’s all, stop editing! Happy blogging. */” line:

define(‘WP_DEBUG’, true);

define(‘WP_DEBUG_LOG’, true);

  1. define(‘WP_DEBUG_DISPLAY’, false);
  2. Save the File: Upload the updated file back to your server.
  3. Check the Debug Log: Look for the error log in the /wp-content/ folder. The file is named debug.log.

This log will tell you which plugin, theme, or script is causing the error.

Step 2: Deactivate Plugins via FTP

If a plugin is causing the error, you can deactivate all plugins without accessing the admin dashboard.

  1. Access Your Site via FTP: Open FileZilla or your hosting File Manager.
  2. Go to the Plugins Folder: Navigate to wp-content/plugins/.
  3. Rename the Plugins Folder: Rename the folder to plugins-disabled. This will deactivate all plugins.
  4. Check Your Site: Visit your website. If the error is gone, one of your plugins is the culprit.
  5. Reactivate Plugins One by One: Rename the folder back to plugins and activate each plugin individually through the admin dashboard to find the problematic one.

Step 3: Switch to a Default Theme

A faulty theme can also cause a critical error. You can switch to a default theme without using the admin dashboard.

  1. Access Your Site’s Files via FTP:
  2. Go to the Themes Folder: Navigate to wp-content/themes/.
  3. Rename Your Active Theme Folder: Rename your current theme’s folder (e.g., mytheme to mytheme-old).
  4. Activate a Default Theme: WordPress will automatically activate a default theme like Twenty Twenty-Three if installed. If it’s not, you’ll need to upload it manually.
  5. Check Your Site: Visit your website to see if the error is resolved.

Step 4: Increase PHP Memory Limit

Running out of memory can trigger a critical error. You can increase the PHP memory limit to fix this.

  1. Edit the wp-config.php File:
    • Open the file in your root directory.
    • Add the following line before the “/* That’s all, stop editing! Happy blogging. */” line:
  2. define(‘WP_MEMORY_LIMIT’, ‘256M’);
  3. Save and Upload the File: This increases the memory limit to 256 MB.
  4. Check Your Site: Reload your website to see if the error is fixed.

Step 5: Update PHP Version

Using an outdated PHP version can cause compatibility issues. Here’s how to update it:

  1. Log In to Your Hosting Panel: Most hosting providers allow you to update PHP via cPanel or another control panel.
  2. Find the PHP Selector: Look for an option like “Select PHP Version.”
  3. Choose a Supported Version: Select a version supported by WordPress, like PHP 8.0 or 8.1.
  4. Save Changes: Apply the changes and reload your site.

Step 6: Restore a Backup

If none of the above steps work, restoring a backup can bring your site back to its last working state.

  1. Log In to Your Hosting Panel: Access your host’s backup tool.
  2. Select a Recent Backup: Choose a backup created before the error occurred.
  3. Restore Your Site: Follow the instructions to restore your files and database.

Step 7: Contact Your Hosting Provider

If you still can’t fix the issue, contact your hosting provider. Many hosting companies offer technical support and can help troubleshoot the problem. They might check server logs, resolve configuration issues, or even fix the error for you.

Final Thoughts

Dealing with a critical error warning can feel daunting, but you can fix it properly. Start by enabling debugging mode to identify the problem. Then, try deactivating plugins, switching themes, or increasing your PHP memory limit. If all else fails, restoring a backup or contacting your hosting provider can save the day.

Following these steps and practicing regular site maintenance will minimize the chances of running into critical errors in the future. 

Join us and other site creators to share your latest project or get a quick advice on website building.

Live Composer is free and open-source. We invite all the users and developers to join us in plugin development.

It's super easy to create designs or extensions for Live Composer. Sell your add-ons to 30K+ plugin users.