Increase memory limit
If your site shows an error like "Allowed memory size of xxxxxx bytes exhausted", it has hit a memory limit. There are two related limits:
- PHP memory limit (
memory_limit) - the maximum amount of memory a PHP process can use. This is the hard ceiling, set at the server level. - WordPress memory limit (
WP_MEMORY_LIMIT) - how much of that memory WordPress allows itself to use. It can never exceed the PHP memory limit.
Change the PHP memory limit in the Templ Panel
The easiest method: open your website in the Templ Panel and go to Website → Advanced → PHP Settings, where you can change Memory limit directly. See PHP settings.
Increase the WP memory limit with wp-config.php
Connect to your site with SFTP and navigate to the root folder of your website, find the wp-config.php file and add the following line:
define( 'WP_MEMORY_LIMIT', '128M' );
You must insert the line just BEFORE /* That's all, stop editing! Happy publishing. */ in the wp-config.php file.
Using Templ Optimizer
Another method to change the WordPress memory limit is to install our Templ Optimizer plugin on your website and change the memory limit from within our plugin.