• Categories
    • Tutorials
    • Beginners Guide
    • WordPress News
    • WordPress Security
    • Best WordPress Plugins
    • WordPress Themes
    • Product Reviews
    • WP Tips & Tricks
  • Guides
    • Start a Blog
    • Make a Website
    • WordPress Hosting
  • WordPress Hosting
    • A2 Hosting
    • HostGator
    • Bluehost
    • Cloudways
  • Managed Hosting
    • WPEngine
    • Rocket.net
    • WPX
    • Kinsta
  • Coupons
    • WPEngine
    • Flywheel
    • Cloudways
    • A2 Hosting
    • WPX Hosting
WordPress Tutorials

How To Fix ‘Fatal Error Allowed Memory Size Exhausted’ WordPress Error

Last Updated on: February 6, 2021 Editorial Staff 4 Comments

How To Fix ‘Fatal Error Allowed Memory Size Exhausted’ WordPress Error

The “allowed memory size exhausted” error is one of the most common issues most WordPress users often encounter, especially when using shared hosting plans.

If you’ve been getting an error that says “Fatal error: Allowed memory size of x bytes exhausted”, that means either your server is limiting the amount of memory used by your website or a plugin is consuming too much server memory.

You can fix this error using two different methods. In this post, we’ll show you how to fix this error within a few minutes and get your website up and running.

What Causes The “Fatal Error Allowed Memory Size Exhausted” Error?

As you may know, WordPress uses PHP code and scripts for most of its functions. PHP is a server-side programming language that requires server resources to execute scripts and actions. This means your WordPress system and all of the plugins that you install on your website consume server memory.

The “allowed memory size exhausted” error occurs when WordPress or one of your plugins is taking up too much server memory. When the server exhausts its allocated memory for your website, it gives you the “allowed memory size exhausted” error.

This usually happens when hosting a high-traffic and big websites using small shared hosting servers, which allocate very little amounts of PHP memory per each hosting plan.

To fix the error, you have to manually increase the default PHP memory limit set for your server.

What Is PHP Memory Limit?

The PHP memory limit is the amount of memory that your server allocates for running PHP code and scripts used by WordPress and plugins. Different web hosting providers set different amounts of memory for each of their hosting plans.

For example, some web hosting providers offer 256MB of memory per hosting account. That’s more than enough to host a WordPress website with regular traffic. The memory exhausted errors only occur when your web host allocated lower amounts of memory for each website.

Method 1: Increase PHP Memory Limit

To increase the PHP memory limit, you need to manually set a new memory limit for your server. This involves editing the wp-config.php file located in the server.

You can use two methods to access the WordPress files in your server. You can either use the File Manager in CPanel or use an FTP client app. For the demonstration, we’ll show you how to do it using the File Manager.

cpanel-file-manager

Step 1: Login to your CPanel by typing /cpanel at the end of your domain name (eg: yourwebsite.com/cpanel) use the login details you received from your web host in the welcome email to login to CPanel.

Step 2: Open the File Manager and locate the Public.html folder

Fatal Error Allowed Memory Size Exhausted error - 1

Step 3: Find the wp-config.php file then right-click and choose Edit.

Fatal Error Allowed Memory Size Exhausted error - 2

Step 4: Search for the line that says “That’s all, stop editing! Happy blogging” and paste the following code right above it.

define( ‘WP_MEMORY_LIMIT’, ‘256M’ );

This sets your default PHP memory limit to 256MB.

Step 5: Click Save to save the changes. Go back to your website and reload to see if it fixes the error.

Note: Always make a backup copy of the files before editing them.

Method 2: Disable And Reactivate Plugins

Increasing the PHP memory limit usually fixes the memory exhausted error. If not, one of the plugins installed on your website might be causing the error.

You can check to see which plugin is causing the issue by disabling all of the plugins and then reactivating them one by one to find the culprit.

Since you can’t access your WordPress dashboard, you need to disable the plugins from the server.

To do this, you need to login to your server once again.

Step 1: Follow the steps in the first method to login to your server.

Step 2: Open the wp-content folder and locate the plugins folder.

cpanel-rename-plugins-1

Step 2: Rename the plugins folder to “plugins-bad”. Don’t worry, this won’t delete any of the installed plugins.

cpanel-rename-plugins-2

Step 2: Create a new empty folder and name it plugins.

This will disable all of the plugins installed on your website. Now, reload your website and see if it fixes the error. If your website is functioning as normal again, then the error was likely caused by a plugin.

Now, go back to the wp-content folder. Delete the empty folder that you’ve created earlier and rename the “plugins-bad” folder back to “plugins”. This will restore your old plugins without activating them.

You can now login to your WordPress dashboard and reactivate the plugins to see which causes the error.

Still Having The Issue?

If you’re still getting the same error after following the above solutions, then it’s probably caused by a server issue and you should seek professional help.

Contact your web host’s technical support team and explain the situation. If you keep getting the same error, consider upgrading your current hosting plan to a bigger plan. Or use a managed WordPress hosting account, which includes more optimized features for running WordPress websites.

+ Share
Disclosure

Editorial Staff

Related Posts

Back to all articles
  • Dealing with WordPress RSS Feed Errors: How to Identify and Fix Them

    Dealing with WordPress RSS Feed Errors: How to Identify and Fix Them

  • What is WordPress? A Beginner's Guide!

    What is WordPress? What Can it do & Is it Right for You? A Beginner’s Guide

  • How to Set Up WordPress Two-Factor Authentication: WP 2FA Review

    How to Set Up WordPress Two-Factor Authentication: WP 2FA Review

Coupons

View more deals
  • MemberDash Membership Plugin for WordPress
    10% OFF

    MemberDash Coupon

    Running a membership site on WordPress doesn’t have to mean jug
    Get This Deal
  • WordPress.com Coupon Discount Code
    30% OFF

    WordPress.com Coupon

    WordPress.com is a fully hosted website builder that lets you cre
    Get This Deal
  • WP 2FA Coupon
    20% OFF

    WP 2FA Coupon

    Security should be at the forefront of all site owner’s min
    Get This Deal
4 Comments Leave a Reply
  1. Naufal says

    June 2, 2021 at 10:55 am

    Good article

    Reply
    • Dev Sharma says

      June 17, 2021 at 11:47 am

      Thanks Naufal.

      Reply
  2. Tiago says

    August 31, 2022 at 4:33 pm

    Worked on Cpanel WHM environment. Thank you very much.

    Reply
  3. swain says

    July 3, 2023 at 6:35 am

    It happened after installing Woocommerce plugin, then I just deactivated it. Now I have to use the WooCommerce plugin for products online selling. What should I do?

    Reply

Leave a Reply Cancel reply

Full Disclosure This post may contain affiliate links, meaning that if you click on one of the links and purchase an item, we may receive a commission (at no additional cost to you). All opinions are our own and we do not accept payments for positive reviews.

Our Newsletter

Get awesome content delivered straight to your inbox.

Thank you!

You have successfully joined our subscriber list.

.

THE BEST OF WPKUBE

Some of the best content we have published so far.

BEGINNER GUIDES & REVIEWS

110 Best WordPress Hosting Options Tested for 2025
28 Best Managed WordPress Hosting Providers for 2025 Compared
38 Best Cheap WordPress Hosting Providers in 2025 (From $1.99)
46 Best WordPress LMS Plugins – Detailed Comparison & Review for 2024
55 Best WooCommerce Hosting Providers Compared in 2025 (All Budgets)
66 Best WordPress Landing Page Plugins Compared + Recommendations (2024)
79 Best List Building Plugins for WordPress In 2024
8How to Fix the 500 Internal Server Error on Your WordPress Website
9Beaver Builder Review: Honest Thoughts + Pros and Cons (2025)
10OptimizePress Review: Create Landing Pages with Ease
11How to Make a Website: Complete Beginner’s Guide
12Top 22 Best Free Stock Photo Resources For Your Site
13How to Start a Blog in 2022 (Step by Step Guide)
14How To Fix ‘503 Service Unavailable’ WordPress Error
1511 Best Contact Form Plugins for WordPress in 2025
16How to Add a Custom Logo to Your WordPress Site
17How to Fix Error Establishing a Database Connection in WordPress

WPEngine: 50% OFF Deal

Save 50% on one of the best managed hosting providers.

Get this Deal
Featured In Forbes Huffpost Entrepreneur SEJ

About WPKube

WPKube is an online WordPress resource which focuses on WordPress tutorials, How-to’s, guides, plugins, news, and more. We aim to provide the most comprehensive beginner’s guides to anything about WordPress — from installing plugins, themes, automated installs and setups, to creating and setting up pages for your website.

We have over 500+ tutorials, guides, product reviews, tips, and tricks about WordPress. Founded by Devesh Sharma, the main goal of this site is to provide useful information on anything and everything WordPress.

Twitter Facebook

Useful Links

  • Behind the Scenes
  • Beginner Guides
  • WordPress Hosting
  • WooCommerce Themes
  • MeridianThemes
  • Exclusive WordPress Deals
View All Guides »

Reviews

  • WPEngine 33% OFF
  • WPX Hosting
  • Flywheel 33% OFF
  • Divi Theme 20% OFF
  • Systeme.io
  • Elegant Themes
Reviews »

Deals

  • InMotion Hosting
  • LifterLMS Coupon
  • LiquidWeb Coupon
  • WPEngine Coupon
  • A2 Hosting
  • Solid Affiliate
More Deals »
© Copyright 2023 WPKube ® All Rights Reserved.
  • Contact
  • Site Terms
  • Disclosure
  • Privacy Policy