If you are doing things on your site and suddenly get an error message like “There has been a critical error on your website.” but you don’t always see this and your site otherwise works normally, in most cases we have found this is something that can happen on sites that use a lot of plugins or sites with high resource usage on the hosting.
To solve this issue, it is recommended that you increase the WP Memory Limit. Our team can also help with this if you do not want to edit your site files. We would just need you to open a ticket and provide the following details:
- Your WordPress site URL
- Logins for Admin access to your WordPress site
- FTP or cPanel access so we may be able to edit the files of your site to make this change
If you want to do this on your own, just follow instructions below:
Edit wp-config.php File to Increase WP Memory Limit:
First step is to take a backup of your wp-config.php file which is found in the main (root) directory of WordPress. We are not responsible for any mistakes you may make while editing so please do take that backup!
Now open the editor (either in FTP or Cpanel).
If you haven’t altered the default wp-config.php file you will see a line of code about 2/3 of the way down the file that looks like this:
define( 'WP_DEBUG', false);
Below that line you will need to add a new line by using the “enter/return” key on your keyboard, and then enter the following line of code to increase the memory limit.
After you paste that line of code you may save and exit the editor.
This is what it should look like after making that change:
Once you save this, you can go back into your WordPress site and check if the limit was actually changed by following these steps:
- In your WordPress Dashboard, click on “Tools > Site Health”
- Then click on “Info” at the top
- Then click “WordPress Constants
You’ll see there the memory limit for WP
Now you should hopefully no longer see the critical error message, but if you do, then you may have to increase it more to accommodate your site’s specific needs.
If you need further help please reach out to our team and we’ll be happy to check this for you.