How to fix ‘WordPress Allowed memory size exhausted’ error in websites

How to fix ‘WordPress Allowed memory size exhausted’ error in websites

In WordPress websites, one of the commonly encountered errors is related to the memory size limit. As WordPress is based on PHP, the maximum memory that can be allotted to WordPress depends on the PHP memory limit in the server.

When enough memory is not available for WordPress, the error that shows in the website or log file would be – “Fatal error: Allowed memory size of XX bytes exhausted (tried to allocate XX bytes) in /directory/filename.php on line XX”.

Based on whether the PHP is configured to display errors or not, the symptoms of this memory error would be either a blank page in your WordPress website or error notices displayed in the log file.

 

WordPress Allowed memory size exhausted

WordPress Memory error

 

The WordPress allowed memory size exhausted error can happen during any of these scenarios:

  1. During initial WordPress install
  2. While trying to install or use a new plugin in WordPress
  3. After migrating the WordPress site to a new server
  4. When there are too many posts or plugins in your WP site
  5. The themes and files in the WordPress site are too bulky

What causes ‘WordPress allowed memory size exhausted’ error?

Every webserver has certain limits set on its memory usage, to avoid a resource abuse. By default, the memory allocated for WordPress is 40 MB for single site and 64 MB for multi-site.

The ‘Allowed memory size exhausted’ error in a WordPress site clearly means that the webserver is running out of its allocated memory limit for PHP.

This can happen due to 2 main reasons:

1. The website contains WordPress plugins or other data that consume more memory than allowed for use by the site.

2. The webserver is configured with a very low memory limit than required for the basic functioning of the WP site.

[ You don’t have to lose your sleep to keep your customers happy. Our Hosting Support Specialists cover your servers and support your customers 24/7 at just $9.99/hour. ]

How to fix the error ‘Allowed memory size exhausted’ for WordPress sites

WordPress websites have a configuration limit that allows to set the maximum memory that can be used for PHP by WordPress. This is set with the parameter ‘WP_MEMORY_LIMIT’ in ‘wp-config.php’.

The file ‘wp-config.php’ is the configuration file for a particular WordPress install and is found in the WordPress root directory. To increase PHP Memory to 128 MB, this setting should be updated with the value of memory limit that you require, say 128 MB:

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

But this limit is further limited by the PHP memory limit for the site. WP_MEMORY_LIMIT cannot exceed a value that is set as PHP ‘memory_limit’ in the ‘php.ini’ file, which is the configuration file for PHP in the server.


STOP SPENDING TIME ON SUPPORT!

Do you spend all day answering technical support queries?

Wish you had more time to focus on your business? Let us help you.

We free up your time by taking care of your customers and servers. Our engineers monitor your servers 24/7, and support your customers over help desk, live chat and phone.

HIRE SUPPORT SPECIALISTS AT $9.99/HR

Bobcares provides Outsourced Web Hosting Support and Outsourced Server Management for online businesses. Our services include 24/7 server support, help desk support, live chat support and phone support.

Submit a Comment

Your email address will not be published. Required fields are marked *

Bobcares
Bobcares is a server management company that helps businesses deliver uninterrupted and secure online services. Our engineers manage close to 51,500 servers that include virtualized servers, cloud infrastructure, physical server clusters, and more.
MORE ABOUT BOBCARES