هذا المقال متوفر باللغة العربية — اقرأ بالعربية
Few things are as stressful as opening your website and finding a blank white page, a “critical error” message, or a line saying WordPress can’t connect to the database. The good news is that most of these errors have known causes and clear fixes. In this guide we’ll show you how to fix common WordPress errors step by step, calmly, and without making things worse.
We’ll start with the rules that protect you before you touch anything, then go through the errors we see most often on client sites, one by one.
Before you fix anything: three golden rules
- Take a backup first. Even if the site is down, copy the files and export the database before you change anything. A fix that goes wrong without a backup turns a small problem into a big one.
- Change one thing at a time. If you disable five plugins and edit two files at once, you won’t know what actually fixed the problem, or what broke something else.
- Read the actual error. Guessing wastes hours. WordPress can tell you exactly which file and line caused the problem if you turn on logging, as we’ll show below.
You’ll also need access outside the dashboard, through your hosting control panel’s File Manager or an FTP or SFTP client, because many of these errors lock you out of wp-admin completely.
How to fix common WordPress errors, one by one
1. The white screen and the “critical error” message
The white screen of death is a blank page with no information at all. In newer versions of WordPress you’ll more often see a message that says “There has been a critical error on this website.” Both usually come from a PHP error, most often caused by a plugin or theme.
Start with your email. Since WordPress 5.2, when a plugin or theme causes a fatal error, WordPress sends an email to the site’s admin address with details and a special Recovery Mode link. Recovery Mode logs you into the dashboard with the faulty plugin or theme paused, so you can deactivate it, update it, or replace it. When you’re done, exit Recovery Mode from the button at the top of the dashboard.
If the email doesn’t arrive, disable plugins manually:
- Open the
wp-contentfolder through File Manager or FTP. - Rename the
pluginsfolder toplugins_old. This deactivates all plugins at once. - If the site comes back, rename the folder back to
plugins, then reactivate the plugins one at a time from the dashboard until the error returns. The last one you activated is your culprit.
If plugins aren’t the cause, the theme might be. Rename your active theme’s folder inside wp-content/themes, and WordPress will fall back to a default theme if one is installed.
2. Error 500 (Internal Server Error)
This is a general server error, and it doesn’t tell you much on its own. According to WordPress’s official documentation, the most likely cause is a corrupted .htaccess file. Try these steps in order:
- Rename
.htaccessin the site root to.htaccess_old, then reload the site. - If it works, go to Settings, then Permalinks, and click Save. WordPress will generate a fresh
.htaccessfile. - If not, disable plugins the same way as above, then try a default theme.
- Increase the PHP memory limit (more on that in error number 5).
- As a last resort, re-upload the
wp-adminandwp-includesfolders from a fresh copy of the same WordPress version. Never overwritewp-content, because that’s where your themes, plugins and uploads live.
3. Error establishing a database connection
This message means WordPress can’t reach its database. There are three usual suspects:
- Wrong details in wp-config.php. Open the file and check the database name, username, password and host. A password changed in the hosting panel and not updated here is a very common cause.
- A problem at the host. The database server might be down, or the database may have hit its size quota. Your host can tell you quickly.
- A compromised site. If the settings are correct and the host confirms everything is fine on their side, scan the site for malware.
If you suspect damaged database tables, WordPress includes a repair tool. Add this line to wp-config.php:
define( 'WP_ALLOW_REPAIR', true );
Then visit /wp-admin/maint/repair.php on your domain. Once you’re done, remove the line right away, because that page doesn’t require a login.
4. “Briefly unavailable for scheduled maintenance”
When WordPress runs an update, it creates a temporary file called .maintenance in the site root. If the update gets interrupted, the file stays behind and the site stays stuck on this message. The fix is simple: delete .maintenance from the root folder. Then check that the update actually finished, and rerun it if needed.
5. Allowed memory size exhausted
This means the site needed more memory than PHP is allowed to use. You can raise WordPress’s limit by adding this line to wp-config.php, above the line that says to stop editing:
define( 'WP_MEMORY_LIMIT', '256M' );
If it doesn’t help, your host may have set a lower limit at the server level, so ask them to raise it. And if a single plugin keeps eating memory, that’s a sign the plugin itself needs reviewing, not just more memory.
6. 404 errors on posts and pages
If the home page works but every post returns “page not found”, the problem is usually with permalinks. Go to Settings, then Permalinks, and click Save without changing anything. This flushes the rewrite rules. If that doesn’t solve it, especially after moving to a new server, make sure the server’s rewrite module is enabled and that the .htaccess file contains WordPress’s default rules.
7. Connection timed out and maximum execution time
These show up when the site tries to do more than the server can handle, and they’re common on cheap shared hosting. Disable heavy plugins, try a default theme, raise the memory limit, and ask your host to increase the maximum execution time. If the error comes back often, the hosting plan may simply be too small for the site.
8. A failed automatic update
Sometimes WordPress’s automatic update fails, and you’re left with a blank screen, a message that the update didn’t finish, or a PHP error. According to the official documentation, the cause can be a glitch in the connection to WordPress’s core files during the update, an internet problem, or incorrect file permissions. The fix is a manual update: download a clean copy of the same version and upload its files over the old ones, leaving the wp-content folder and the wp-config.php file untouched. Make sure you have a full backup before any of this.
9. You make changes and nothing happens
This isn’t really an error, but it’s one of the questions we get most. You edit something, save it, and the page looks exactly the same. The cause is usually caching: the browser shows a copy it stored earlier instead of loading the page again. Clear your browser cache or open the page in a private window. If the site uses a caching plugin or a service like Cloudflare, clear that cache too. A lot of “my change isn’t showing” problems are solved in seconds this way, without touching any code. And if the change does show up but the Arabic version looks wrong, with arrows pointing the wrong way or columns in the wrong order, that’s usually a right-to-left problem rather than caching. Our guide on how to fix RTL problems on Arabic WordPress sites covers the usual causes.
A quick reference table
| Error | Most likely cause | First step |
|---|---|---|
| White screen or critical error | A plugin or theme | Check the Recovery Mode email |
| Error 500 | A corrupted .htaccess file | Rename .htaccess and resave permalinks |
| Database connection error | Wrong wp-config.php details | Check the four database settings |
| Scheduled maintenance | An interrupted update | Delete the .maintenance file |
| Memory exhausted | A low PHP memory limit | Raise WP_MEMORY_LIMIT |
| 404 on posts | Permalink rules | Resave permalinks |
Turn on debugging to see the real error
When the cause isn’t obvious, let WordPress tell you. Add these lines to wp-config.php:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
This records errors in wp-content/debug.log without showing them to visitors. Open the file, look at the latest lines, and you’ll usually see the file path, which points straight to the plugin or theme at fault. When you’re finished, set WP_DEBUG back to false and delete the log file, since it can reveal details about your server.
How to prevent these errors in the first place
- Keep automatic, off-site backups and test restoring them occasionally.
- Test updates on a staging copy before applying them to the live site, especially major updates to WordPress, WooCommerce or your page builder.
- Keep the plugin list short. Every plugin is code that can conflict with something else.
- Use a supported PHP version that matches what your theme and plugins officially support.
- Monitor uptime so you hear about a problem before your customers do.
This matters even more now that WordPress is adding new capabilities quickly. If you’re curious about what changed recently, read our guide to AI in WordPress 7.0, and remember that every big new feature is a good reason to test on staging first. If you’d like these habits turned into a schedule, our weekly and monthly WordPress maintenance checklist lays out what to do and when.
When to stop and ask for help
Some situations need a specialist rather than another round of trial and error:
- You see signs of a hack, such as strange redirects, unknown admin users or files you didn’t add.
- The database is damaged and you don’t have a recent backup.
- The error came back after you fixed it, and you can’t find the cause in the logs.
- It’s an online store and every hour of downtime costs you sales.
Our SiteCare service covers updates, backups, monitoring and fixing problems like these before they reach your visitors. If you’re facing an error right now and aren’t sure where to start, book a free consultation and we’ll look at it together.
Frequently asked questions
Will I lose my content if I rename the plugins folder?
No. Renaming the folder only deactivates plugins. Your posts and pages are in the database, and plugin settings usually stay saved too.
Is it safe to edit wp-config.php?
Yes, as long as you take a copy first and edit carefully. One missing semicolon can bring the site down, so keep the original copy within reach.
Why didn’t I get the Recovery Mode email?
Often because the site can’t send email reliably. Setting up proper SMTP sending is worth doing for this reason alone.
Can I do these steps without coding experience?
Mostly, yes. They come down to renaming folders and editing a line or two in a settings file. Go step by step, keep a backup, and stop if it starts to feel bigger than you.
Does a WordPress error mean my site was hacked?
Usually not. Most of the errors in this guide come from a conflicting update, a wrong setting or a server problem. But if you find admin users you don’t recognize, strange files in your site folders, or redirects to other sites, treat it as a possible hack: change your passwords right away and get specialist help.