NOTE: Always clear your browser cache or use Incognito/Private Window while troubleshooting your WordPress site. This ensures you’re not seeing an older, cached version of your site.
How to clear cache?
- Chrome:
Ctrl+Shift+Del→ Choose ‘Cached images and files’ → Click ‘Clear data’ - Firefox:
Ctrl+Shift+Del→ Select ‘Cache’ → Click ‘Clear Now’ - Safari: Go to Settings → Clear History
- Microsoft Edge:
Ctrl+Shift+Del→ Clear ‘Cached images and files’
Or, just open a Private Window and revisit your site.
🛠️ How to Fix a WordPress Fatal Error — Step-by-Step Guide for Beginners
WordPress is a powerful platform, but sometimes it throws the dreaded “Fatal Error” message, causing panic. Don’t worry—it’s often fixable, and you don’t need to be a tech wizard to get your site back. This guide will walk you through everything you need to do, even if you’re a total beginner.
✅ Step 0: Backup Your Website First!
Before touching anything, always backup your site.
- Option A: Use your hosting control panel to download your website files and export your database.
- Option B: Use FTP (like FileZilla) to zip and download everything in your root directory (
public_html,www, or similar). - Export the database using phpMyAdmin (
Export→Quick→SQLformat).
⚠️ WARNING: Skipping this step could make things worse. Even a simple mistake could make recovery difficult without a backup.
🔍 Step 1: Enable WordPress Debugging Mode
How to Enable Debug Mode
Debugging helps you find out what exactly is causing the fatal error.
- Access your website files using FTP or your hosting file manager.
- Open the
wp-config.phpfile (located in the root of your WordPress install). - Add (or modify) the following lines:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
- Save the file and revisit your website.
- Visit the
/wp-content/debug.logfile or check the white screen error again. It should now point out what line of code, plugin, or theme is breaking the site
🧩 Step 2: Identify the Problem Plugin or Theme
If the debug output mentions a plugin or theme like this:
Fatal error: Uncaught Error in .../wp-content/plugins/elementor/somefile.php on line 123Then:
- Go to
/wp-content/plugins/and rename the plugin folder.- For example:
elementor→disabled.elementor
- For example:
- Refresh your site and see if it works.
If it mentions a theme, go to /wp-content/themes/ and do the same.
🧠 Step 3: Increase PHP Memory Limit
Fatal errors often occur because your site runs out of memory.
To fix this:
- Open
wp-config.php - Add this line:
define('WP_MEMORY_LIMIT', '256M');This increases the memory limit to 256MB. Save and refresh your site.
define('WP_MEMORY_LIMIT', '256M');
This increases the memory limit to 256MB. Save and refresh your site.
🧱 Step 4: Check for a Corrupt .htaccess File
Sometimes .htaccess can be corrupted, especially after plugin updates.
How to fix it?
- Access your root folder.
- Download .htaccess to your computer.
- Delete it from your server.
- Try reloading your website.
- If it works, go to WordPress admin → Settings → Permalinks → Save to regenerate .htaccess.
🧼 Step 5: Reinstall WordPress Core Files
If the core WordPress files are corrupted:
- Download a fresh copy of WordPress from wordpress.org.
- Delete everything in your root folder, EXCEPT:
wp-content/wp-config.php
- Upload the fresh WordPress files via FTP, but do NOT upload wp-content folder.
⚠️ WARNING: Replacing the wp-content folder will delete your themes, plugins, and media. Do not overwrite it!
🔌 Step 6: Disable All Plugins
If the site still shows a fatal error:
- Rename the entire
/wp-content/plugins/folder to something likedisabled.plugins. - If your site loads, then the issue is with a plugin.
- Rename it back to
plugins, then:- Go inside the folder
- Disable plugins one by one by renaming them.
- Keep testing until you find the one causing the issue.
🎨 Step 7: Disable the Active Theme
The same method applies to themes:
- Go to
/wp-content/themes/ - Rename the active theme folder (e.g.,
astra→disabled.astra) - WordPress will try to fall back to a default theme (if available).
🧑💻 Step 8: Switch to a Default Theme (If Dashboard is Accessible)
If you can access your admin dashboard:
- Go to Appearance → Themes
- Activate a default theme like Twenty Twenty-Five
- Check if the fatal error is gone.
🧹 Step 9: Clear Browser Cache Every Time
Each time you make a change, your browser might still be showing an old cached version.
- Use Ctrl+F5 or clear cache (see instructions at the top of the article)
- Use Incognito/Private Window for clean testing.
🛡️ Step 10: Scan for Malware
Sometimes fatal errors are caused by malicious code injected via outdated plugins or themes.
Use these tools:
- Wordfence Security
- Sucuri Security
They can scan for infected files and notify you.
📜 Step 11: Check Error Logs
There are two types of logs that can help:
A. PHP Logs:
Found in your hosting control panel (e.g., cPanel → Errors or Logs)
B. WordPress Logs:
Already enabled in Step #1 with WP_DEBUG_LOG.
Logs are saved in:
/wp-content/debug.log
Review it to trace the exact issue.
💬 Step 12: Contact Your Hosting Support
If you’ve tried everything and the site still doesn’t work, reach out to your hosting provider.
They often:
- Have access to server logs
- Can help restore a backup
- Can adjust server settings
👨🔧 Step 13: Consult an Expert Developer
If you’re overwhelmed or stuck, it’s okay to ask for help.
Look for a trusted developer or service that specializes in WordPress support. Platforms like Upwork, Fiverr, or even WordPress support forums can be helpful.
🧠 Bonus Tips:
- Keep your plugins and themes updated to avoid future issues.
- Avoid using nulled or pirated plugins/themes—they often contain malicious code.
- Consider using a staging site to test updates and changes before applying them to your live site.
- Use automated backups with plugins like UpdraftPlus, BlogVault, or Jetpack.
🙌 Final Thoughts
A WordPress fatal error can look scary, but 90% of the time, it’s a simple fix. Take it step-by-step, stay calm, and don’t skip the backup step. With a bit of patience (and the guide above), you can recover your site without losing sleep.
Need help? Drop a comment or consult a professional. You’re not alone—everyone runs into this at some point.