WordPress Error Messages
Error Establishing a Database Connection
This error means that WordPress is unable to connect to the database.
Cause:
- Incorrect database information (database name, username, password, or host).
- The database server might be overloaded or offline.
Solution:
-
Check the wp-config.php file to ensure that the database credentials are correct:
define('DB_NAME', 'your_database_name');
define('DB_USER', 'your_username');
define('DB_PASSWORD', 'your_password');
define('DB_HOST', 'localhost');
White Screen of Death (WSOD)
The website displays a blank white screen with no error messages.
Cause:
- Problems with a plugin or theme.
- PHP memory limit has been exceeded.
Solution:
- Disable plugins: Rename the wp-content/plugins folder to disable all plugins.
- Switch theme: Rename the wp-content/themes folder to activate a default theme.
- Increase memory limit: Add the following line to the wp-config.php file
500 Internal Server Error
The server cannot process the request correctly and shows this general error.
Cause:
- Errors in the .htaccess file.
- A plugin or theme conflict.
Solution:
- Reset .htaccess: Rename the .htaccess file in the WordPress root directory and reload the page to generate a new .htaccess file.
- Disable plugins and themes as done for the White Screen of Death.
404 Error – Page Not Found
A page or post is not found, even though it exists.
Cause:
-
Corrupted or incorrect permalink structure.
Solution:
-
Reset permalinks: Go to Settings → Permalinks and save the current structure again. This refreshes the permalinks and can fix the issue.
Memory Limit Exceeded – Error: Allowed memory size of x bytes exhausted"
WordPress or a plugin requires more memory than allocated.
Cause:
-
The PHP memory limit is too low.
Solution:
-
Increase memory limit: Open the wp-config.php file and add this line:
define('WP_MEMORY_LIMIT', '256M');
403 Forbidden Error
The server denies access to a file or page.
Cause:
-
Incorrect file or folder permissions.
-
A security plugin is blocking access.
Solution:
-
Check file permissions: Ensure that files have 644 permissions and folders have 755 permissions.
-
Disable security plugin: Deactivate security plugins to see if they are causing the issue.
429 Too Many Requests
This error occurs when the server receives too many requests in a short time.
Cause:
- A plugin or bot is sending too many requests to the server.
Solution:
- Deactivate plugins one by one to identify the problem.
- Contact your hosting provider to increase the request limit if it affects legitimate traffic.