After hours of banging our heads against the wall trying to figure out why compatible plugins were breaking a new website build, we were turned onto the ‘increase memory limit’ trick! It was fairly simple to add a snippet of code and IT WORKED! So, we wanted to share this trick with you all (just in case you find that you need it).
You’ll need access to your hosting account (like Clarity Hosting) and navigate to the files for your website. Then follow the steps below provided by The7.
Blank page on theme preview or after theme activation, in most cases, is the indication of the so-called memory limit issue. It’s the same issue when you’re getting the “Allowed memory size of xxxxxxxx bytes exhausted” error. Here’s how to solve it:
First and foremost, try to edit the “wp-config.php” file in the root of you WordPress installation. Search for 'WP_MEMORY_LIMIT'
. If there is such setting, set the limit to '256MB'
. If there’s no such setting, add this bit of code before the MySQL settings define( 'WP_MEMORY_LIMIT', '256M' );
. Also make sure there’s no 'WP_MAX_MEMORY_LIMIT'
setting in “wp-config.php” file; or make sure it is not less then '256MB'
.
Second, if editing “wp-config.php” did not help, try to add this bit of code in the beginning of “.htaccess” file: php_value memory_limit 256M
.
Third, if you get the error even after completing both steps above, it may be that your PHP is configured in CGI or suPHP. In this case instead of “.htaccess”, you should create a file called “php.ini” and place this bit of code in it: memory_limit = 256M
.