Error 500 on WordPress dashboard – WordPress websites

What to do with Error 500 in the dashboard

If Error 500 appears when you call up the WordPress dashboard, it is helpful to also look at the website status under Tools.

The following problem appeared on one of our websites: If you go to “Save” in the block editor (Gutenberg), the message “Save” remains and the message “Saved” does not appear. However, if the post was opened in another browser tab, for example, you could see that the post had been saved.
The problem only affected the dashboard. There were no problems in the frontend (i.e. what the visitors of the website see).

That wasn’t tragic in itself, although it was a bit strange, but we then received an Error 500 or a “Critical Error” error message from WordPress in the dashboard. However, this error did not appear directly when the first post was created. So we had already been able to publish a few posts without any problems.

Incidentally, if this message is not sent by e-mail, then this could be related to settings at the hoster. We have already explained in an article how this problem can possibly be solved.

Log errors in the debug.log

Unfortunately, the error message that a critical error has occurred was not sent by email. We then found the solution as follows.

In the wp-config.php we have above the line
/* That’s all, stop editing! Happy blogging. */
entered the following lines:

  • WP_DEBUG is a PHP constant that can be used to enable debug mode in WordPress.
  • In the second line, the PHP constant WP_DEBUG_DISPLAY ensures that the error messages are not displayed on the monitor.
  • In the third line, another PHP constant WP_DEBUG_LOG ensures that the error messages end up in the debug.log in the wp-content folder.

However, it is important that the wp-config.php is edited with a suitable editor. For this purpose z. B. Atom Editor or Notepad++. Please do not use the Windows Notepad or Mac text editor.

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', true );

Error 500: Incorrect value in php.ini

Ultimately, the cause of the error 500 turned out to be an incorrect value in the php.ini: 2200M was entered for memory-limit (2200M) at the hoster. After the correction to 1024M, the error no longer appeared. You can also check this value from Tools > Site Health > About > WordPress Constants.

Error 500

If the value cannot be changed via php.ini, there is also a PHP constant that can be defined in wp-config.php.

The wp-config.php file is located in the root directory of the WordPress instance. This file can be accessed via FTP. For this purpose, we usually use the freely available program FileZilla. First you should save the wp-config.php on the local computer. Then the PHP variable is defined by the following line in wp-config.php:

define('WP_MEMORY_LIMIT', '256M');

The value that has to be entered in wp-config.php or in php.ini depends on the host and the contract. As a rule, a value of 256 MB should be possible. You should ask the hoster for a value for this entry.

After changing the value, it is recommended that you check again via the website status under Info whether this is now being implemented correctly.

define('WP_MEMORY_LIMIT', '256M');

Find out more on this website

Graphic: haurand.com

To the blog

Find out more on our website

We are looking forward to your contact