How to Increase Memory Limit WordPress

Increase memory limit wordpress

Do you ever think that without memory, where will our data store? Every application either on the system or on the web needs memory. You can assume that, like other programs of the computer, WordPress also wants the memory to store its data. Every website gets an allocated memory from a web hosting service provider, Its could be 64MB, 128 MB, 256MB, 512MB up to 1GB. We all know that WordPress is a great content management system. It works diligently even for those who have no technical knowledge, also check our blog on WordPress Basics for the beginners. Once you get familiar with WordPress, you will be loving it.

On the other hand, An user could encounter with different kind of WordPress errors like WordPress error 500, 404 page not found, kinds of errors, ( check our 5 most common WordPress errors blog). There are a lot of different errors can occur in a WordPress website, But the error that originates due to memory is called “WordPress Memory Exhausted error.” In this tutorial, we describe the ways of fixing memory exhausted errors in WordPress by increasing the PHP memory limit.

What is of WordPress Memory Exhausted Error

Server administrators provide a particular memory limit to various applications, but when your WordPress website demands more than an allocated memory limit, then WordPress Memory Exhausted error arises.

What would be the solution to Exhausted Memory Error?

The solution is simple, and here you need to increase the memory limit. Yes, increasing the memory limit in WordPress is the solution. Memory Exhausted error, as is clear from the name, refers to the exhaustion of memory range. For storing certain kinds of files, let’s say database files, codes, etc, storage is needed.

The hosting server is responsible for providing such a memory limit. With time, you can see that your site grows at a fast pace. Then you ought to make appropriate use of plugins as well as WordPress themes. That demands more space. But when you see an exhausted memory error message, at that time, WordPress memory exhausted error arises. This can be sorted out by increasing the memory limit in WordPress.

How to Increase Memory Limit WordPress?

By default, WordPress is having a memory of 64 MB multisite installation. But with the increase in data, do you think that it is sufficient. No, it is not viable to work with this limited memory limit. Want to increase memory limit WordPress follow these.

There are mainly three ways by which WordPress exhausted memory error is fixed by increasing the PHP memory limit.

A. By Increasing PHP Memory Limit in the php.ini file
B. Increase Memory Limit WordPress – from the wp-config.php file
C. We can also increase WordPress Memory Limit from .htaccess

Increase Memory Limit WordPress – By increase PHP Memory Limit in the php.ini file

Login into Cpanel, enter your username and password.

Login into C-panel

After login, the following page is open.


Now make a click on the File manager option. You move to the following page.

File manager option

Now you ought to click at the top, where the File menu is there. Click on the file and then create a new file.
Name that file as php.ini. After that, you ought to click on create a new file.


Now you can see the php.ini file, and you simply need to edit it by right click on it. Again you have to click on the edit button.

php.ini file

You see the blank page; you ought to select UTF-8 option

After UTF-8, you can see the following code; here you can change the memory limit according to your need.

safe mode = off
memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
file_uploads = On
max_execution_time = 180
enable_d1 = off

At last, you ought to save the changes.

Increase Memory Limit WordPress, Using wp-config.php

  • First of all You need to access your Cpanel with your username and the password
  • Now Open File manager> Public.html> Select your domain>Open WP-config.php file> You can now paste the following code of the program in the wp-config.php file.
define( 'WP_MEMORY_LIMIT', '256M' );

You ought to perform this activity as early before the line depicts.

This code conveys the WordPress website to increment the limit of the PHP memory to a specific value; let say it can be anything like 256 M or 512 M, depending upon your choice.
Now you are all ready to save the changes. At last, you ought to upload your wp-config.php file again back to the server.
Now your problem is sorted out. Your memory exhausted error vanishes now.

Increase Memory Limit WordPress by use of .htaccess

This is the simplest method to work on. Here you need to edit the .htaccess file. This file is located in the root directory. Some FTP client has hidden contents of the .htaccess file. For editing the file, you ought to click on the service menu that is present in an FTP client. After that, click on force showing hidden files option. You need to add or edit the following code in .htaccess file.

php_value_memory_limit 512 M

At last, you ought to refresh the FTP client. Now you can see whether your memory size is increasing or not.


You need more storage if you want that there would be no interruption in your work. We have described all the possible ways that can assist you. In this tutorial, we have described ways of fixing memory exhausted errors in WordPress by enhancing the PHP memory limit. We have described 3 ways to increase memory limit WordPress. If you have any doubt, ask me freely in the comment box.

Leave a Reply

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