Common WordPress Errors and How to Fix Them
me@sajalgarg.com
November 28, 2024
1. The White Screen of Death (WSOD)
Symptoms: A completely blank screen with no error messages.
Causes: Plugin/theme conflicts, memory limit exhaustion, or PHP errors.
Fix:
- Disable Plugins/Themes:
- Access your site via FTP or hosting control panel (e.g., cPanel).
- Navigate to
wp-content/plugins
and rename the folder to deactivate all plugins. - Rename the active theme folder under
wp-content/themes
to switch to a default theme.
- Increase Memory Limit:
Edit yourwp-config.php
file and add:phpdefine('WP_MEMORY_LIMIT', '256M');
- Debug Mode: Enable debugging by adding this line to
wp-config.php
:phpdefine('WP_DEBUG', true);
2. Internal Server Error (500)
Symptoms: A “500 Internal Server Error” message appears.
Causes: Corrupt .htaccess
file, PHP memory limit, or server issues.
Fix:
- Check .htaccess File:
- Access your site via FTP.
- Rename the
.htaccess
file to.htaccess_old
. - Log in to WordPress and go to Settings > Permalinks, then save to regenerate the
.htaccess
file.
- Increase PHP Memory Limit: (See WSOD solution.)
- Reinstall Core Files: Replace WordPress core files by uploading a fresh copy, except the
wp-content
folder.
3. Error Establishing a Database Connection
Symptoms: The site cannot connect to the database.
Causes: Incorrect database credentials, database corruption, or server overload.
Fix:
- Check wp-config.php: Verify database name, username, password, and host in the
wp-config.php
file.phpdefine('DB_NAME', 'your_database_name');
define('DB_USER', 'your_username');
define('DB_PASSWORD', 'your_password');
define('DB_HOST', 'localhost');
- Repair Database:
Add the following towp-config.php
and visityourdomain.com/wp-admin/maint/repair.php
:phpdefine('WP_ALLOW_REPAIR', true);
After repairing, remove the line from
wp-config.php
.
4. 404 Error for Posts/Pages
Symptoms: Posts/pages return a 404 error, but the homepage works.
Causes: Permalink structure issue.
Fix:
- Go to Settings > Permalinks in the WordPress dashboard.
- Re-save the permalink settings.
- If the issue persists, ensure the
.htaccess
file is writable and contains:apache# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
5. WordPress Stuck in Maintenance Mode
Symptoms: The message “Briefly unavailable for scheduled maintenance. Check back in a minute.” appears.
Causes: An interrupted update left the site in maintenance mode.
Fix:
- Access your site via FTP.
- Delete the
.maintenance
file in the root directory.
6. Sidebar Below Content
Symptoms: Sidebar appears below the main content instead of beside it.
Causes: HTML/CSS issues in the theme.
Fix:
- Check Theme Code: Look for unclosed
<div>
tags in your theme files. - Switch Themes: Temporarily activate a default WordPress theme to identify if the issue is theme-related.
7. Login Page Redirect/Refresh Error
Symptoms: The login page keeps redirecting or refreshing without logging in.
Causes: Cookie issues, plugin conflicts, or corrupt .htaccess
file.
Fix:
- Clear Cookies: Clear your browser’s cookies and cache.
- Deactivate Plugins: (See WSOD solution.)
- Regenerate .htaccess: (See 500 error solution.)
8. Images Not Uploading
Symptoms: Unable to upload images, or broken thumbnails.
Causes: Incorrect file permissions or memory limit.
Fix:
- File Permissions:
Set permissions for thewp-content/uploads
folder to755
or775
using FTP or hosting control panel. - Increase Memory Limit: (See WSOD solution.)
9. Connection Timed Out
Symptoms: The site takes too long to load and eventually times out.
Causes: Overloaded server, memory limit, or resource-heavy plugins.
Fix:
- Deactivate Plugins: (See WSOD solution.)
- Optimize Hosting: Consider upgrading your hosting plan or switching to a more performant provider.
- Increase PHP Execution Time:
Add towp-config.php
:phpset_time_limit(300);
10. Broken Links After Migration
Symptoms: Links or images don’t work after moving the site.
Causes: Old URLs in the database.
Fix:
- Update URLs: Use the Better Search Replace plugin to update old URLs in the database.
- Check .htaccess: Ensure correct rewrite rules.
Final Tips
- Always backup your site before making significant changes.
- Use reliable hosting with good support.
- Regularly update WordPress core, themes, and plugins to avoid compatibility issues.
Would you like help implementing any of these fixes?
Have Any Question?
- (+62) 81 314 239
- enrique@domain.com