Fixing WordPress 500 error: complete guide
Last updated: 31 December 2025
Fixing WordPress 500 error: complete guide
Your WordPress site shows a "500 Internal Server Error". The page doesn't load and you only see a generic error message. This is one of the most common WordPress problems, but fortunately almost always solvable.
In this guide you'll learn what a 500 error is, what causes it and how to fix it step by step.
What is a 500 Internal Server Error?
A 500 error means the web server has a problem, but doesn't know exactly what. It's a general error code for "something is going wrong on the server, but I can't tell you what".
The full name is "500 Internal Server Error" or sometimes "HTTP 500". It differs from other error codes:
- 404 error - page not found (the URL doesn't exist)
- 403 error - access denied (you're not allowed to see this page)
- 500 error - server error (something is going wrong on the server side)
The problem is not on your side as a visitor, but on the website or hosting side.
Most common causes
A 500 error in WordPress is usually caused by these issues:
Corrupt .htaccess file - This file controls important server settings. If it's damaged, your site crashes.
PHP memory limit reached - WordPress has insufficient memory to load the page.
Plugin or theme error - A plugin or theme contains a programming error that crashes the server.
PHP timeout - A script takes too long and the server terminates it.
Wrong file permissions - Files or folders have incorrect access rights.
Database connection problem - WordPress cannot connect to the database.
Hosting server overloaded - Too many visitors or insufficient server resources.
Step 1: Restore your .htaccess file
In 50% of cases a 500 error is caused by a corrupt .htaccess file. Here's how to fix it:
- Log in via FTP or your hosting file manager
- Find the .htaccess file in the root of your WordPress installation
- Download a backup of this file to your computer
- Delete .htaccess from your server
- Test if your site works now
Does it work? Then .htaccess was the problem. Generate a new .htaccess file:
- Log in to your WordPress admin panel (wp-admin)
- Go to Settings > Permalinks
- Click "Save Changes" without changing anything
- WordPress will now automatically create a new .htaccess file
This new file contains the correct settings without errors.
Step 2: Increase PHP memory limit
Insufficient PHP memory is a common cause. Here's how to increase it:
Method 1: Via wp-config.php
Open wp-config.php in the root of your WordPress site and add this line before "That's all, stop editing":
define('WP_MEMORY_LIMIT', '256M');
Method 2: Via .htaccess
Add this to your .htaccess file:
php_value memory_limit 256M
Method 3: Via php.ini
If you have access to php.ini, add:
memory_limit = 256M
Reload your site. If it still doesn't work, try 512M instead of 256M.
Doesn't this work? Then your hosting provider doesn't allow higher limits. Contact them or consider upgrading to better WordPress hosting.
Step 3: Deactivate all plugins
Plugins often cause 500 errors, especially after updates. Test this way:
If you CAN log in to wp-admin:
- Go to Plugins in your WordPress dashboard
- Select all plugins (checkbox at top)
- Choose "Deactivate" from the dropdown menu
- Click "Apply"
If you CANNOT log in:
- Log in via FTP or file manager
- Go to /wp-content/
- Rename the "plugins" folder to "plugins-disabled"
- Test your website
Does your site work now? Then a plugin caused the 500 error. Activate plugins one by one to find which plugin causes the problem.
With FTP: rename "plugins-disabled" back to "plugins", then go to /wp-content/plugins/ and rename each plugin folder individually. Test your site each time.
Step 4: Switch to default theme
If plugins are not the problem, test your theme:
- Via FTP, go to /wp-content/themes/
- Rename your active theme folder (e.g., "my-theme" to "my-theme-disabled")
- WordPress will automatically switch to a default theme
- Test your website
Does it work now? Then your theme contains an error. Contact the developer or choose a different theme.
Step 5: Increase max_execution_time
Complex scripts sometimes need more time. Here's how to increase the maximum execution time:
In wp-config.php:
set_time_limit(300);
In .htaccess:
php_value max_execution_time 300
In php.ini:
max_execution_time = 300
This gives scripts 300 seconds (5 minutes) instead of the default 30 seconds.
Step 6: Check file permissions
Wrong file permissions can cause 500 errors. The correct settings are:
- Folders: 755 or 750
- Files: 644 or 640
- wp-config.php: 440 or 400 (extra secure)
How to adjust permissions via FTP:
- Right-click on a file or folder
- Choose "File Permissions" or "CHMOD"
- Set the correct value (755 for folders, 644 for files)
- For folders: check "Apply to subdirectories"
Do this for your entire WordPress installation. This may take a while for large sites.
Note: never set 777 permissions. This is a security risk.
Step 7: Check your error logs
Error logs tell you exactly what's going wrong. Here's how to find them:
Via hosting control panel:
Most hosts have error logs in their control panel:
- cPanel: "Errors" or "Error Log"
- Plesk: "Logs"
- DirectAdmin: "System Info & Files > Error Log"
Via FTP:
Error logs are often in:
- /logs/error_log
- /public_html/error_log
- ~/logs/
Open the newest file and search for lines ending with "500". The error message often tells you exactly what the problem is.
Enable WordPress debug mode:
Add this to wp-config.php:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
Errors are now logged in /wp-content/debug.log.
Step 8: Test database connection
Database problems can cause 500 errors. Test this:
Check wp-config.php:
Open wp-config.php and check these settings:
define('DB_NAME', 'database_name');
define('DB_USER', 'database_user');
define('DB_PASSWORD', 'database_password');
define('DB_HOST', 'localhost');
Check if these details are correct. Ask your hosting provider if in doubt.
Test database access:
Create a file test-db.php in the root of your site with:
<?php
$link = mysqli_connect('localhost', 'your_user', 'your_password', 'your_database');
if (!$link) {
die('Connection failed: ' . mysqli_connect_error());
}
echo 'Database connection successful!';
mysqli_close($link);
?>
Go to yourwebsite.com/test-db.php. Do you see "Database connection successful"? Then your database works. Delete this file immediately after (security risk).
Step 9: Restore WordPress core files
Corrupted WordPress files can cause 500 errors:
- Download the latest WordPress version
- Extract the ZIP file
- Remove wp-content and wp-config.php from the extracted folder
- Upload the remaining files via FTP (overwrite existing files)
This replaces all core files without removing your content.
Step 10: Contact your hosting
If the above steps don't work, the problem is probably on the server side:
- Server overloaded or crashed
- Apache/Nginx configuration error
- PHP version incompatibility
- Shared hosting with insufficient resources
Contact your hosting provider. They can:
- View server error logs
- Adjust PHP settings
- Increase server resources
- Fix database problems
Most WordPress hosts offer free technical support.
Prevention: prevent 500 errors
Here's how to prevent 500 errors in the future:
Use reliable hosting - Cheap shared hosting often has insufficient resources. Consider managed WordPress hosting with sufficient CPU and RAM.
Make backups before updates - Test updates first on a staging environment or make a backup before updating.
Limit plugins - More plugins means more chance of conflicts. Remove plugins you don't use.
Monitor your site - Use uptime monitoring to get immediate notification of problems.
Update regularly - Keep WordPress, plugins and PHP up to date. Old versions contain bugs.
Test performance - Regularly check your site speed. Slow queries can cause timeouts.
Summary
A WordPress 500 error looks serious, but is almost always solvable:
- Restore .htaccess file
- Increase PHP memory limit
- Deactivate plugins
- Test your theme
- Check error logs for details
- Contact hosting support
Work through these steps systematically. In 90% of cases you'll find the cause and solve the problem this way.
Frequently Asked Questions
Is WordPress free?
WordPress itself is free open-source software. You only pay for hosting, a domain name, and any premium themes or plugins you want to use.
How difficult is WordPress to learn?
WordPress is relatively easy to learn. You can master the basic functions within a few hours. Advanced customizations require more time.
Can I move WordPress to a different host later?
Yes, WordPress websites can be moved to a different hosting provider. Most providers offer free assistance for this.
Was this article helpful?
Compare hosting packages directly to find the best choice for your situation.
Related articles
What is web hosting? Explanation for beginners
Discover what web hosting is and how it works. Complete explanation about servers, domains and different hosting types for beginners.
What is VPS Hosting?
VPS hosting explained: what is a Virtual Private Server, who is it suitable for and what are the advantages compared to shared hosting?
What is an SSL Certificate?
Everything about SSL certificates: what is SSL, why do you need it and how do you recognize a secure website? Essential for every website.
What is Uptime in Web Hosting?
What does uptime mean in web hosting? Learn about uptime percentages, SLA guarantees and why 99.9% uptime is important for your website.
How much storage do I need for my website?
Discover how much disk space you really need for your website. Practical guide with examples per website type.