How to Fix “Allowed Memory Size Exhausted” Error Without Touching Code (via cPanel)

If you’ve encountered a scary white screen or the message Fatal error: Allowed memory size of x bytes exhausted, you’re not alone. This is one of the most common WordPress errors and thankfully, you don’t need to touch code to fix it.

In this article, we’ll walk you through how to fix the “Allowed Memory Size Exhausted” error using only your cPanel account. No need to open files manually or edit PHP code directly.

What Does This Error Mean?

When your WordPress website tries to use more memory than what the server allows for PHP scripts, the server stops the process and throws this error.

You might see:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate…)

This means your memory limit is too low and WordPress, a plugin, or theme is trying to use more memory than it’s allowed.

Why This Happens (Common Causes)

  • Poorly optimized themes or plugins

  • Heavy WooCommerce or page builder operations

  • Multiple high-memory plugins running together

  • Large media or database imports

  • Low default PHP memory limit (like 32M or 64M)

How to Fix It Using cPanel (No Coding)

Here are multiple ways to increase your PHP memory limit safely from cPanel.

Method 1: Use cPanel’s MultiPHP INI Editor

  1. Log in to your cPanel account

  2. Scroll down to the “Software” section

  3. Click on MultiPHP INI Editor

  4. Under Basic Mode, choose the domain where WordPress is installed

  5. Look for the setting: memory_limit

  6. Increase it to something like:

    256M

    or

    512M

    depending on your hosting plan

  7. Click Apply

Done! This is the safest and easiest method to increase memory.

Method 2: Use Select PHP Version (if available)

Some hosting panels have this instead of MultiPHP:

  1. In cPanel, go to Select PHP Version under the Software section

  2. Click Options or Switch to PHP Options

  3. Find memory_limit

  4. Click the value and select a higher one (e.g., 256M)

  5. Changes are saved automatically

Method 3: Use the cPanel File Manager (No Code Knowledge Needed)

If your cPanel doesn’t offer the tools above, you can still modify settings safely using File Manager.

  1. Go to File Manager from the cPanel dashboard

  2. Navigate to your WordPress root directory (public_html/)

  3. Look for the file: .htaccess or php.ini

A. If there’s a php.ini file:

  • Right-click and Edit

  • Add this line or modify if it exists:

memory_limit = 256M

B. If there’s no php.ini, create one:

  • Click + File

  • Name it: php.ini

  • Edit the file and add:

memory_limit = 256M

C. If using .htaccess:

  • Edit .htaccess and add this at the top:

php_value memory_limit 256M

Important: Always back up files before editing. Only use .htaccess if you’re not on LiteSpeed/NGINX servers that ignore PHP values in .htaccess.

Test If the Issue Is Resolved

  • Go back to your website

  • Refresh the page

  • If the error is gone, the new memory limit is active

Still seeing the error? Try increasing the limit further to 512M or disable heavy plugins temporarily to isolate the cause.

Pro Tip: Identify Memory-Hungry Plugins (Optional)

Use a plugin like Query Monitor (after fixing the error) to see what’s consuming memory in the admin area.

What to Do If the Error Persists

If none of the above methods work:

  • Clear browser cache and server cache (if you use a caching plugin)

  • Contact your hosting support and ask them to increase the memory limit manually

  • Consider removing recently added plugins or themes to test for conflicts

Final Thoughts

The “Allowed Memory Size Exhausted” error doesn’t mean your site is broken just that it hit a ceiling. With cPanel’s tools, you can increase that ceiling safely without ever touching raw code.
By following this article, even beginners can fix this issue in minutes.