Do you want to Fix the WordPress Memory Exhausted Error? or Want to know, How you can increase the memory limit on WordPress Website?
Don’t worry, in today’s blog I will tell you everything about increasing the memory limit in your WordPress website.
Sometimes while working on a WordPress website, many people see WordPress Memory Limit Exhausted Error, because of default allocated memory is limited.
So we have to increase the memory limit in WordPress so that the error will never show us again.
You’ve seen the following error While uploading or updating Files
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2348617 bytes) in/home4/example/public_html/wp-includes/function.php on line 399
How to Fix WordPress Memory Exhausted Error
There are a few ways for resolving this error, we have used these methods for WordPress Memory Exhausted Error.
- Edit wp-config.php File
- Modify the
- Editing the
- Wp Maximum Upload File Size Plugin
Above are three methods that we are going to use for fixing the WordPress memory exhaustion error and for increasing the memory limit in WordPress.
Note:- Before editing the files we suggest you back up your website data.
1- Fix WordPress Memory Exhausted Error By Editing wp-config.php File
You need to edit the wp-config.php file on your website. This file is located in your WordPress website’s root folder, and you can access it via your hosting control panel or via FTP Client.
Go to your Web Control panel, like we have used Cpanel to show you this method.
Increase the WordPress memory limit
- Now click on the File manager
- Here you will see the public_html folder, double click on that folder. as shown in the screenshot below.
- Now here, you will see the wp-config.php file, right-click on it, and click on the edit option.
- After opening the file you will see the following editor, as shown in the screenshot below.
- Now at the end of the editor section, under /* That’s all, stop editing! happy publishing. */ enter the following code.
define( 'WP_MEMORY_LIMIT', '256M' );
- After entering the above code. click on the save changes button.
Now you can see on your WordPress website the memory limit has increased. If this method is not working for you, so let’s try another method.
2- Increase memory limit in WordPress Modifying the
Again The .htaccess file is a file located within the root of your WordPress files, where the Wp-config.php file is located. so we have to carry out the same procedure.
- Go to your web hosting control panel
- Click on the File manager
- Now here, you will see the .htaccess file, right-click on it and click on the edit option.
- At the end of the code enter the following code
php_value memory_limit 256M
- Now click on the save changes button, and your memory limit will be increased.
If your memory limit is still not increased after trying the wp-config.php file and .htaccess file, then try the below method.
3- Fix WordPress Memory Exhausted Error and Php Memory Limit By Editing the
For editing the php.ini file you have to access the root folder of your WordPress website, as he has shown you before on the Wp-config.php file and .htaccess file.
- Go to the Web hosting control panel
- Click on the File manager
- Here you will see the php.ini file, right-click on it and click on edit.
- Now you will see the php.ini file editor panel.
- Enter the Following code at the end of the code
memory_limit = 512M
- After entering the code click on the Save Changes button.
So this is how you can edit the root files to increase the memory limit in your WordPress Website.
If you don’t want to edit the root files of your website, or you don’t have the access to your root files then we have another solution for you. You can increase the memory limit via the plugin. let’s see how it works.
4- Wp Maximum Upload File Size Plugin For increasing memory limit in WordPress.
You can increase the memory limit in WordPress through the plugin. install the Wp Maximum Upload File Size Plugin from the Plugins > Add new
- Install and activate the Wp Maximum Upload File Size Plugin,
- Now Go to Dashboard > Wp upload limit
- Now Choose the maximum upload file size, by default it is 64. you can select the size of your choice
- After selecting the file size click on the Save Changes button.
So this is how you can increase the memory limit in WordPress, and fix the WordPress Memory Exhausted Error.
If this solution does not work for you, then this means your web hosting service provider does not allow WordPress to increase the PHP memory limit.
You will need to ask your web hosting provider to increase your PHP memory limit manually.
So this is the article on how to fix the “WordPress Memory Exhausted Error”. you can try any of the above methods.
If you have any questions regarding any issue, do not hesitate, just comment down below, and we will help you to solve your problem. Thanks for reading this blog. 🙂