Common WordPress Errors: 10 Safe Fixes and First Checks
Quick answer: The fastest way to fix common WordPress errors is to identify the exact message, check whether the problem followed an update or hosting change, and test the smallest reversible fix. A database connection failure, a 502 Bad Gateway and a plugin-related critical error are different problems; resetting everything at once makes the cause harder to find.
WordPress error diagnosis: find your symptom
| What you see | First check | Jump to fix |
|---|---|---|
| Error establishing a database connection | Database service and credentials | Database connection |
| ERR_TOO_MANY_REDIRECTS | HTTPS, site URLs, CDN/proxy rules | Redirect loop |
| 500 Internal Server Error | PHP and server error logs | HTTP 500 |
| 502 Bad Gateway | Web server to PHP/upstream connection | HTTP 502 |
| Critical error or blank white page | Recovery Mode email and recent changes | Critical error |
| Failed to write file to disk | Disk quota, temporary directory and ownership | Upload error |
| Allowed memory size exhausted | PHP memory setting and error source | Memory |
| Cannot access wp-admin | Lost Password and recovery email | Admin access |
| Briefly unavailable for scheduled maintenance | Whether an update is still running | Maintenance mode |
| Sidebar below content | Mobile breakpoint versus broken markup | Layout |
WordPress also maintains an official common-errors reference. Start there or with your host’s error logs if the symptom does not match the table.
1. Error establishing a database connection
Meaning: WordPress cannot connect to the database that stores posts, users and site settings. The database service may be unavailable, the server name may have changed, the account may lack privileges or a credential in wp-config.php may be wrong.
- Check your host’s service-status panel and whether other sites on the same server have the same problem.
- Open a secure copy of
wp-config.phpand compareDB_NAME,DB_USER,DB_PASSWORDandDB_HOSTwith the values in your hosting dashboard. Never paste live passwords into a public support thread. - If the values match, ask your host to check database availability, user privileges and server logs. Do not create a new empty database over the existing site or run database-repair commands without a verified backup.
WordPress’s database error guidance covers the main causes. If the host confirms the service is healthy, investigate recent configuration changes or unauthorized access.
2. ERR_TOO_MANY_REDIRECTS
Meaning: Your browser is being sent between two or more URLs in a loop, often because WordPress, the host and a CDN disagree about whether to use HTTP, HTTPS or www.
- Try the affected URL in a private browser window and note whether HTTP redirects to HTTPS or back again.
- Check Settings → General for WordPress Address and Site Address if wp-admin is accessible. The two addresses need not always match on unusual setups, so compare them with your intended deployment.
- Check the host’s SSL/HTTPS setting, any reverse proxy or CDN SSL mode, and redirects added by plugins. Disable only the recently changed rule first.
- If you cannot log in, ask the host to confirm the correct public URL and proxy configuration before changing
WP_HOMEorWP_SITEURL.
Do not copy a generic http://example.com configuration into a live HTTPS site. Likewise, Apache .htaccess examples do not apply unchanged to Nginx. WordPress documents the related configuration and permalink errors.
3. 500 Internal Server Error
Meaning: The server failed to complete the request, but the browser message alone does not identify why. A PHP fatal error, incompatible plugin, server rule or resource limit may be responsible.
- Check the host’s PHP/server error log for an entry at the time of failure.
- If an admin recovery email identifies a plugin or theme, use WordPress Recovery Mode to pause the affected component for your admin session.
- Check the PHP version against WordPress and plugin requirements, then test the specific suspect on staging.
- If a recent permalink or server-rule edit caused the error, restore the previous backed-up rule and ask your host whether the site uses Apache or Nginx.
Deleting an active theme or replacing server configuration blindly can make an outage worse. If you need logs, see the safe debugging section below.
4. 502 Bad Gateway
Meaning: A web server or gateway received an invalid or missing response from an upstream service, such as PHP-FPM. Unlike a normal WordPress error page, this may occur before WordPress can respond.
- Check whether the error affects the whole site and whether the hosting provider reports an incident.
- Give hosting support the exact URL, time, response code and any recent changes; ask them to inspect PHP-FPM/upstream logs, timeouts and available workers.
- If the log identifies a specific plugin or PHP process, troubleshoot that component in a reversible way on staging. Do not delete your theme or disable every plugin without evidence.
A premium hosting plan is not a substitute for diagnosing a 502, but access to useful logs, backups, staging and responsive support can materially change the recovery process. Compare WordPress hosting support and backup features after the immediate incident is contained.
5. White screen or “There has been a critical error”
Meaning: A fatal PHP error may prevent WordPress from rendering the page. Modern WordPress can send the administrator a Recovery Mode link that pauses the failing theme or plugin for that administrator’s session.
- Look for the WordPress recovery email, including spam folders, and sign in through its special link if available.
- Read the error notice to identify the component. Disable or roll back that specific plugin/theme and test again.
- If no email arrives, check host logs. An experienced owner can temporarily rename the suspect plugin’s individual folder through the host file manager, then restore its name after diagnosis. Do not delete the active theme.
Read the official Recovery Mode procedure; it explains how to exit Recovery Mode once the underlying issue is resolved.
6. “Failed to write file to disk” while uploading media
Meaning: PHP or WordPress could not write the upload, often because of an exhausted disk quota, missing temporary directory, incorrect ownership or unwritable uploads directory. This differs from an upload-size-limit error.
- Check disk space and inode/file limits in the hosting dashboard.
- Ask the host to verify the PHP temporary directory and ownership of
wp-content/uploads. - Only adjust permissions when the host confirms the correct user/group setup. Common directory and file values vary by environment; do not recursively make everything writable or use
777. - Retry with a small test image and verify that its thumbnail is generated.
See WordPress’s file-permissions reference. For a theme ZIP failing to install, read the separate theme-installation troubleshooting guide instead of assuming all failures are permission errors.
7. Fatal error: Allowed memory size exhausted
Meaning: A PHP process exhausted its allowed memory. The number shown in the fatal error is the effective limit for that request; it does not establish a universal WordPress default.
- Read the error log to determine which plugin, theme or operation consumed memory.
- Check the host’s effective
memory_limit, the WordPress memory constants and whether the hosting plan allows a higher PHP limit. - On staging, test the suspected plugin or import process. Raising the limit may help with a legitimate heavy operation, but it will not repair a memory leak or incompatible extension.
Ask the host to adjust PHP configuration if necessary. Never paste a sample constant with typographic quotation marks into wp-config.php: PHP requires ordinary straight quotes. The WordPress configuration reference explains memory-related settings.
8. Locked out of the WordPress dashboard
Meaning: The cause may be an incorrect password, a lost recovery email, a security-plugin lockout or an actual site error. Identify which message appears before changing credentials.
- Use Lost your password? on the login page and check the administrator email account.
- If reset email is not arriving, ask the host to check outgoing mail and confirm ownership of the account. A legitimate administrator may use the host’s supported WP-CLI password-reset procedure if available.
- If the page displays a critical PHP error, use Recovery Mode rather than resetting an otherwise correct password.
- If you suspect an account compromise, involve the host and rotate credentials after regaining control.
See the official password-reset options. Editing a user’s password hash directly in phpMyAdmin is a last-resort administrative procedure, not the default fix.
9. Stuck on “Briefly unavailable for scheduled maintenance”
Meaning: WordPress creates a temporary .maintenance file during an update. If an upgrade is interrupted, the file may remain after the update process has stopped.
- Check that no update is still running; do not interrupt an active upgrade.
- Confirm that you have a current backup. If the upgrade has finished or failed and the notice is stuck, use the host’s file manager or SFTP to remove only the stale
.maintenancefile in the WordPress root. - Reopen the dashboard and rerun or complete any interrupted update. Confirm the site, plugins and checkout still work.
The official troubleshooting FAQ explains the file and recommends repeating an upgrade that did not finish.
10. Sidebar appears below the main content
Meaning: This can be normal responsive behavior on a phone, or an actual problem caused by a layout width, custom CSS, unclosed HTML or a page-builder row.
- Check the page at desktop and mobile widths. Many themes intentionally stack the sidebar below the main column on mobile.
- If it also fails at desktop width, undo the latest CSS or layout change on staging and compare the affected page with a working one.
- Check recently pasted custom HTML for invalid markup and investigate any oversized image or fixed-width element.
Do not edit a theme’s source files merely because the sidebar has moved on a narrow screen.
How to read WordPress error logs safely
Use the hosting dashboard’s PHP and web-server logs first, particularly for 502 responses. If you need WordPress-specific debugging and have file-system access, follow the official debugging guide to configure WP_DEBUG, WP_DEBUG_LOG and WP_DEBUG_DISPLAY correctly. Do not display verbose PHP errors to visitors. Keep logs outside the public web root or restrict their access; the default wp-content/debug.log can expose sensitive information if left publicly readable. Switch debugging off and remove or secure temporary log files after diagnosis.
Frequently asked questions
What should I do first when WordPress shows an error?
Capture the exact message, note when it started, check for a recent update or hosting change and make a recoverable backup before modifying the site.
Should I deactivate every plugin to troubleshoot WordPress?
Not as a first step. Use logs or Recovery Mode to identify a particular plugin. Test reversible changes on staging where possible.
Is a 502 error always caused by WordPress?
No. A 502 describes a gateway/upstream failure; the cause may be PHP-FPM, proxy settings, server capacity or a WordPress request that triggers an upstream failure.
Does increasing PHP memory fix every critical error?
No. First identify the failing process. More memory may help a legitimate resource-heavy task, but not a code defect or incompatible plugin.
Can a different hosting plan prevent every WordPress error?
No. Hosting can provide better logs, backups, isolation and support, while plugin compatibility and site configuration still require maintenance.