Everything you need to know about the

Limited Memory Size Error

What is causing it, and how can it be prevented and fixed?

Fatal error memory size

What's Causing The Limited Memory Size Error?

Every task performed by a plugin or theme requires a certain amount of memory to be allocated.

Complex plugins and tasks require more memory power than simple or light plugins.

WordPress will display the Limited Memory Size error when the minimum amount of memory required to accomplish a task is unavailable.

WordPress is built with PHP, a server-side program language that needs memory.

It’s an annoying issue that can cause your website to slow down drastically or even stop altogether.

In most cases, WordPress’s default PHP memory limit is set to 128M.

Your WordPress site may exhaust its server memory if it has many images, videos, and other media types. Too many unused WordPress plugins installed on your website can also outgrow your hosting plan’s resources and use all the available memory.

How to prevent the Limited Memory Size Error from happening in the future?

There are several possible causes of the limited memory size error, and we can take some steps to prevent it from happening on our WordPress website.

Some of the key points you need to pay attention to and fix are:

  • Increase the memory size of your PHP server (we will show you how to do it in the next section).
  • Delete unused or unneeded plugins from your WordPress dashboard.
  • Optimize your image’s sizes. Large images take a lot of resources. It’s recommended that their file size be reduced. You can do it without compromising the quality with tools like Imagify or TinyJPG.
  • Use caching plugins such as WP Rocket or WP Fastest Cache. A cache plugin downloads and stores your website data, preventing WordPress from regenerating it every visit.

Keeping the points above in check will ensure your WordPress website does not face the limited memory size error.

If you already see the limited memory size error, proceed to the next section to learn how to fix it.

Not enough PHP memory

The set memory size is not enough to run your website.

Heavy plugins

Complex plugins can use a significant amount of PHP memory.

Outdated PHP version

An outdated or misconfigured server can cause the memory size limit error.

Did you know...

WordPress content management system core files and most of its themes and plugins are all written in PHP.

How to fix the Limited Memory Size Error?

The settings define the allowed memory limit for WordPress, located in the wp-config.php file.

Unless the function is added or modified, WordPress will use the default memory limit, which, in many cases, is not enough to run complex plugins.

Therefore, we need to edit the wp-config.php file to increase WordPress’s allocated memory limit.

The wp-config.php is located in the root folder of your WordPress installation.

You can access the wp-config.php file using FTP software such as FileZilla or the file manager interface from your hosting cPanel.

To fix the limited memory size error in WordPress, follow these steps:

  1. Access the WordPress root folder

    Access your WordPress root folder using FTP software (we can do it for you).

  2. Open the wp-config.php file

    Right-click on the wp-config.php file and select edit.Edit wp config php file

  3. Change the memory limit value.

    Please search for the WP_MEMORY_LIMIT setting and increase its number to 256M.

  4. Optional: Add the WP_MEMORY_LIMIT function

    You never set it up if you couldn’t find it. Therefore, add define( 'WP_MEMORY_LIMIT', '256M' ); just above /* That's all, stop editing! Happy publishing. */Increase WP Memory Limit

  5. Save changes

    Save the file.

Once saved, refresh your website and ensure it can load without issues.

Memory Size Limit Error in WordPress – Frequently Asked Questions

What causes the “Allowed Memory Size Exhausted” error in WordPress?

The error occurs when WordPress, plugins, or themes exceed the allocated PHP memory limit.

How do I check my current PHP memory limit?

Go to Tools > Site Health > Info > Server in WordPress admin.Check WP Memory Limit

How can I increase the PHP memory limit?

There are a few ways to increase the PHP memory limit in WordPress:
1. Add define('WP_MEMORY_LIMIT', '256M'); to the wp-config.php file.
2. Modify the memory_limit value to 256M (or higher) in the php.ini file.
3. Change to php_value memory_limit 512M in the .htaccess file.

What is the recommended PHP memory limit for WordPress?

The default memory limit value is 32MB, but basic websites require at least 128 MB. WooCommerce and larger websites require a higher memory limit of 256 or 512 MB.

Can plugins or themes cause high memory usage?

Yes, poorly optimized plugins or themes can consume excessive memory.

Can a bloated database cause memory issues?

Yes, large databases slow down queries and increase memory use. You can use dedicated plugins to clean and optimize your database or use us.

Access the WordPress root folder

Right-click on the wp-config.php file to edit it.

Increase the memory limit value

Add define('WP_MEMORY_LIMIT', ‘256M'); to the wp-config.php file.

Save the changes

Save the file and refresh your website.

Fixing it yourself sounds too complicated?

Let us fix the Limited Memory Size Error for you!

Get the Limited Memory Size Error fixed in two different ways:

Single Purchase

A single purchase of Limited Memory Size Error fix.

$39

Maintenance Plans

The Limited Memory Size Error fix is included in our maintenance plans.
Here are a few tips from us before you leave

Practical tips, examples, and best practices to keep your WordPress site safe.

Your website will thank us, you welcome :)