Why WordPress shows 500 Internal Server Error

Solution 1:
One common reason WordPress URLs still point to the old site is because they are stored in the database. Running the following SQL queries in phpMyAdmin can help fix this:

UPDATE wp_options SET option_value = REPLACE(option_value,'old_site','new_site');
UPDATE wp_posts SET post_content = REPLACE(post_content,'old_site','new_site');
UPDATE wp_posts SET guid = REPLACE(guid,'old_site','new_site');
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value,'old_site','new_site');

Another possibility is that your hosting account includes a folder path with your username. For example, in the wp_options table you might see an upload_path like:

/home/[folder_old_id]/public_html/wp-content/uploads

To fix this, update the path using a query like:

UPDATE wp_options SET option_value = REPLACE(option_value,'folder_old_id','folder_new_id');

👉 Always back up your database before running these queries.

Solution 2:
I fixed the WordPress 500 Internal Server Error by updating the permalink settings.

  • Log in to your WordPress admin dashboard.
  • Go to Settings → Permalinks.
  • Select a different permalink option (e.g., Post name).
  • Click Save Changes to update the .htaccess file.
  • Revisit the page where the error occurred — it should now be resolved.