0% found this document useful (0 votes)
163 views44 pages

Fix - WordPress Memory Exhausted Error - Increase PHP Memory

Uploaded by

Pavan N
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
163 views44 pages

Fix - WordPress Memory Exhausted Error - Increase PHP Memory

Uploaded by

Pavan N
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

Beginner's Guide for WordPress

Start your WordPress Blog in minutes

WPBEGINNER BLOG TUTORIALS FIX: WORDPRESS M …

Fix: WordPress Memory Exhausted Error – Increase


PHP Memory
Last updated on January 2nd, 2020 by Editorial Staff | Reader Disclosure

Are you seeing an allowed memory size exhausted error in WordPress? This is one of the most
common WordPress errors, and you can easily fix it by increasing the php memory limit in
WordPress. In this article, we will show you how to fix WordPress memory exhausted error by
increasing PHP memory.
What is WordPress Memory Exhausted Error?

WordPress is written in PHP, which is a server-side programming language. Every website needs
a WordPress hosting server for it to function properly.

Web servers are just like any other computer. They need memory to efficiently run multiple
applications at the same time. Server administrators allocate specific memory size to different
applications including PHP.

When your WordPress code requires more memory than the default allocated memory, you get
to see this error.

1 Fatal error: Allowed memory size of 33554432 bytes exhausted


(tried to allocate 2348617 bytes) in /home4/xxx/public_html/wp-
includes/plugin.php on line xxx
By default, WordPress automatically tries to increase PHP memory limit if it is less than 64MB.
However, 64MB is often not high enough.

Having said that, let’s see how to easily increase PHP memory limit in WordPress to avoid
memory exhausted error.

Increase PHP Memory Limit in WordPress

First you need to edit the wp-config.php file on your WordPress site. It is located in your
WordPress site’s root folder, and you will need to use an FTP client or file manager in your web
hosting control panel.

Next, you need to paste this code in wp-config.php file just before the line that says ‘That’s all,
stop editing! Happy blogging.’

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

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

Once you are done, you need to save your changes and upload your wp-config.php file back to
your server.

You can now visit your WordPress site and memory exhausted error should disappear now.

If you are new to WordPress, then take a look at our beginners guide on how to copy and paste
code from the web.
We also have a step by step guide on how to find and edit wp-config.php file.

Note: If this solution does not work for you, then this means your web hosting service provider
does not allow WordPress to increase PHP memory limit. You will need to ask your web hosting
provider to increase your PHP memory limit manually.

That’s all we hope this article helped you solve WordPress memory exhausted error by
increasing PHP memory limit. You may also want to see our step-by-step beginner’s guide to
troubleshooting WordPress errors.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video
tutorials. You can also find us on Twitter and Facebook.

Popular on WPBeginner Right Now!

How to Fix the Error Establishing a Database Connection in WordPress

How to Install Google Analytics in WordPress for Beginners

How to Start a Podcast (and Make it Successful) in 2022


Revealed: Why Building an Email List is so Important Today (6 Reasons)
Revealed:
Why
Building an
Email List
is so
Important
Today (6
Reasons)

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may
earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted
by over 1.3 million readers worldwide.

The Ultimate
WordPress Toolkit
Get FREE access to our toolkit – a collection of WordPress related
products and resources that every professional should have!

Download Now

429 Comments Leave a Reply

Daniel
Jan 18, 2022 at 7:31 pm

The changes are not having effects. We are still with 40MB and the site does not accept
the changes. What should I do?

Reply

WPBeginner Support ADMIN

Jan 19, 2022 at 10:19 am

As we state at the end of the article, if our recommendations do not work, please
reach out to your hosting provider as they may have set a limit that would override
what you as a user can set.

Reply

Liviu
Jan 14, 2022 at 6:56 am

Really worked.

I had white screen when I wanted to create a new post on PC browser. But worked on my
phone.

Thanks

Reply

WPBeginner Support ADMIN

Jan 14, 2022 at 8:49 am


You’re welcome

Reply

Simeon Adedokun
Dec 11, 2021 at 11:24 pm

Thank you so much for this! It’s really helped me.

Reply

WPBeginner Support ADMIN

Dec 13, 2021 at 1:31 pm

Glad our guide could help

Reply
John Harries
Jul 20, 2021 at 2:42 am

Thank you for providing a straight forward solution to an error which occurred when I
tried to update the php version from 7.1 to 7.4

Reply

Mart
May 17, 2021 at 6:53 pm

Fantastic, thank you soooo much for this, simple straight talk.. excellent.. first problem
solved … now got to learn more

Reply

WPBeginner Support ADMIN

May 18, 2021 at 11:01 am

Glad our guide was able to help

Reply

Julian
May 9, 2021 at 3:13 am

I had to change mine to much higher and hope it won’t cause an issue? Changed to
1024M!

Reply

WPBeginner Support ADMIN

May 10, 2021 at 11:51 am

It can mean the site can take longer to notice issues if some arise but shouldn’t cause
a major issue in general.

Reply

Mujahid Siyal
Apr 29, 2021 at 1:39 am

I added the code problem is gone but a text “WP_MEMORY_LIMIT” has appeared in the
top corner of logo. So what should I do about that?

Reply

WPBeginner Support ADMIN

Apr 29, 2021 at 10:00 am

You would want to ensure you added the code snippet correctly as it is likely showing
that code thinking it is text.

Reply
David
Apr 26, 2021 at 12:20 am

“First you need to edit the wp-config.php file on your WordPress site. It is located in your
WordPress site’s root folder, and you will need to use an FTP client or file manager in your
web hosting control panel.”

Simple! What does that mean? It is gobbledegook to me.

Reply

WPBeginner Support ADMIN

Apr 26, 2021 at 1:12 pm

For using an FTP client we would recommend taking a look at our article below for a
better understanding on the subject:

https://www.wpbeginner.com/showcase/6-best-ftp-clients-for-wordpress-users/

Reply

Anna yakub
Mar 13, 2021 at 1:30 am

This was super helpful for an issue I’ve battled with for a while now. Thanks so much

Reply
WPBeginner Support ADMIN

Mar 15, 2021 at 11:49 am

Glad our recommendations were helpful

Reply

Katerina
Feb 4, 2021 at 11:03 am

I’m new in WordPress and I’m trying to figure out, for a couple of days, why suddenly I get
an error 500 and can’t save my edits. This helped solve my problem. Thank you so much!

Reply

WPBeginner Support ADMIN

Feb 5, 2021 at 9:29 am

Glad our guide could help


Reply

Richard Lamsdale
Dec 10, 2020 at 11:30 am

Thanks for this – it fixed my problem.

Reply

WPBeginner Support ADMIN

Dec 11, 2020 at 9:16 am

Glad our guide was helpful

Reply

Malou
Nov 4, 2020 at 2:57 am

Helpful, Thank you so much

Reply
WPBeginner Support ADMIN

Nov 4, 2020 at 10:27 am

You’re welcome

Reply

Segun
Nov 3, 2020 at 9:52 am

This worked perfectly for me. Thanks

Reply

WPBeginner Support ADMIN

Nov 3, 2020 at 9:57 am

You’re welcome

Reply
Reply

Rick Richi
Oct 24, 2020 at 9:23 pm

can I increase the memory to 512?

Reply

WPBeginner Support ADMIN

Oct 26, 2020 at 11:30 am

You can certainly try to see if that fixes the error for you.

Reply

Haris imran
Oct 24, 2020 at 11:46 am

Thanks it helped me a lot

Reply

WPBeginner Support ADMIN

Oct 26, 2020 at 11:26 am

Glad our guide was helpful


Reply

Arpita Hunka
Sep 21, 2020 at 7:12 pm

This solution is not working for me, my website is hosted at AWS server and I have all the
access, I have tried to set memory_limit in php.ini, wp-config and .htaccess. but still
getting issue when accessing backend pages.

Reply

WPBeginner Support ADMIN

Sep 22, 2020 at 10:16 am

You would want to reach out to the support for your hosting for what other options
you have available with AWS

Reply

Anders
Sep 21, 2020 at 8:02 am
Thanks a lot….

A quick and easy fix!!

Reply

WPBeginner Support ADMIN

Sep 22, 2020 at 9:28 am

You’re welcome, glad our guide was helpful

Reply

Faisal Arafin
Sep 20, 2020 at 6:24 am

You just saved me from heart attack…..

Reply
WPBeginner Support ADMIN

Sep 21, 2020 at 2:54 pm

Glad our guide could help

Reply

Laura
Aug 27, 2020 at 11:28 am

Thaaaanks, you save my day!

Reply

WPBeginner Support ADMIN

Aug 28, 2020 at 11:14 am

You’re welcome

Reply
Reply

Benthe Kuijpers
Aug 14, 2020 at 6:28 am

Thanks so much! Was so worried when I had this fatal error, but this fix is just a piece of
cake!

Reply

WPBeginner Support ADMIN

Aug 14, 2020 at 10:15 am

Glad our guide was helpful

Reply

Dileepa K
Aug 8, 2020 at 3:13 pm

Thank you for this post…

Very Helpful

Reply

WPBeginner Support ADMIN

Aug 10, 2020 at 1:50 pm

You’re welcome

Reply

Gunvant Nakum
Aug 1, 2020 at 2:54 am

Thanks you so much for your help

Reply

WPBeginner Support ADMIN

Aug 3, 2020 at 1:42 pm


You’re welcome

Reply

Sumit Gupta
Jul 24, 2020 at 1:33 pm

This is not working for me.

Reply

WPBeginner Support ADMIN

Jul 27, 2020 at 11:33 am

If our recommendations are not working, you would want to reach out to your hosting
provider and they should be able to assist

Reply

Ademola Kayode Abdulai


Jul 24, 2020 at 9:20 am
this still works after few years,, Great thank you… works for me as well

Reply

WPBeginner Support ADMIN

Jul 24, 2020 at 12:59 pm

Glad our recommendation was helpful

Reply

Luuk
Jul 18, 2020 at 5:31 am

Great tip! Thank you very much!

Reply

WPBeginner Support ADMIN

Jul 22, 2020 at 1:32 pm

You’re welcome
Reply

Mehedi Mahmood
Jul 14, 2020 at 10:56 am

Thank you so so much! can’t really explain how helpful this was

Reply

WPBeginner Support ADMIN

Jul 15, 2020 at 10:24 am

Glad our guide was helpful

Reply

Manthan Admane
Jul 10, 2020 at 7:31 pm

Thank you so much.

Solved my issue

Reply

WPBeginner Support ADMIN

Jul 13, 2020 at 11:33 am

Glad our guide was helpful

Reply

Mevlut Demiroz
Jul 4, 2020 at 4:04 pm

Very thanks, fixed

Reply
WPBeginner Support ADMIN

Jul 7, 2020 at 12:40 pm

Glad our guide was helpful

Reply

Ivan
Jul 4, 2020 at 7:33 am

Hi, I had the memory exhausted message and I increased the wp memory limit to 12mb
and it worked. Then a few days later I had the same error, so I had to increase the wp
memory limit to 256mb and the message kept showing. I am currently on 1024mb, which
seems excessive for a small website of 4 pages and a blog post of 15,000 words. Any
suggestions how to resolve the issue or what might be causing it?

Reply

WPBeginner Support ADMIN

Jul 7, 2020 at 11:53 am

You would want to reach out to your hosting provider and they can normally assist in
finding the root of the issue for your specific site.
Reply

player
Jun 23, 2020 at 3:35 pm

thank you so much.

Reply

WPBeginner Support ADMIN

Jun 24, 2020 at 8:46 am

You’re welcome

Reply

Mathilda
Jun 4, 2020 at 3:25 am

thanks so much!

Reply
WPBeginner Support ADMIN

Jun 4, 2020 at 8:46 am

You’re welcome

Reply

Sone Eric
May 20, 2020 at 9:20 am

Thank you very much. You solved my problem.

Reply

WPBeginner Support ADMIN

May 21, 2020 at 8:35 am

Glad our article was able to assist

Reply
Gk Guru
May 13, 2020 at 6:25 am

My website has been hacked. Which is showing the homepage blank. In which the script
has been injected, as well as the entire WordPress files. Database file is also affected.

Please suggest any solution for this. What do i have to do next steps.

Reply

WPBeginner Support ADMIN

May 13, 2020 at 9:19 am

For fixing a hacked site, you would want to follow our guide below:

https://www.wpbeginner.com/beginners-guide/beginners-step-step-guide-fixing-
hacked-wordpress-site/

Reply

Thanuja Dharshana
May 7, 2020 at 2:52 am

wow its working… thanks word press …..!

Reply
WPBeginner Support ADMIN

May 8, 2020 at 9:52 am

Glad our troubleshooting guide could help

Reply

Iheb Mejri
May 3, 2020 at 2:23 pm

Ran into this exact constraint today, thank you for the concise and helpful article

Reply

WPBeginner Support ADMIN

May 5, 2020 at 10:23 am

You’re welcome, glad our guide could be helpful


Reply

Mayur Agarwal
Apr 30, 2020 at 5:16 am

wow.. this works in 2020 as well. Thanks a lot.

Reply

WPBeginner Support ADMIN

Apr 30, 2020 at 10:30 am

Correct, you’re welcome glad the guide could help

Reply
Reply

Jayant singh rawat


Apr 13, 2020 at 3:41 am

Hey. My website is doing well. but whenever i tried to edit any post my server memory
and I/O exhaust

Reply

WPBeginner Support ADMIN

Apr 14, 2020 at 12:37 pm

If you reach out to your hosting provider they should be able to help prevent this error
going forward

Reply

Ricardo M
Apr 3, 2020 at 1:54 pm

It worked!! thanks a lot, I should say that if you are using control panel you can access
and edit the file config,php within the same platform no need to dowload the file for
editing.

Reply

WPBeginner Support ADMIN


Apr 6, 2020 at 8:50 am

It depends on the hosting provider as not all have a file manager that they offer but
thanks for sharing

Reply

Sudev Barar
Apr 2, 2020 at 9:42 pm

Thanks. That was great tip that saved me.

Reply

WPBeginner Support ADMIN

Apr 3, 2020 at 9:03 am

You’re welcome, glad our guide could be helpful

Reply
Rishikesh Prasad
Apr 1, 2020 at 10:35 pm

Great, Thank you very much…

Reply

WPBeginner Support ADMIN

Apr 2, 2020 at 8:36 am

You’re welcome

Reply

Michael Ogbonnaya
Mar 30, 2020 at 9:01 pm

Thank you so much. This solved my problem.

Reply
WPBeginner Support ADMIN

Mar 31, 2020 at 10:17 am

You’re welcome, glad we could be helpful

Reply

Abdulbasit Rubeiyya
Mar 12, 2020 at 6:40 am

Thanks Alot, worked for me

Reply

WPBeginner Support ADMIN

Mar 12, 2020 at 8:46 am

You’re welcome, glad our guide worked


Reply

manoush
Mar 2, 2020 at 1:11 pm

thanks for information.

solved my problem.

Reply

WPBeginner Support ADMIN

Mar 3, 2020 at 10:11 am

You’re welcome, glad our guide could help

Reply

Adam
Feb 27, 2020 at 5:50 pm

Thanks for this article, we’ve been having this problem too.
Which setting takes priority?

In WHM (MultiPHP INI Editor), memory_limit is set to 32M.

In wp-config.php WP_MEMORY_LIMIT is set to 96M.

Reply

WPBeginner Support ADMIN

Feb 28, 2020 at 10:06 am

Normally wp-config but it would depend on your specific hosting and the settings.

Reply

Edgar
Jan 28, 2020 at 6:13 pm

A lot of thanks!

Reply

WPBeginner Support ADMIN

Jan 29, 2020 at 8:41 am

You’re welcome
Reply

arjun
Jan 27, 2020 at 7:44 am

but what exactly is this wordpress memory limit, like how much amount of RAM should
wp use on the server? can anyone please share about what this thing is?

thanks

Reply

WPBeginner Support ADMIN

Jan 27, 2020 at 11:43 am

The memory limit tells WordPress how large requests/files can be for individual tasks,
this is not for your site’s RAM and your RAM usage would be determined by what is on
your site.

Reply

fazan
Jan 16, 2020 at 2:25 am

thanks you wpbeginner

you solve my problom

but i have vps , can i increes more memory limit

please reply

Reply
Reply

WPBeginner Support ADMIN

Jan 16, 2020 at 8:33 am

You would need to reach out to your hosting provider for what is available to you

Reply

Ionut Pomirleanu
Jan 14, 2020 at 3:36 am

Thanks wpbeginner

Reply

WPBeginner Support ADMIN

Jan 14, 2020 at 8:59 am

You’re welcome

Reply
Ananth Gurunathan
Jan 9, 2020 at 1:39 am

Thanks for the post. It really worked out for me for my problem which was a big head
ache for last 5days. Thanks a lot.

Reply

WPBeginner Support ADMIN

Jan 9, 2020 at 10:19 am

You’re welcome, glad we could help solve the issue

Reply

Sandeep
Aug 25, 2019 at 11:11 am

Thanks wpbeginner for this article, i have solved my problem with the help of this article

Reply

WPBeginner Support ADMIN


Aug 26, 2019 at 10:53 am

You’re welcome, glad our guide could be helpful

Reply

«
1

4
5
6

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated
according to our comment policy, and your email address will NOT be published. Please Do NOT
use keywords in the name field. Let's have a personal and meaningful conversation.

Your Real Name

Email Address

Save my name, email, and website in this browser for the next time I comment.
Notify me of followup comments via e-mail. You can also
Don't subscribe
subscribe without commenting.

Submit Comment

Over 1,320,000+ Readers


Get fresh content from WPBeginner

Featured WordPress Plugin

SeedProd
Create beautiful custom landing pages - Drag & drop builder.

Learn More
The Ultimate
WordPress Toolkit
Get FREE access to our toolkit – a collection of WordPress related
products and resources that every professional should have!

Download Now

I need help with …

Starting a
WordPress

Blog SEO

WordPress
WordPress

Performance Errors

WordPress
Building an

Security Online Store

Search WPBeginner…

Useful WordPress Guides

24 Must Have WordPress Plugins for How to Choose the Best WordPress 5 Best Contact Form
Business Websites Hosting for Your Website WordPress Compar

7 Best Email Marketing Services for Small How to Choose the Best Blogging Which is the Best W
Business (2022) Platform (Comparison) Plugin? (Compariso
5 Best Drag and Drop WordPress Page How to Choose the Best Domain Registrar 5 Best WordPress M
Builders Compared (Compared) (Compared)

30 “Proven” Ways to Make Money Online How to Register a Domain Name (+ tip to 7 Best WordPress B
Blogging with WordPress get it for FREE) Compared (Pros an

How Much Does It Really Cost to Build a How to Create a Free Business Email 5 Best WordPress E
WordPress Website? Address in 5 Minutes (Step by Step) Compared

Free Recording: WordPress Workshop for How to Install WordPress - Complete 12 Best Live Chat S
Beginners WordPress Installation Tutorial Business Compared

Deals & Coupons (view all)

StartBooking Coupon
Get 20% OFF on StartBooking online scheduling software.

ConvertKit Coupon
Get a 14-day no risk FREE trial with this powerful email marketing software.

FEATURED IN

About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by
Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress

resources that allows WordPress beginners to improve their site(s).

Join our team: We are Hiring!

Follow us:

SITE LINKS OUR SITES

About Us OptinMonster

Contact Us WPForms

FTC Disclosure MonsterInsights

Privacy Policy WP Mail SMTP

Terms of Service All in One SEO

Free Blog Setup Smash Balloon

Free Business Tools SeedProd

Growth Fund Nameboy

RafflePress

PushEngage

TrustPulse

AffiliateWP

Easy Digital Downloads

WP Simple Pay
Copyright © 2009 - 2022 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress Security by Sucuri.

You might also like