WordPress

How to fix the most common WordPress errors

Before touching anything, make a backup. Then find your error in this list.

"Error establishing a database connection"

WordPress cannot reach its database.

  1. Open wp-config.php in cPanel's File Manager.
  2. Check DB_NAME, DB_USER and DB_PASSWORD match what cPanel → MySQL Databases shows, and DB_HOST is localhost.
  3. If you changed the database user's password, update it in wp-config.php too.

Blank screen or "There has been a critical error on this website"

Almost always a plugin or the theme after an update.

  1. In File Manager, open wp-content and rename the plugins folder to plugins-off.
  2. If the site comes back, restore the original name and deactivate plugins one by one to find the culprit.
  3. If it does not, do the same with your theme folder in wp-content/themes.
  4. WordPress also e-mails you a recovery mode link: use it to log in and deactivate the plugin.

Error 500 (Internal Server Error)

  • Rename .htaccess in public_html to .htaccess-old. Then go to Settings → Permalinks and click Save to create a new one.
  • If it persists, check the error_log file in public_html: it says which file fails.

"Too many redirects"

  • In the database table wp_options, check siteurl and home have the same address and protocol (https://).
  • If you use Cloudflare, set its SSL mode to Full (not Flexible).

"Allowed memory size exhausted" or you cannot upload large files

  1. In cPanel open MultiPHP INI Editor and choose your domain.
  2. Raise memory_limit to 256M, and upload_max_filesize and post_max_size to 64M.
  3. Save and try again.

You cannot log in to /wp-admin

  • Use Lost your password? on the login screen.
  • If the e-mail does not arrive, open phpMyAdmin, open the wp_users table and change your user's user_pass choosing the MD5 function with a new password (then change it from your profile).

Cannot find your error or the fix did not work? Open a ticket with your site address and a screenshot of the error.