Act now to save up to 60% on Cloud Hosting. Hurry, sale ends soon!
  • 00 Days
  • 00 Hours
  • 00 Minutes
  • 00 Seconds

How do you set the usable memory limit in WordPress?

WordPress is developed based on the PHP language, and like all PHP applications or scripts, it consumes RAM and CPU resources, among other resources at the expense of your hosting.

WordPress comes pre-configured to use a maximum of 40MB of server RAM per process. This limit is determined even if your PHP memory_limit is set higher, so if we want WordPress to be able to use more memory per process, this should be specified in the wp-config.php file of your WordPress installation.

As long as memory_limit in PHP is high, we can specify the parameter that appears below in the wp-config.php file, with the corresponding value. Editing and modifying the wp-config.php file is a very easy process, as you can do it by going to your WordPress site files, selecting the wp-config.php file, and then clicking Edit.

If we want to put a maximum of 128MB of memory to use per process, we'll have to put this line in the wp-config.php file:

 

define('WP_MEMORY_LIMIT', '128M');

 

If we want to add a maximum memory of 256MB per process, we should use this:

 

define('WP_MEMORY_LIMIT', '256M');

 

Is the process easy? Most of today's complex plugins and themes can require more memory than the default maximum of 40MB, so changing the memory limit in WordPress can help us solve the problems.

WooCommerce is one of those plugins that need more than 40MB of memory per process to function. In addition to WooCommerce, there are many others, such as LearnPress or well-known templates such as Divi.

Finally, I would like to point out again that if the memory limit set in the PHP config for the server is less than the limit set in WordPress via the wp-config.php file, then the limit that will be set is the server limit and this can cause a huge error.

We recommend that you modify the php.ini file and adjust the memory there as well.

  • 2323 Users Found This Useful
  • WordPress, WP memory limit
Was this answer helpful?

Related Articles

How to Delete Categories in WordPress

If you want to remove the WordPress category, then follow this instruction:1. Log in to the...

How to Install a WordPress Plugin

WordPress plugins are very useful. You can easily install a plugin from the WordPress...

How to Delete a WordPress Theme

You should remove unused themes. It is considered good practice to protect your WordPress website...

How to Access the WordPress Admin Dashboard?

WordPress is an easy to work with CMS software. To access a WordPress account, please follow...

How to Install WordPress using Softaculous?

This tutorial will guide you how to install WordPress with just few clicks using Softaculous....