Increase WordPress PHP Memory Limit

Increase PHP Memory in the .wp-config file to solve "fatal error: allowed memory problem" with WordPress website.

By β™Ÿ β€” Updated Jan 24, 2023

You may run into an issue when working with your WordPress / WooCommerce website that asks you to increase the WordPress memory limit. The easiest way to accomplish this is by editing your wp-config.php file.

HOWTO: Increase WordPress Memory Limit

  1. Log into cPanel and use File Manager to right-click edit your wp-config.php file for appropriate website in root directory
  2. Find the line /* That's all, stop editing! Happy publishing. */
  3. Right above this line, add the code define('WP_MEMORY_LIMIT', '256M');
  4. Select Save

An alternate method of setting the WordPress memory limit is to edit your wp-config.php file via FTP.

Why am I getting a PHP memory error?

  • Too many Plugins
  • Outdated or sloppy bloatware Theme
  • Large Media Files Like Videos

Misc Errors

  • Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 32768 bytes) in /home/website/public_html/wp-content/themes/Divi/functions.php on line 7671
  • Increase the PHP Memory in the .wp-config File to solve fatal error: allowed memory problem with WordPress website.
  • PHP Warning: Use of undefined constant ‘WP_MEMORY_LIMIT’ – assumed ”WP_MEMORY_LIMIT” (this will throw an Error in a future version of PHP) in /wp-config.php on line 420

Was this helpful?

Yes! πŸŽ‰ No! πŸ˜‘

Not quite what you're looking for? Get Help

Leave a Comment

Item added to cart.
0 items - $0