This is the most annoying problem in the WordPress if you do not know what to do exactly. For all those who still did not find the way to solve this problem, here is a simple way.
In order to increase WP memory limit, you need to edit wp-config.php file which is located in the root directory of your WordPress installation. If WordPress is installed on your main domain (like www. example.com) then wp-config.php file will be located in the public_html folder of File Manager in your hosting control panel (cPanel). You can access and edit this file through cPanel or using an FTP Client (like FileZilla).
Now search for the below line in your wp-config.php file:
/* That’s all, stop editing! Happy blogging. */
Now, copy and paste the below line of code just after that line, as shown in the screenshot.
define( ‘WP_MEMORY_LIMIT’, ‘256M’ );
This code will now increase your WordPress PHP memory limit to 256MB. After saving the wp-config.php file you can now visit your website to see if the error has been resolved or not. In most cases this simple method should resolve the issue.