WordPress

Top 5 WordPress Errors and Their Solutions

WordPress powers around 40% of all websites, according to W3Techs. With that many sites, plugins and themes, errors are part of the job. Most of them have a quick fix once you know the cause.

This guide covers the seven errors we see most often on WordPress sites, with the fastest fix for each. For the bigger problems, we link to a full step-by-step guide.

Quick reference

ErrorWhat it meansFastest fix
Error establishing a database connectionWordPress cannot reach its databaseCheck the database details in wp-config.php
White screen or “critical error”A PHP error stopped the pageUse the recovery email, then disable plugins
Too many redirectsYour site loops between URLsCheck the site URLs and clear cookies
404 on posts after a migrationPermalink rules are missingSave your permalinks again
Maximum execution time exceededA script ran too longRaise the time limit
“Not secure” warningHTTPS is not set up correctlyFix mixed content and the certificate
Forgotten admin passwordYou cannot log in or get the emailReset it in phpMyAdmin

Before you change anything, take a backup of your files and database. If you can, test fixes on a local copy of your site first.

1. Error establishing a database connection

This message means WordPress cannot talk to your database. Without the database, your site has no content to show.

Common causes: wrong database details, a database server that is down, a damaged database, or a hosting limit.

How to fix it:

  1. Open wp-config.php in your site’s root folder.
  2. Check DB_NAME, DB_USER, DB_PASSWORD and DB_HOST. They must match what your hosting panel shows.
  3. Ask your host whether the database server is running.
  4. If the details are right, add define( 'WP_ALLOW_REPAIR', true ); to wp-config.php and open yourdomain.com/wp-admin/maint/repair.php. Run the repair, then remove the line.

See our full guide: WordPress database connection error explained.

2. White screen or “There has been a critical error”

A blank page or a short critical error message means PHP hit a fatal error. It is usually caused by a plugin, a theme or a memory limit.

Fastest fix: Look for the “Your Site is Experiencing a Technical Issue” email from WordPress. It has a recovery link that names the faulty plugin or theme. No email? Rename the plugins folder over FTP to switch off every plugin, then switch plugins back on one at a time.

For the full list of fixes, read how to fix the WordPress White Screen of Death. If memory is the cause, see how to increase the PHP memory limit.

3. Too many redirects (redirect loop)

Your browser shows “This page isn’t working. Too many redirects” (ERR_TOO_MANY_REDIRECTS). The site keeps sending visitors back and forth between URLs.

Common causes: different WordPress Address and Site Address settings, a bad HTTPS plugin setting, a faulty .htaccess file, or a CDN set to the wrong SSL mode.

Fastest fix: Clear your browser cookies and cache first. Then go to Settings > General and check that both URLs are identical and use the same https address. Turn off redirect or SSL plugins to test. Our guide explains every step: how to fix the WordPress redirect loop error.

4. Error 404 on posts after moving your website

You move your site to a new server. The homepage loads, but every post and page shows a 404 error.

This happens because the permalink rules did not come over with the move.

How to fix it:

  1. Log in to your dashboard and go to Settings > Permalinks.
  2. Do not change anything. Just click Save Changes.
  3. Reload a post. If it still fails, rename the .htaccess file to .htaccess_old, then save permalinks again to create a fresh one.
  4. On Nginx servers there is no .htaccess file, so ask your host to check the rewrite rules.

Also check that your site URLs match the new domain. After a domain change, allow time for DNS propagation before you test.

5. Maximum execution time exceeded

You may see “Fatal error: Maximum execution time of 30 seconds exceeded.” WordPress ran a task, such as an import, a backup or a big plugin update, that took longer than the server allows. Many servers set the limit at 30 seconds by default, though some hosts use a different number.

How to fix it:

  • Ask your host to raise max_execution_time. This is the safest option.
  • If you can edit php.ini, set max_execution_time = 300.
  • Some hosts let you add this line to wp-config.php: @ini_set( 'max_execution_time', '300' );

If one of these lines causes a new error, remove it and ask your host for help. Also check whether a plugin is running a heavy task. Fixing the plugin is better than raising the limit forever.

6. “Not secure” warning on your site

Browsers show “Not secure” when your site loads over plain HTTP or mixes secure and insecure content. Chrome replaced its padlock icon with a neutral icon in 2023, so you may not see a green padlock even on a healthy site.

insecure ssl no green padlock
No green padlock in browser

How to fix it:

  1. Mixed content: Make sure images, scripts and stylesheets load over HTTPS. A plugin such as Really Simple SSL can update the links for you.
  2. Expired certificate: Check the expiry date. Most hosts renew free certificates automatically, so ask yours if it has stopped.
  3. Wrong install: Reinstall the certificate from your hosting panel, or ask your host to do it.
  4. Redirects: Send all HTTP traffic to HTTPS, and make sure both site URLs in Settings > General start with https.

If you use Cloudflare and see error 526, read how to fix the invalid SSL certificate error. To learn the basics, read our guides on SSL certificates and why your site has no green padlock.

7. Forgotten admin password

Usually you click Lost your password? and get an email. But some servers cannot send email, so the reset link never arrives.

How to reset it in phpMyAdmin:

  1. Log in to your hosting panel and open phpMyAdmin.
  2. Open your WordPress database and find the wp_users table. Your prefix may differ.
  3. Click Edit next to your admin user.
  4. In the user_pass row, choose MD5 in the Function column and type your new password in the Value column.
  5. Click Go to save, then log in.
  6. Change the password again from your profile, so WordPress stores it with its current secure method.

If you use WP-CLI, you can run wp user update USERNAME --user_pass=NEWPASSWORD instead.

To stop this problem coming back, install an SMTP plugin so your site can send email reliably. Use a strong, unique password and review our guide to keeping your WordPress website secure.

Other errors you may meet

Internal Server Error (500): Often caused by a faulty .htaccess file. Rename it to .htaccess_old and reload. If that works, create a new one from Settings > Permalinks. If not, check plugins, memory and your host’s error log.

Stuck in maintenance mode: After an interrupted update, WordPress may show “Briefly unavailable for scheduled maintenance.” Use FTP to delete the hidden .maintenance file in your site’s root folder.

Headers already sent: Usually caused by extra spaces or output in a PHP file. See how to fix the headers already sent warning. For other website errors, see 5 common website errors and their solutions.

How to prevent WordPress errors

  • Back up your site before every update.
  • Update plugins one at a time and test the site each time.
  • Remove plugins and themes you do not use. Our guide on why you need WordPress plugins helps you keep the list short.
  • Use a caching setup that matches your host.
  • Run a security plugin.
  • Choose a host with daily backups and good support.

Summary

WordPress errors look alarming, but most have a simple cause and a quick fix. Start with the basics: read the error message, check your recovery email and turn off plugins one at a time. Always take a backup before you change any file or database setting. Keep your plugins updated, remove the ones you do not use, and test big changes on a copy of your site. If you get stuck, contact us and we will help you fix it.

Show More

Raj Maurya

Raj Maurya is the founder of Digital Gyan. He is a technical content writer on Fiverr and freelancer.com. When not working, he plays Valorant.

Related Articles

Leave a Reply

Back to top button