How to Fix “Fatal Error: Allowed Memory Size Exhausted” on your WordPress site

If you’ve been using WordPress for a while now, you know that one of the most common errors you’ll see is the “Fatal Error: Allowed Memory Size Exhausted” message. This is super alarming because instead of seeing your gorgeous site, you see this ugly white page with some confusing text on the screen. Never fear, the Divi Engine team is here to bail you out. We are going to talk about why you might see the “Fatal Error: Allowed Memory Size Exhausted” error, but if you want to skip to the solution, click the button below.

What does “Fatal Error: Allowed Memory Size Exhausted” mean?

So let’s look at an exact example of this issue below and talk about what it means.
WordPress Fatal Error: Allocated Memory Size Exhausted

The big clue here is in the message itself, it says that the “Allowed memory size of 33554432 bytes exhausted”. Now for some of us that are newer might think “But hey, my computer has a ton of memory”, and this is a common misunderstanding and why this message can be confusing. What this message refers to is the memory that your web server with your hosting provider has provided for your site to run. This is often set to a very low number like 32 megabytes which can cause issues when doing things like uploading images or installing a new theme. When the PHP which powers WordPress runs into that memory limit on the server, it triggers this fatal error causing widespread panic, but don’t stress as there is a very easy fix to the issue.

NOTE: WordPress is written in PHP, which is a server-side programming language. The better hosting services you pay for, the better your sites will generally perform. Poor memory performance can often be tied to cheaper shared hosting.

How to check your PHP Memory Limit

The first step in avoiding the “Fatal Error: Allowed Memory Size Exhausted” issue is to check what your current PHP Limit is. If you are running an updated WordPress install, this is very easy to do.

Just head over to “Tools” > “Site Health” > “Info”

Once there scroll down to the “Server” section and there you will see the “PHP memory limit”. If this number is 64 or less, you will definitely need to increase the “PHP memory limit”.

WordPress Site Health

Solution: “Fatal Error: Allowed Memory Size Exhausted”

To fix this, all we need to do is access the filesystem for our WordPress install using your favorite FTP client and edit the wp-config.php file. This file can be found at the root of your WordPress install.

NOTE: To learn more about editing the wp-config.php file check out this article.

Once you’ve located the file and opened it in a text editor you will either need to modify a line of code that defines the amount of memory allocated to the PHP or add that line in.

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

If you see the above line in the wp-config.php files, make sure that it is set to at least “256M”.

If you don’t see the line in this file, you’ll need to add it before the line that reads “/* That’s all, stop editing! Happy publishing. */

WordPress wp-config.php file

Make sure to save the file and that is it! Your WordPress install will now be much happier that it has more memory at its disposal.

NOTE: In some instances, this solution may not work for and this is usually because your hosting provider has disabled this feature. If this is the case, contact the support team at your hosting provider and ask them to increase your PHP memory limit.

Conclusion

Hopefully, this quick post solves your “Fatal Error: Allowed Memory Size Exhausted” issue and sends you on your way to build an awesome site. Definitely check out our blog for more articles just like this one designed to help you build the best sites possible.

1 Comment

  1. Comment *

    Es la primera página que deseo crear y al revisar los pasos indicados, ya esta con 768M en el límite de PHP, entonces a qué se debe que no puedo editar?

Submit a Comment

Explore more from Divi Engine

Divi Form Builder

Divi Form Builder

From simple contact forms to complex frontend post or product creation, Divi Form Builder has you covered.

Divi Form Builder
Find out more
Divi Machine

Divi Machine

Build complex websites that displays dynamic fields you can filter, search and so much more with the Divi Builder.

Divi Machine
Find out more
Divi BodyCommerce

Divi BodyCommerce

A versatile toolkit for developers using Divi and WooCommerce together, designed to boost your e-commerce site and achieve greater conversion rates.

Divi BodyCommerce
Find out more
Divi Loop Extender

Divi Loop Extender

Unlock the Full Power of Divi 5 Loop Builder Add advanced sorting, filtering, and relationship logic right inside the Visual Builder.

Divi Loop Extender
Find out more
Divi Membership

Divi Membership

Monetize your Divi websites by transforming them into membership sites with seamless subscription management, user-friendly interfaces, and customizable membership tiers.

Divi Membership
Find out more
Divi Machine Accounts

Divi Machine Accounts

Build an account area for your customers to edit their details, access wishlist, submitted posts and more. *Note: Requires Divi Machine installed and active

Divi Machine Accounts
Find out more
Divi Ajax Filter

Divi Ajax Filter

Filter WooCommerce, Posts & Custom Posts without reloading the page.

Divi Ajax Filter
Find out more
Divi Mobile

Divi Mobile

Divi Mobile helps you create beautiful looking mobile menus without having to code.

Divi Mobile
Find out more
Divi Nitro

Divi Nitro

Give your Divi website that extra boost of speed with our Divi Nitro plugin to enhance your customer's experience.

Divi Nitro
Find out more
Divi Protect

Divi Protect

Password protect the content of your Divi website with our Divi Protect plugin. Keep unwanted eyes out!

Divi Protect
Find out more
Divi Mega Menu

Divi Mega Menu

Create stunning, responsive, and content-rich mega menus using the Divi Builder you already know. No coding required.

Divi Mega Menu
Find out more