How to increase memory_limit in WordPress?
By Aj Khandal | Published: | 1 min read
This problem comes because some plugins need more memory_limit to run in our website and errors seem like —
Fatal error: the Allowed memory size of 33554432 bytes exhausted (tried to allocate 2348617 bytes) in /home4/xxx/public_html/wp-includes/plugin.php on line xxx
By default memory limit is 32mb. The best way to increase this limit is by using wp-config. This is one of the shortest and best ways to do it.
- Open
wp-config.php in the editor, which is placed in your root folder.
- Find this line:
/* That's all, stop editing! Happy blogging. */
- Paste this line below it:
define('WP_MEMORY_LIMIT', '64M');
This will set the memory limit to 64mb. If you need more than this, you can change it to 128M or 256M depending on your requirement.