WordPress Memory Exhausted Error – Increase PHP Memory

WordPress Memory Exhausted Error – Increase PHP Memory

Option 1: Editing the wp-config.php File
First, you’ll need to edit the wp-config.php file on your WordPress site. This essential WordPress file is located in the root directory, typically named public_html.

To access it, use an FTP client like FileZilla or the file manager in your web hosting control panel.

Next, add the following line of code to the wp-config.php file, placing it just before the line that says, ‘That’s all, stop editing! Happy blogging.

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

This code instructs WordPress to increase the PHP memory limit to 256MB.

For a detailed walkthrough, check out our step-by-step guide on locating and editing the wp-config.php file.

After making the changes, save the file and upload it back to your server.

Now, visit your WordPress site, and the memory exhausted error should be resolved.

Option 2: Editing the .htaccess File
The next method involves editing the .htaccess file, which is also located in your WordPress site’s root folder.

Add the following code to the file, placing it just before the line that says #END WORDPRESS.

				
						
php_value memory_limit 256M
				
			
Like the previous code, this will instruct WordPress to increase the PHP memory limit to 256MB. Once you’ve made the changes, save the file and upload it back to your web server. Then, revisit your WordPress site to see if the memory limit error has been resolved. If you can’t locate the .htaccess file, refer to our guide on why it might be missing and how to find it.

Option 3: Checking Your php.ini File
If the previous methods don’t resolve the issue, you might need to check your php.ini file.

The php.ini file controls your PHP settings, including the PHP version and scripts. Unlike WordPress core files, this file is typically managed by your hosting provider.

You can review its code to see your current PHP memory usage limit. For more details, refer to our guide on how to find and edit the php.ini file.

However, since this is a more advanced approach, we recommend contacting your web hosting provider’s support team to see if they can manually increase the WordPress memory limit for you. Attempting this on your own could lead to further issues.

For more information, check out our guide on how to effectively request WordPress support.

Option 4: Upgrading Your WordPress Hosting
If you’re frequently encountering the memory exhausted error, it could indicate that your website has outgrown its current hosting plan.

As your site gains more traffic and content, it demands additional resources to operate smoothly. Upgrading to a plan with a higher memory allocation might be the long-term solution you need.

Consider upgrading your WordPress hosting if:

You’ve tried the previous solutions, but the error persists.
Your website has experienced significant growth in traffic or content.
You plan to add new features or functionality that require more resources.
Bluehost offers affordable and reliable WordPress hosting plans that can scale with your website’s needs. Their platform is optimized for WordPress, making it easy to manage your site.

By using our Bluehost coupon code, you can save up to 61% on your first purchase.

Do you need an expert? HIRE US NOW!