Increase Memory Limit in WordPress: 5 Easy Ways > WordPress > Increase Memory Limit in WordPress: 5 Easy Ways

Memory limit problem is one of the most common errors in WordPress. Usually, this problem comes up when uploading large-size files. The good news is that it is easy to increase the WordPress memory limit.

But, how can we quickly increase the memory limit?

There are several ways to mitigate the problem. In this article, I have written a guide for you to correct the WP memory limit or WP memory exhaustion error problem.

How does Memory Limit Exhausted Error originate?

Every WordPress website is hosted on a hosting server. Usually: A fixed amount of memory is allocated to each site on a shared server. When a busy WordPress site uses up all the memory it needs, this error appears.

fatal memory error
Fatal error: Allowed memory size exhausted

What is the WordPress PHP memory limit?

A typical WordPress site typically requires 32 MB of memory. But, it is recommended to allocate 64 MB for managing large plugins like WooCommerce.

Generally, this error occurs on servers that have less memory allocated than this.

The More Memory, The More Happy a WordPress Site is

The maximum file size that WordPress accepts for uploads is also known as its upload capacity. This can be found on the media library upload screen.

32 MB of RAM is sufficient for a typical WordPress site. 64 MB RAM is better for busy blog sites.

But, a WordPress site that uses plugins like WooCommerce should allocate at least 256 MB of RAM. The number of users of the eCommerce site should be taken into consideration while determining the amount of RAM.

Also read:  How to change the Date and Time format in WordPress?

5 Ways to Increase Memory Limit

Increasing the memory limit for a WordPress site is really a simple task. But, how easy will the task be? Let’s do this manually in this post. Let’s get started.

We always recommend to keep a backup of your site’s files and database before making any changes that affects your site to any degree. You can go back to the previous state of your site if something does no go as expected.

1. Increase Memory Limit in wp-config.php

The easiest way to increase the memory limit is to add the WP_MEMORY_LIMIT native property to the WordPress config file. This property is not provided in the config file in the Fresh WordPress setup. It has to be added.

For this, open the wp-config.php file in the root of the site in any editor.

Edit wp-config.file

You can add it to the config file on your Localhost and upload it to the online server via FTP. Alternatively, you can make changes to the config file directly on the server through cPanel.

define(‘WP_MEMORY_LIMIT,’ ’32M’);

Here, you can give 56 or 128, or 256 instead of 32 MB.


2. Edit the php.ini file

This method of increasing the memory limit is done by changing the php.ini setting of the server’s PHP.

Create a new file called php.ini in the root of the site and open it in the editor. I will add the following file.

memory_limit = 128M

3. Edit your .htaccess file

You can increase the memory limit by adding the php_value directive to the site’s .htaccess file.

Also read:  How to Load JavaScript Files from a Custom Plugin in WordPress

.htaccess file is a special file. It is originally kept hidden on cPanel-based hosting servers. If you can’t see the file, you can set it to be shown in File Manager’s settings option.

Open the .htaccess file in an editor and save it by adding the following line.

php_value memory_limit xxx M

4. Install Free Plugin

You can increase memory limit with WordPress plugins, such as the Memory Usage, Memory Limit, PHP, and Server Memory Health Check and Fix Plugin. It allows you to change the available PHP memory without needing to access or modify any files.

5. Contact Your Hosting Service Provider

If you don’t want to go into so much technical mess, you can ask the hosting service provider to increase the memory limit of the server.

You can ask for help by creating a service ticket from the hosting provider’s client area.

You can increase the memory limit by following the alternative method by emailing them about this.

Wrapping Up

We have seen that there are several ways to increase the server’s memory limit. It largely depends on the configuration of the hosting server. Also, this can be done using PHP directives or using WordPress native parameters.

The decision to use in which circumstances this action will be resolved is at the discretion of the site administrator and/or owner.

If PHP or WordPress’ own mechanism is used, the site admin can handle this from cPanel. But, if you need to increase the memory limit from the OS level of the server, the support of the hosting service provider should be taken.

Also read:  How to add Google Translate to WordPress Site

I hope this post on increasing memory limit was able to solve your problem. In that case, share this post on your social media and help increase the reach of my site.

Category WordPress

Leave Your Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.