WordPress

WordPress Common Errors and Fixes

By the Domain India teamPublished 5 min read
Knowledge base article
Contents (6 sections)

Most WordPress breakdowns come down to five errors: a white screen or "critical error", "Error establishing a database connection", a 500 Internal Server Error, "Allowed memory size exhausted" and a login page that keeps reloading. Each has a short list of causes and a fix you can apply yourself from your control panel. This page gives the quick fix for each and links to the full guide.

For the full guide

The complete method, with the error logs to read and fixes for Joomla and Drupal too, is in troubleshooting WordPress and other CMS. This page is the short WordPress checklist.

Key takeaways

Read the error first: turn on WP_DEBUG_LOG and check wp-content/debug.log. A white screen is usually a plugin or theme, so rename the plugins folder to test. A database error means the details in wp-config.php don't match your panel. A 500 is often .htaccess, including any php_value line. On our cPanel servers, add ?t=1 to the URL when you test, because a cached copy can hide your fix.

Back up before you change anything

Copy any file before you edit it and export the database from phpMyAdmin. On cPanel and DirectAdmin, JetBackup 5 keeps weekly backups (Sunday, 5 copies) that you can restore from your panel; see backup and restore with JetBackup.

1. White screen or "There has been a critical error"

Cause: a PHP fatal error, usually from a plugin or theme update.

  1. Use the recovery-mode link WordPress emails to the site admin, if it arrived: it logs you in with the faulty plugin paused.
  2. Otherwise, add these lines to wp-config.php above the "stop editing" line, reload the page and read wp-content/debug.log:
php
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
  1. No log? In File Manager or FTP, rename wp-content/plugins to plugins-off. If the site returns, rename it back and turn plugins off one at a time to find the culprit. Do the same with the active theme's folder.
  2. Set WP_DEBUG back to false when you are done.

Full walk-through: fixing the WordPress blank page.

2. "Error establishing a database connection"

Compare DB_NAME, DB_USER, DB_PASSWORD and DB_HOST in wp-config.php with your panel's Manage My Databases page. On shared hosting, DB_HOST is normally localhost, and the database and user names start with your account username. Check the user is added to the database with all privileges. If everything matches and it still fails, open a ticket. See troubleshooting the database connection error.

3. 500 Internal Server Error

  1. Rename .htaccess to .htaccess_old
    and reload. If the site works, go to Settings › Permalinks and click Save Changes to write a clean one.
  2. Remove any php_value or php_flag line.
    Our servers don't run PHP as an Apache module, so those lines cause a 500; set PHP options in your panel instead.
  3. Check the PHP version in your panel
    an old plugin can fail on a new version.

See troubleshooting HTTP 500 in WordPress.

4. "Allowed memory size exhausted"

Raise WordPress's own limit in wp-config.php:

php
define( 'WP_MEMORY_LIMIT', '256M' );

This can't go above the PHP memory_limit set for your account; change that in your panel. If a plugin keeps running out, the plugin is the problem. See resolving PHP memory errors.

5. Login page keeps reloading

  1. Clear cookies for your site
    , or try a private window.
  2. Check
    that WordPress Address and Site Address match exactly, including https:// and www. If you can't log in to change them, correct siteurl and home in the wp_options table in phpMyAdmin.
  3. Rename the plugins folder
    to rule out a security or caching plugin.

6. Other errors you may see

ErrorUsual cause
508 Resource Limit Is ReachedToo many slow PHP requests at once
504 Gateway TimeoutA request ran longer than 90 seconds on cPanel (most sites stop a request earlier, after about 60 seconds)
403 ForbiddenPermissions, or a firewall rule blocking one request

Guides: resource limit errors on WordPress, gateway errors in WordPress and HTTP error 403.

If the site was hacked rather than broken, follow the hacked website checklist instead.

cPanel Starter
₹125/mo + GST
  • 25 GB NVMe SSD Storage
  • 50 GB Monthly Bandwidth
  • 1 Website
  • 10 Email Accounts
See plan details

Prices on the cards exclude 18% GST.

How do I fix the WordPress white screen of death?

Turn on WP_DEBUG_LOG in wp-config.php and read wp-content/debug.log to find the plugin or theme at fault. If there is no log, rename wp-content/plugins to disable all plugins, then re-enable them one at a time.

What causes "Error establishing a database connection"?

The database name, user, password or host in wp-config.php doesn't match the database in your control panel, or the user isn't assigned to the database. On shared hosting the host is normally localhost.

Why does my WordPress site show a 500 error after editing .htaccess?

The file has a syntax error or a php_value or php_flag line. Domain India servers don't run PHP as an Apache module, so those lines cause a 500. Rename .htaccess, then re-save the permalinks.

How do I increase the WordPress memory limit?

Add define( 'WP_MEMORY_LIMIT', '256M' ); to wp-config.php. It can't exceed the PHP memory_limit for your account, which you change in your control panel.

I fixed the error but still see it. Why?

On Domain India cPanel servers, a cache in front of the site can keep a copy of a page for up to two hours. Add ?t=1 to the URL to see the current version.

Ready to get your site back? Work through the full guide to troubleshooting WordPress and other CMS, or open a support ticket with the URL, the exact error and the time it happened.

Stuck on a WordPress error?

Send us the URL, the exact error and what changed, and we will check the server logs for the same moment.

Open a support ticket

Was this article helpful?

Your answer helps us decide what to improve next.

Still need help? Open a support ticket and our team will reply.

Prefer an app? Add this site to your home screen.Get the app
WordPress Common Errors and How to Fix Them | Domain India