Introduction

If you see an error like this on your WordPress site:

Fatal error: Allowed memory size exhausted

Don’t panic. This wordpress memory exhausted error simply means WordPress ran out of memory while trying to perform a task. You may also see it written as wordpress allowed memory size exhausted or as a general wordpress memory error.

This error often appears when:

  • Installing a plugin

  • Updating WordPress

  • Uploading large files

  • Running heavy themes or page builders

Luckily, fixing it is usually quick and easy.


Why the WordPress Memory Error Happens

Every website server has a PHP memory limit. This limit controls how much memory scripts can use.

When WordPress needs more memory than the server allows, it crashes and shows the memory exhausted error. Some people see this as a fatal error out of memory wordpress message, which is the same problem.

Common causes include:

  • Heavy plugins

  • Poorly coded plugins

  • Large media files

  • Page builders

  • Low hosting limits

Reading the Error Message

The full message usually looks like Allowed memory size of 134217728 bytes exhausted (tried to allocate ... bytes). The first number is your current limit in bytes (134217728 is 128MB), and the file path at the end of the message shows which plugin or theme was running when memory ran out. That path is a good clue for Fix 4.


Fix 1: Increase PHP Memory Limit (Most Common Fix)

The easiest fix is increasing WordPress memory.

Step 1: Open wp-config.php

  1. Log into File Manager or FTP

  2. Find the file wp-config.php

  3. Add this line before /* That's all, stop editing! */:

define( 'WP_MEMORY_LIMIT', '256M' );
  1. Save the file.

This increases WordPress memory to 256MB, which solves most cases. If you only see the error in the admin area, you can also add define( 'WP_MAX_MEMORY_LIMIT', '512M' );, which raises the limit for heavier admin tasks.


Fix 2: Increase Memory in .htaccess

If the first method doesn’t work, try editing .htaccess.

Add this line:

php_value memory_limit 256M

Save the file and refresh your site. Note that on some servers (such as PHP running through FPM or CGI) this line can cause a 500 error. If that happens, remove it and use the hosting panel method instead.


Fix 3: Update PHP Settings in Hosting Panel

Many hosts allow changing PHP limits directly.

Look for:

  • PHP Settings

  • MultiPHP INI Editor

  • PHP Configuration

Increase:

  • memory_limit → 256M or higher


Fix 4: Disable Heavy Plugins

Sometimes plugins use too much memory.

To test:

  1. Go to Plugins

  2. Deactivate heavy plugins like:

    • page builders

    • backup plugins

    • analytics plugins

Then activate them one by one.

If the error disappears, you found the cause.


Fix 5: Upgrade Your Hosting Plan

Cheap shared hosting often limits memory to 64MB or 128MB, which is very low.

If your site grows, consider upgrading to:

  • Better shared hosting

  • Cloud hosting

  • Managed WordPress hosting

More resources = fewer crashes. If your host caps memory below what you set, your changes in wp-config.php will have no effect, and upgrading or contacting support is the only fix.


How Much Memory Does WordPress Need?

Typical recommendations:

Website Type Recommended Memory
Small blog 128MB
Business website 256MB
WooCommerce store 256MB – 512MB

How to Prevent Memory Errors

Follow these tips:

  • Remove unused plugins

  • Use lightweight themes

  • Optimize images

  • Keep WordPress updated

  • Avoid poorly coded plugins

A clean WordPress setup runs much smoother.


Final

The WordPress memory exhausted error looks scary, but it usually means one simple thing:

👉 Your website needs more memory.

In most cases, increasing the memory limit in wp-config.php fixes the problem instantly.

 

Final Thoughts

If you want a fast, reliable, and easy-to-use contact form plugin, VPSUForm is the clear choice. Build unlimited types of forms – contact, booking, feedback, surveys – with minimal effort.

👉 Download VPSUForm today and get started
👉 Learn more about VPSUForm’s powerful features here