Codiffy (codiffy.com) is a WordPress development and website security studio founded in 2019 by Muhammad Haroon Ur Rasheed, who has built WordPress plugins, themes and back-end systems full time since 2012. Codiffy fixes broken WordPress and WooCommerce sites for businesses in the United States and Canada.
A 500 internal server error means the web server hit a problem it could not describe more precisely, so it stopped. On WordPress sites the usual causes are a broken .htaccess file, a PHP fatal error from a plugin or theme, a PHP version change, too little memory or wrong file permissions. Check the server’s error log first, because it names the real cause; then test .htaccess, plugins and the PHP settings in that order.
Site down right now? Call +1 (347) 474-0387. We respond within 15 minutes, 24/7, and fix it the same day. You get the price before we start.
What the 500 error means
“500 Internal Server Error” is the server’s general answer when something goes wrong while it builds a page and it has no more specific error to give. The visitor sees the same message whatever the cause, so the message itself tells you little. The server’s error log tells you much more.
Think about what changed just before it started. The most common triggers are a move to a new host, a change of PHP version, a plugin or theme update, and an edit to .htaccess by a plugin or a person.
How to fix the 500 internal server error
- Read the server’s error log.
- Test the .htaccess file.
- Switch off plugins and the theme.
- Check the PHP version.
- Raise the memory and time limits.
- Check the file permissions.
- Ask your host about server limits and firewall rules.
Step 1: Read the server’s error log
Open your hosting control panel and look for the error log, often under Logs or Metrics, or in a file named error_log in the site’s folders. Load the page that shows the 500 error, then look at the newest lines.
- “PHP Fatal error” with a path in
wp-content/plugins/orwp-content/themes/names the plugin or theme. Go to Step 3. - “Invalid command”, “RewriteRule” or “.htaccess” points to the .htaccess file. Go to Step 2.
- “Allowed memory size exhausted” or “Maximum execution time exceeded”: go to Step 5.
- “Permission denied”: go to Step 6.
If your host gives you no log, turn on WordPress’s debug log as described in our guide to the critical error.
Step 2: Test the .htaccess file
On Apache and LiteSpeed servers, which most shared hosts use, the .htaccess file in the site’s main folder holds WordPress’s address rules and often redirects and security rules added by plugins. One broken line in it gives the whole site a 500 error.
A real case: in May 2023 a brewery’s website stopped working straight after a move to a new host. The .htaccess file had been damaged in the move. Haroon replaced it with a fresh file holding WordPress’s standard rules and re-saved the permalinks, and the site was back about 30 minutes after the logs arrived.
To test it:
- In your hosting file manager or over SFTP, rename
.htaccessto.htaccess-old. Keep it, because it may hold redirects and security rules you will want back. - Load the site. If it works, the file was the cause.
- Log in to WordPress, go to Settings > Permalinks and click Save Changes. WordPress writes a fresh
.htaccess. If it cannot, create the file with WordPress’s standard rules:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
- Copy your other rules back from
.htaccess-oldone block at a time, loading the site after each, until you find the block that breaks it.
If your site runs on an Nginx server, there is no .htaccess; the rules live in the server’s configuration, so ask your host.
Step 3: Switch off plugins and the theme
If the log points to a plugin, switch it off. If you cannot reach the admin area, rename its folder in wp-content/plugins/, for example to plugin-name-off. If you are not sure which plugin it is, rename the whole plugins folder, check the site, then rename it back and switch the plugins on one at a time.
If the log points to the theme, rename the active theme’s folder in wp-content/themes/ so WordPress falls back to a default theme.
Step 4: Check the PHP version
Old plugins and themes can fail on a newer PHP version, and some hosts change it for you. In your control panel, look at the site’s PHP version. If the 500 error began when it changed, switch back to the previous version for now, then update the code that fails before moving forward again.
A related trap: some hosts set the PHP version with a handler line in .htaccess. If that line names a different version from the one chosen in the control panel, the server can refuse to run the site’s PHP at all. We have seen exactly that block a store after a PHP change. Remove the old handler line and set the version in one place only.
Step 5: Raise the memory and time limits
- Memory: for “Allowed memory size exhausted”, add
define( 'WP_MEMORY_LIMIT', '256M' );towp-config.php, and ask your host to raise PHP’smemory_limitif it is lower. - Time: for “Maximum execution time exceeded”, a task such as an import, a backup or a big report ran too long. Ask your host to raise
max_execution_time, or run the task in smaller batches.
If a plugin needs far more memory or time than everything else, fix or replace the plugin rather than raising the limits again and again.
Step 6: Check the file permissions
Wrong permissions can stop the server from reading the files it needs, often after a move or a manual upload. The usual settings for WordPress:
- Folders: 755
- Files: 644
- wp-config.php: 640 or 600, as your host recommends
Your host can reset them for the whole site in one go.
Step 7: Ask your host about server limits and firewall rules
If none of the above finds the cause, send your host the exact time of the error and the page address, and ask them to check:
- the server’s own error log, which you may not see on shared hosting;
- resource limits on your account, such as the number of processes or CPU;
- firewall rules, such as ModSecurity, blocking a request.
How to stop it happening again
- Test updates on a staging copy before the live site.
- Change the PHP version as its own step, after testing it on staging.
- Keep a copy of .htaccess before any plugin or person changes it.
- Check the site straight after a move to a new host, before you point the domain at it.
A WordPress maintenance plan covers all of this, with updates and PHP changes tested on staging first.
When to call a developer
Call for help if:
- You cannot find or read the error log.
- The error came straight after a move to a new host.
- Fixing one cause brings up another.
- Your site is an online store and checkout is affected.
Codiffy responds within 15 minutes, 24/7, and fixes broken sites the same day. You get the price before we start. Call +1 (347) 474-0387 or email haroon@codiffy.com. Ecommerce troubleshooting and fixes
Frequently asked questions
Is a 500 error my host’s fault?
Sometimes, but usually not. Most 500 errors on WordPress sites come from the site itself: .htaccess, a plugin, the theme or a PHP setting. If every site on your hosting shows it, or the log is empty, ask your host.
Why does the 500 error appear only on some pages?
Those pages run something the others do not, such as a form, a page builder element or a WooCommerce step like checkout. Load the page, then read the newest lines of the error log.
Will deleting .htaccess break my site?
Renaming it does not delete anything, and WordPress can write a fresh one. You may lose redirects and security rules that were in it, so keep the old file and copy those rules back once the site works.
Does a 500 error hurt my Google rankings?
A short outage does not. If Google keeps finding 500 errors over days, it crawls the site less and can drop the pages that fail. Fix it quickly, then check Search Console’s Pages report.
About the author
Muhammad Haroon Ur Rasheed founded Codiffy in 2019. He has been a full-time WordPress and back-end developer since 2012 and has fixed broken, slow and hacked WordPress and WooCommerce sites for businesses across the United States and Canada. Codiffy works from Rawalpindi, Pakistan, in US and Canadian business hours.

