How to Increase the Allowed Memory Size limit in WordPress

In WordPress by Fathi Arfaoui0 CommentsLast Updated: September 29th, 2017

The WordPress memory limit error is a common issue appears when you try to upload an image, activate a new plugin, and sometimes with new themes installations. In general, your web hosting provider configures the PHP memory limit by default, but you can edit that limit later to correct the issue.

Please note that sometimes you’re not allowed to edit the WordPress PHP memory limit if your server is poorly configured. For now, let’s learn how to increase the allowed memory size in WordPress in easy steps, and without complicated things.

The message will look like:

Fatal Error: Allowed Memory Size Of 33554432 Bytes Exhausted

In general, the error looks like the above line with other detailed information about your PHP files, and the memory limits.

How to increase the memory limit in WordPress

To fix the problem and increase the PHP memory size, you have to do one of the following solutions:

1. Using the wp-confing.php file

Open your File editor and locate the file wp-config.php in the root directory, then add the following code:

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

If you still have the error, change 64M with 128M.

2. Using the htaccess file

This another method to increase the WordPress PHP memory limit, add this code to your htaccess file:

php_value memory_limit 64M

If you don’t have any idea about how to open your Blog files, take a look at how to edit file permissions, where you can learn how to open your blog files.

Or simply, login to your cPanel account, then click ”File Manager”, or ”Legacy File Manager”, check both the Root folder icon, and the show hidden files, and then click Go.

Related Content:  How to Secure WordPress Login Page in Simple Steps

how to increase allowed memory size in WordPress

Now, scroll down until you find wp-config.php file as below:

wordpress php memory limit

Click the file link and then you will get a new window with options, select ”edit” and add the code in that file. Don’t forget to save the file after before closing the window.

There is another solution with php.ini file, but it’s only available for the PHP version 5 and higher. So, make sure that you have a new PHP version, then login to your cPanel account, and open the file editor, or use an FTP client such as Filezilla.

Next, locate the file php.ini and click the ”edit” icon at the top of your window. We simply want to edit that file and change the default memory size there. So, use any text editor and when you have the file content click on (Ctrl+F) to find this line:
memory_limit = 32M ….

Now, change that initial value 32MB to 64MB if you want, and make sure to save the file before closing the window, or, you will still have the default memory size.

If you are using more PHP resources and you can’t add the value that you want, then, you’re using the maximum memory that the server was configured for. In this case, you have to contact your hosting provider and ask if they can set the maximum PHP memory for your website at a higher level.

If you still get the error and want more than the actual memory, then you should have your own VPS OR A dedicated server and manage your resources as you want. I recommend Liquid Web that offers an advanced dedicated server hosting. The service comes with a powerful PHP memory and RAM that can work with any advanced website, even, if you have high traffic.

Related Content:  10 Professional and Premium Magazine WordPress Themes

These are the two easiest methods to increase the WordPress memory limit without risks, just follow the above steps, and it’s done.

If for any reason, you still have the error message, then you should contact your hosting provider, tell them about the problem with a screenshot. That will help to resolve the problem in the server.

About Fathi Arfaoui

Fathi Arfaoui: Blogger, and the founder and owner of Trustiko.com. He shares Business, Blogging, WordPress, Web Safety, and Blogging tips to build better websites and blogs. Also, he shares online marketing strategies and recommendations.

Leave a Comment