Troubleshooting and Debugging in WordPress
September 13, 2025 2025-09-13 14:35When something goes wrong on your WordPress site, troubleshooting and debugging help identify and fix the issue. This section covers common errors, enabling error tracking, and restoring your site after a crash.
 A. Common WordPress Errors and Fixes
Here are the most common WordPress errors and how to fix them:
 1. 500 Internal Server Error
- Cause: Corrupt .htaccess file or plugin conflicts.
- Fix:
- Rename .htaccess file to .htaccess_old.
- Regenerate a new .htaccess by going to Dashboard > Settings > Permalinks > Save Changes.
 2. Error Establishing Database Connection
- Cause: Incorrect database credentials.
- Fix:
- Check wp-config.php and verify the database name, username, and password.
- Contact your hosting provider if the issue persists.
 3. 404 Page Not Found
- Cause: Broken permalinks.
- Fix:
- Go to Dashboard > Settings > Permalinks.
- Click Save Changes to reset permalinks.
 4. Unable to Upload Images
- Cause: Incorrect file permissions.
- Fix:
- Set correct folder permissions to wp-content/uploads.
- Use FTP or File Manager to change permissions to 755.
 5. Connection Timed Out
- Cause: Overloaded server or heavy resource usage.
- Fix:
- Increase PHP memory limit in wp-config.php:
php
CopyEdit
define(‘WP_MEMORY_LIMIT’, ‘256M’);
 B. Enabling WP_DEBUG for Error Tracking
WP_DEBUG helps track and display errors on your WordPress site. It shows what’s causing problems and makes it easier to fix them.
 1. How to Enable WP_DEBUG
- Open wp-config.php in your site’s root directory.
- Add or update the following line:
php
CopyEdit
define(‘WP_DEBUG’, true);
 2. Enable Debug Log (Optional)
To save errors in a log file:
php
CopyEdit
define(‘WP_DEBUG_LOG’, true);
- Check the log at wp-content/debug.log.
 3. Disable Debugging for Live Sites
- Never enable WP_DEBUG on a live site to avoid exposing errors.
- Set it to false when debugging is complete:
php
CopyEdit
define(‘WP_DEBUG’, false);
 C. Fixing Plugin and Theme Conflicts
Plugin or theme conflicts can break your site. Here’s how to identify and fix them.
 1. Deactivate All Plugins
- Go to Dashboard > Plugins > Deactivate All.
- Reactivate one by one to identify the problem.
 2. Switch to a Default Theme
- Go to Dashboard > Appearance > Themes.
- Switch to a default theme like Twenty Twenty-Two.
 3. Clear Cache
- Clear browser and plugin cache after deactivating plugins or changing themes.
 D. Restoring a Website After Crash
If your website crashes, restoring a backup can save time and effort.
 1. Restore Using Backup Plugin
- Use a backup plugin like UpdraftPlus or BackupBuddy.
- Upload the backup and restore your site.
 2. Restore via cPanel
- Go to cPanel > File Manager.
- Upload and restore files manually.
 3. Restore Database Using phpMyAdmin
- Go to cPanel > phpMyAdmin.
- Import the backup SQL file to restore the database.
 E. Dealing with White Screen of Death (WSOD)
WSOD is when your site shows a blank white screen without any error messages.
 1. Increase PHP Memory Limit
- Open wp-config.php and add:
php
CopyEdit
define(‘WP_MEMORY_LIMIT’, ‘256M’);
 2. Disable Plugins and Themes
- Deactivate all plugins and switch to a default theme.
- Check if the site loads properly.
 3. Check .htaccess File
- Rename .htaccess to .htaccess_old and regenerate it.
 4. Enable Debugging to Identify Errors
- Enable WP_DEBUG to find the root cause of WSOD.
 F. Best Practices for Troubleshooting and Debugging
 1. Backup Before Making Changes
- Always back up your site before debugging.
 2. Use Staging for Testing
- Test changes on a staging site before applying to live.
 3. Keep Plugins and Themes Updated
- Regularly update plugins, themes, and WordPress core.
 4. Monitor Website Uptime
- Use uptime monitoring tools to track your site’s performance.
 5. Check Error Logs Regularly
- Review error logs to spot issues early.