Fix - WordPress Memory Exhausted Error - Increase PHP Memory
Fix - WordPress Memory Exhausted Error - Increase PHP Memory
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.
Having said that, let’s see how to easily increase PHP memory limit in WordPress to avoid
memory exhausted error.
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.’
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.
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.
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
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
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
Reply
Simeon Adedokun
Dec 11, 2021 at 11:24 pm
Reply
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
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
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
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.”
Reply
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
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
Richard Lamsdale
Dec 10, 2020 at 11:30 am
Reply
Reply
Malou
Nov 4, 2020 at 2:57 am
Reply
WPBeginner Support ADMIN
You’re welcome
Reply
Segun
Nov 3, 2020 at 9:52 am
Reply
You’re welcome
Reply
Reply
Rick Richi
Oct 24, 2020 at 9:23 pm
Reply
You can certainly try to see if that fixes the error for you.
Reply
Haris imran
Oct 24, 2020 at 11:46 am
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
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….
Reply
Reply
Faisal Arafin
Sep 20, 2020 at 6:24 am
Reply
WPBeginner Support ADMIN
Reply
Laura
Aug 27, 2020 at 11:28 am
Reply
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
Reply
Dileepa K
Aug 8, 2020 at 3:13 pm
Very Helpful
Reply
You’re welcome
Reply
Gunvant Nakum
Aug 1, 2020 at 2:54 am
Reply
Reply
Sumit Gupta
Jul 24, 2020 at 1:33 pm
Reply
If our recommendations are not working, you would want to reach out to your hosting
provider and they should be able to assist
Reply
Reply
Reply
Luuk
Jul 18, 2020 at 5:31 am
Reply
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
Reply
Manthan Admane
Jul 10, 2020 at 7:31 pm
Solved my issue
Reply
Reply
Mevlut Demiroz
Jul 4, 2020 at 4:04 pm
Reply
WPBeginner Support ADMIN
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
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
Reply
You’re welcome
Reply
Mathilda
Jun 4, 2020 at 3:25 am
thanks so much!
Reply
WPBeginner Support ADMIN
You’re welcome
Reply
Sone Eric
May 20, 2020 at 9:20 am
Reply
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
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
Reply
WPBeginner Support ADMIN
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
Mayur Agarwal
Apr 30, 2020 at 5:16 am
Reply
Reply
Reply
Hey. My website is doing well. but whenever i tried to edit any post my server memory
and I/O exhaust
Reply
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
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
Reply
Reply
Rishikesh Prasad
Apr 1, 2020 at 10:35 pm
Reply
You’re welcome
Reply
Michael Ogbonnaya
Mar 30, 2020 at 9:01 pm
Reply
WPBeginner Support ADMIN
Reply
Abdulbasit Rubeiyya
Mar 12, 2020 at 6:40 am
Reply
manoush
Mar 2, 2020 at 1:11 pm
solved my problem.
Reply
Reply
Adam
Feb 27, 2020 at 5:50 pm
Thanks for this article, we’ve been having this problem too.
Which setting takes priority?
Reply
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
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
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
please reply
Reply
Reply
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
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
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
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.
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
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
Starting a
WordPress
Blog SEO
WordPress
WordPress
Performance Errors
WordPress
Building an
Search WPBeginner…
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
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
Follow us:
About Us OptinMonster
Contact Us WPForms
RafflePress
PushEngage
TrustPulse
AffiliateWP
WP Simple Pay
Copyright © 2009 - 2022 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.