{"id":30501,"date":"2021-04-21T07:00:00","date_gmt":"2021-04-21T14:00:00","guid":{"rendered":"https:\/\/dhblog.dream.press\/blog\/?p=30501"},"modified":"2026-08-27T14:37:55","modified_gmt":"2026-08-27T21:37:55","slug":"how-to-fix-wordpress-memory-limit-error","status":"publish","type":"post","link":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-memory-limit-error\/","title":{"rendered":"How To Fix the WordPress Memory Exhausted Error by Increasing Your Site\u2019s PHP Memory Limit"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Your site goes blank, and in place of your homepage WordPress prints an alarming message: \u201cAllowed memory size exhausted.\u201d Don\u2019t panic \u2014 your website isn\u2019t broken. <a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/214202188-PHP-overview\">PHP<\/a>, the language WordPress is built on, has simply hit the memory ceiling your server allows it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In a nutshell, this error means your server isn\u2019t allocating enough resources <a href=\"https:\/\/www.dreamhost.com\/blog\/fix-wordpress-fatal-error-maximum-execution-time-exceeded\/\">for WordPress to execute the PHP scripts<\/a> it needs to function properly. This issue can negatively affect your site\u2019s functionality, but there are several ways you can fix and even prevent it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The fix: increase your PHP memory limit.<\/strong> Connect to your site via SFTP, open the <em>wp-config.php<\/em> file in your WordPress root folder, and add <code>define( 'WP_MEMORY_LIMIT', '256M' );<\/code> on its own line above <code>\/* That's all, stop editing! Happy publishing. *\/<\/code>. If the error persists, your host\u2019s server-level memory_limit is the cap \u2014 ask your host to raise it. Below, we\u2019ll walk through every method step by step, starting with how to recognize the error.<\/p>\n\n\n\n<h2 id=\"h-why-you-re-seeing-a-wordpress-memory-limit-error-on-your-site\" class=\"wp-block-heading\"><span style=\"font-weight: bold;\">Why you\u2019re seeing a WordPress memory limit error on your site<\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">As we mentioned earlier, the PHP memory limit error means you\u2019re not allocating enough resources for your WordPress installation to function correctly. The problem usually presents itself with a message such as:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2348617 bytes)<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" data-src=\"https:\/\/lh3.googleusercontent.com\/kxdR1fnI8Es2pw5xdkMpnDKamLDXHVakM691YqX5b7wr16_vo7oypdWWMmA22v7UB9KyLCBN5Mpxt54e-G-QhvoBREvsTlVc5_lMtbfcvgxt126iraO3bQM5Ot9kqOzS9UnIiuXi\" alt=\"The memory exhausted PHP fatal error.\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">That message is more useful than it looks. The byte figure is your current memory limit \u2014 divide it by 1,048,576 to convert to megabytes, so \u201c134217728 bytes\u201d means a 128 MB limit. The message also names the file that ran out of memory, and its path usually points straight at the plugin or theme responsible. One warning: if the same plugin keeps exhausting memory no matter how high you set the limit, raising it further just masks a memory leak. Update, replace, or remove the culprit instead.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Don\u2019t be scared by the word \u201cfatal,\u201d though. In PHP, a fatal error just means the one script that ran out of memory stopped running: your files and your database are untouched. You will need to make a small configuration change to keep it from happening again \u2014 specifically, raising your PHP memory limit.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Can\u2019t even reach your dashboard? That\u2019s common with this error: a memory-exhausted fatal error can take down <em>wp-admin<\/em> along with the rest of your site. The good news is that every file fix in this guide works over SFTP, no login required. And if a specific plugin caused the crash, you can disable it over SFTP too \u2014 open <em>wp-content\/plugins<\/em> and rename that plugin\u2019s folder to switch it off.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-what-actually-uses-up-your-php-memory\">What actually uses up your PHP memory<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The limit is just a ceiling; something on your site has to hit it. The usual suspects: heavy plugins (WooCommerce, for example, loads product, customer, and payment logic on every request, and that work takes real memory), bloated multipurpose themes that ship dozens of features you never use, poorly coded plugins with memory leaks, two plugins conflicting with each other, and big one-off jobs like image regeneration or site backups. To find your culprit, start with the file path in the error message. If you host with DreamHost, the panel\u2019s AI-powered error log analysis can also read the raw log for you and suggest a fix. Raising the limit cures the symptom; a leaky plugin will keep crashing your site until you update, replace, or remove it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-wp-memory-limit-vs-the-server-s-php-memory-limit\">WP_MEMORY_LIMIT vs. the server\u2019s PHP memory_limit<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">By \u201cPHP memory limit,\u201d we mean the amount of server memory that\u2019s allocated to run PHP scripts \u2014 but there are actually two separate values in play, and knowing the difference explains why some fixes seem not to work.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>WP_MEMORY_LIMIT<\/strong> is WordPress\u2019 own setting, declared in <em>wp-config.php<\/em>. By default, <a href=\"https:\/\/developer.wordpress.org\/advanced-administration\/wordpress\/wp-config\/#increasing-memory-allocated-to-php\">WordPress sets it to 40 MB<\/a> for a single site and 64 MB for a multisite installation, and allows admin-area tasks up to 256 MB through a second constant, WP_MAX_MEMORY_LIMIT.<\/li>\n\n\n\n<li><strong>memory_limit<\/strong> is the server-level PHP setting, controlled through <em>php.ini<\/em> (on DreamHost, a <em>phprc<\/em> file). This one is the hard cap: whatever <em>wp-config.php<\/em> declares, WordPress can never use more memory than the server allows.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Here\u2019s why that matters: the fatal error above reports a server allowing 134217728 bytes (a 128 MB cap). Add <code>define( 'WP_MEMORY_LIMIT', '256M' );<\/code> on that server and WordPress still tops out at 128 MB, and the error keeps printing the same number until the server-level value rises. When the wp-config.php edit below doesn\u2019t seem to change anything, the server cap is usually why \u2014 and that\u2019s what methods 2 through 4 are for.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-to-check-your-wordpress-memory-limit\">How to check your WordPress memory limit<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To check your WordPress memory limit, <a href=\"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-keeps-logging-out-error\/\">access your WordPress dashboard<\/a> and navigate to <em>Tools &gt; Site Health &gt; Info<\/em>. Next, expand the <em>Server<\/em> section and look for the <em>PHP memory limit<\/em> entry.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" data-src=\"https:\/\/lh4.googleusercontent.com\/A_ybxsfGKRaiomhg0kMLfp96oJ9yRBmFNBxK-FJI_KwopiXv6fRORGsT6rTyxIlCXV7Z2twx5z5w8GMsQvvz8tGotdPSfIAmLrNlbEl1LgdXz5imsi6jXvT0n_3iCcvkIuA4zQkB\" alt=\"A website with a high PHP memory size.\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Within the <em>Server<\/em> section, you can also check other information such as your <a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/215082337-What-versions-of-PHP-are-available-at-DreamHost-\">PHP version<\/a>&nbsp;and the <em>PHP time limit<\/em>. The latter variable, which is in seconds, defines how long PHP scripts have to execute before they time out.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For now, let\u2019s focus on the PHP memory limit. As you can see, the above example has quite a high limit, which means that the website is unlikely to run into a WordPress Memory Exhausted error.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If your site has a low memory limit (&lt;64 MB), it\u2019s in your best interests to increase it. There are several ways you can do so.<\/p>\n\n\n\n<div class=\"article-newsletter article-newsletter--gradient\">\n\n\n<h2>Get Content Delivered Straight to Your Inbox<\/h2><p>Subscribe now to receive all the latest updates, delivered directly to your inbox.<\/p><form class=\"nwsl-form\" id=\"newsletter_block_\" novalidate><div class=\"messages\"><\/div><div class=\"form-group\"><label for=\"input_newsletter_block_\"><input type=\"email\"name=\"email\"id=\"input_newsletter_block_\"placeholder=\"Enter your email address\"novalidatedisabled=\"disabled\"\/><\/label><button type=\"submit\"class=\"btn btn--brand\"disabled=\"disabled\"><span>Sign Me Up!<\/span><svg width=\"21\" height=\"14\" viewBox=\"0 0 21 14\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n<path d=\"M13.8523 0.42524L12.9323 1.34521C12.7095 1.56801 12.7132 1.9304 12.9404 2.14865L16.7241 5.7823H0.5625C0.251859 5.7823 0 6.03416 0 6.3448V7.6573C0 7.96794 0.251859 8.2198 0.5625 8.2198H16.7241L12.9405 11.8535C12.7132 12.0717 12.7095 12.4341 12.9323 12.6569L13.8523 13.5769C14.072 13.7965 14.4281 13.7965 14.6478 13.5769L20.8259 7.39879C21.0456 7.17913 21.0456 6.82298 20.8259 6.60327L14.6477 0.42524C14.4281 0.205584 14.0719 0.205584 13.8523 0.42524Z\" fill=\"white\"\/>\n<\/svg>\n<\/button><\/div><\/form><\/div>\n<h2 id=\"h-how-to-resolve-the-wordpress-memory-limit-error-2-methods\" class=\"wp-block-heading\"><span style=\"font-weight: bold;\">How to resolve the WordPress memory limit error (5 methods)<\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">As far as <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/common-wordpress-errors\/\">WordPress errors<\/a><\/span>&nbsp;go, this one has a clear-cut cause and solution. PHP is hitting its memory ceiling, so you need to raise it. In this section, we\u2019ll go over five methods, ordered from the safest do-it-yourself fix to the options your host handles for you \u2014 most of them free.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-1-increase-the-php-memory-allocated-to-your-website-manually\"><span style=\"font-weight: bold;\">1. Increase your WordPress memory limit manually (edit wp-config.php)<\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The classic fix is to declare a higher allowed memory size in your site\u2019s <a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/214693268-WordPress-wp-config-php-overview\"><em>wp-config.php<\/em><\/a> file. It\u2019s the safest of the file edits, and it\u2019s easy to do. All you need is a Secure File Transfer Protocol (SFTP) client <a href=\"https:\/\/filezilla-project.org\/\">such as FileZilla<\/a>&nbsp;that you can use to connect to your website.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One quick safety step first: back up your site, or at minimum download a copy of <em>wp-config.php<\/em> to your computer before you edit it. A single typo in this file can take your whole site offline, and a saved copy lets you roll back in seconds.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you <a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/115000675027-FTP-overview-and-credentials\">access your website via SFTP<\/a>, open the WordPress <em>root<\/em> folder and look for the <em>wp-config.php<\/em> file within it.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" data-src=\"https:\/\/lh6.googleusercontent.com\/p-rhXarESod5Qu3fbeIDeTGAiUnYdgM5A77w1mzGy0OWgHtW1hU6p7cpLVDK0BVTqXtOlAnsECe1dL5Bd1zW-4IydDa8L0ezEHxZbNGCG5LfLLHXo3WCGNF6FvlSmsPAWhplcA9Q\" alt=\"A WordPress wp-config.php file.\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Open that file using a text editor, and you should see something like this:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" data-src=\"https:\/\/lh4.googleusercontent.com\/JlcWPl1chJyeMMN7TJZismhB5_XXIbI0MtobeoEffgzkLEopzxgim9Kqk5Wqbh7fnDluyxCB7t3QPs12MvAfnIHPYh_y4HOwEKnLHqMSpLxvH9zKdXX34KeVL_vrqeAgqeJd_dm9\" alt=\"Editing a wp-config.php file.\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">To increase your PHP memory limit, you can simply add a single line of code anywhere after the &lt;?php<span style=\"font-style: italic;\">&nbsp;<\/span>tag and before the part of the file that reads \u201c\/* That&#8217;s all, stop editing! Happy publishing. *\/\u201d.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is the <a href=\"https:\/\/developer.wordpress.org\/advanced-administration\/wordpress\/wp-config\/#increasing-memory-allocated-to-php\">line of code<\/a>&nbsp;to add:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">define( 'WP_MEMORY_LIMIT', 'XXXM' );<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You\u2019ll need to replace the \u201cXXX\u201d<span style=\"font-style: italic;\">&nbsp;<\/span>variable within that line with the amount of memory you want to allocate to PHP. As we mentioned before, 64 MB is a sensible minimum to raise it to.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, you can also double the number to play it safe or increase it even further. For example, if you set a PHP memory limit of 256 MB, it would look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">define( 'WP_MEMORY_LIMIT', '256M' );<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once you\u2019re set on a number, save the changes to <em>wp-config.php<\/em> and close the editor. Now return to your WordPress dashboard, navigate to <em>Tools &gt; Site Health &gt; Info<\/em>, and expand the <em>Server<\/em> section to see if the changes went through.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the value didn\u2019t change, don\u2019t assume you typed something wrong. Sometimes you won\u2019t have the file permissions needed to make the edit stick \u2014 but far more often, the server\u2019s memory_limit is capping whatever <em>wp-config.php<\/em> declares. That\u2019s what the next methods are for.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-2-raise-the-server-s-php-memory-limit-php-ini-or-phprc\">2. Raise the server\u2019s PHP memory limit (php.ini or phprc)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To raise the server-level cap itself, edit the <em>memory_limit<\/em> directive in your PHP configuration file. Depending on your host, that\u2019s a <em>php.ini<\/em> file, a <em>.user.ini<\/em> file, or \u2014 at DreamHost \u2014 a <em>phprc<\/em> file. Open it over SFTP and add (or update) this line:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">memory_limit = 256M<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file, and the new limit applies to every PHP script on the site, WordPress included. Not every host exposes this file to customers, though. If you can\u2019t find or create one, jump to method 4 and ask your host\u2019s support team instead.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-how-to-increase-the-php-memory-limit-on-dreamhost\">How to increase the PHP memory limit on DreamHost<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">On DreamHost, you raise <em>memory_limit<\/em> by adding the line above to a <em>phprc<\/em> file, which overrides the default PHP settings for your domain. On DreamPress, use a <em>.user.ini<\/em> file instead. DreamHost\u2019s Knowledge Base article on <a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/214893937-Increase-the-PHP-memory-limit\">increasing the PHP memory limit<\/a> walks through creating the file via FTP or SSH and confirming the new value took effect.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-set-the-memory-limit-in-htaccess-only-on-some-hosts\">3. Set the memory limit in .htaccess (only on some hosts)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you can\u2019t edit a <em>php.ini<\/em>-style file, some servers let you set PHP values from your site\u2019s <a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/216456227--htaccess-overview\"><em>.htaccess<\/em><\/a> file instead, by adding:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">php_value memory_limit 256M<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Two caveats before you try it. First, this only works where the server runs PHP as an Apache module \u2014 many hosts don\u2019t, and on DreamHost specifically, <a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/360021599931-Changing-PHP-settings-in-an-htaccess-file\">PHP settings must go in a phprc file<\/a>, not <em>.htaccess<\/em>. Second, <em>.htaccess<\/em> governs how your site interacts with your server, so a typo here can cause <a href=\"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-error-sure-you-want-to-do-this\/\">site-wide errors<\/a>. Save a copy first, and if you see a 500 error after editing, remove the line.<\/p>\n\n<h3 class=\"wp-block-heading\" id=\"h-2-upgrade-your-website-s-hosting-plan\"><span style=\"font-weight: bold;\">4. Ask your web host to raise the limit<\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If file editing isn\u2019t your thing, or your edits keep getting overridden, ask your provider\u2019s support team to raise the PHP memory limit on their end. Asking costs nothing, with one honest caveat: support may confirm that your current plan\u2019s cap is as high as it goes \u2014 that\u2019s when method 5 comes in.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">DreamHost customers can open a live chat or a ticket with the in-house support team from the DreamHost panel, 24\/7. A short, specific request works best. For example: \u201cMy site at example.com is hitting \u2018Allowed memory size exhausted\u2019 errors. Can you raise the PHP memory_limit for my account, or tell me the maximum my current plan allows?\u201d<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-5-upgrade-your-website-s-hosting-plan\">5. Upgrade your website\u2019s hosting plan<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Typically, if you use a decent WordPress hosting provider, you won\u2019t need to worry about increasing your PHP memory limit. One caveat is that if you\u2019re <a href=\"https:\/\/www.dreamhost.com\/blog\/web-hosting-guide\/\">using shared hosting<\/a>, you\u2019ll likely face limited resources. So when your host confirms that your account or plan cap is the constraint \u2014 and only then \u2014 <a href=\"https:\/\/www.dreamhost.com\/blog\/web-hosting-guide\/\">upgrading your hosting package<\/a> is the fix that actually moves the ceiling.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before you pay, rule out the cheaper causes: a leaking or conflicting plugin will exhaust any limit eventually, and method 4 costs nothing to try. If the cap really is the constraint, the only limiting factor is your budget.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And if your current provider can\u2019t help at all, it might be time to <a href=\"https:\/\/www.dreamhost.com\/wordpress\/\">switch to a better WordPress host<\/a> whose plans are sized for the traffic your site actually gets.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-to-verify-your-new-memory-limit\">How to verify your new memory limit<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Whichever method you used, confirm it worked: head back to <em>Tools &gt; Site Health &gt; Info<\/em>, expand the <em>Server<\/em> section, and check the <em>PHP memory limit<\/em> value. If it shows your new number, you\u2019re done. If it doesn\u2019t, a host-enforced cap is overriding your edit \u2014 that\u2019s your cue to go back to method 4 and ask your host to raise it for you.<\/p>\n\n\n\n\n<div\n\tclass=\"article-cta-shared article-cta-small\"\n>\n    <div class=\"tr-img-wrap-outer jsLoading\"><img decoding=\"async\" class=\"js-img-lazy \" src=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/themes\/blog2018\/assets\/img\/lazy-loading-transparent.webp\" data-srcset=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/themes\/blog2018\/assets\/img\/article-small-ad-cta-placeholder.webp 1x, https:\/\/www.dreamhost.com\/blog\/wp-content\/themes\/blog2018\/assets\/img\/article-small-ad-cta-placeholder-x2.webp 2x\"  alt=\"Ad background image\" \/><\/div>\n\n\n\n\n  <div class=\"content-btm\">\n    <h2\n      class=\"h2--md\"\n    >\n      Skip the Stress\n    <\/h2>\n    <p\n      class=\"p--md\"\n    >\n      Avoid troubleshooting when you sign up for DreamPress. Our friendly WordPress experts are available 24\/7 to help solve website problems \u2014 big or small.\n    <\/p>\n\n            <a\n            href=\"https:\/\/www.dreamhost.com\/wordpress\/managed\/\"\n                        class=\"btn btn--white-outline btn--sm btn--round\"\n                                    target=\"_blank\"\n            rel=\"noopener noreferrer\"\n            >\n                            Check Out Plans                    <\/a>\n\n  <\/div>\n<\/div>\n<h2 id=\"h-faqs-about-the-wordpress-memory-limit\" class=\"wp-block-heading\"><strong>FAQs about the WordPress memory limit<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-what-is-the-wordpress-memory-limit\">What is the WordPress memory limit?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The WordPress memory limit (WP_MEMORY_LIMIT) is the maximum amount of server memory WordPress will try to use to run PHP scripts. By default, WordPress sets it to 40 MB for a single site and 64 MB for multisite. You can raise it in <em>wp-config.php<\/em>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-do-i-check-my-wordpress-memory-limit\">How do I check my WordPress memory limit?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In your WordPress dashboard, go to <em>Tools &gt; Site Health &gt; Info<\/em>, expand the <em>Server<\/em> section, and read the <em>PHP memory limit<\/em> entry. That figure is the limit your server currently allows PHP scripts to use.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-what-s-the-difference-between-wp-memory-limit-and-the-php-memory-limit\">What\u2019s the difference between WP_MEMORY_LIMIT and the PHP memory_limit?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">WP_MEMORY_LIMIT is WordPress\u2019 own setting, declared in <em>wp-config.php<\/em>. The PHP memory_limit is the server-level cap, set in <em>php.ini<\/em> (or a phprc file on DreamHost). The server cap always wins \u2014 WordPress can\u2019t use more memory than the server allows.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-what-does-allowed-memory-size-exhausted-mean\">What does \u201cAllowed memory size exhausted\u201d mean?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">It means a PHP script \u2014 usually a plugin or theme \u2014 needed more memory than your server allows. The byte figure in the message is your current limit: 134217728 bytes equals 128 MB. Raise the memory limit, or replace the plugin that keeps exhausting it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-do-i-increase-the-php-memory-limit-on-dreamhost\">How do I increase the PHP memory limit on DreamHost?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Add <code>memory_limit = 256M<\/code> to a phprc file (on DreamPress, use a <em>.user.ini<\/em> file instead). DreamHost\u2019s Knowledge Base article on <a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/214893937-Increase-the-PHP-memory-limit\">increasing the PHP memory limit<\/a> covers creating the file via FTP or SSH.<\/p>\n\n\n\n<h2 id=\"h-want-more-wordpress-error-tips\" class=\"wp-block-heading\"><strong>Want more WordPress error tips?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once you increase PHP memory on your WordPress website, we can help tackle <a href=\"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-image-upload-issues\/\">other issues<\/a>. We\u2019ve put together several tutorials to help you troubleshoot every error message:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/common-wordpress-errors\/\">How to Fix Common WordPress Errors<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/troubleshooting-wordpress-white-screen-death\/\">How to Troubleshoot the WordPress White Screen of Death (WSoD)<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/common-wordpress-errors\/\">How to Fix the 500 Internal Server Error in WordPress<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/how-to-fix-syntax-errors-wordpress\/\">How to Fix Syntax Errors in WordPress<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-not-sending-email\/\">How to Fix the WordPress Not Sending Email Issue<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/360021570592-Error-establishing-a-database-connection\">How to Fix the Error Establishing Database Connection in WordPress<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-404-error\/\">How to Fix WordPress Error 404 Not Found<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/how-to-fix-white-text-missing-buttons-wordpress\/\">How to Fix White Text and Missing Buttons in WordPress Visual Editor<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/wordpress-sidebar-below-content-error\/\">How to Fix the Sidebar Below Content Error in WordPress (In 3 Steps)<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/what-to-do-when-locked-out-wordpress\/\">What to Do When You\u2019re Locked Out of the WordPress Admin Area<\/a><\/span><\/li>\n\n\n\n<li><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-login-page-redirect-issue\/\">How to Fix the WordPress Login Page Refreshing and Redirecting Issue<\/a><\/span><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Want more information on WordPress site management? Check out our&nbsp;<span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/blog\/category\/wordpress\/\">WordPress Tutorials<\/a><\/span>, a collection of guides designed to help you navigate the WordPress dashboard like an expert.<\/p>\n\n\n\n<h2 id=\"h-increasing-php-memory-limit\" class=\"wp-block-heading\"><strong>Increasing the PHP memory limit<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Running into a <a href=\"https:\/\/www.dreamhost.com\/blog\/fix-wordpress-fatal-error-maximum-execution-time-exceeded\/\">PHP fatal error<\/a> can be worrying, but it\u2019s not necessarily a cause for concern. Learning how to increase your PHP memory limit is relatively simple if you don\u2019t mind using an SFTP client and adding a single line of code to one of WordPress\u2019 core files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The alternative is to ask your host to raise the server-level limit, and to upgrade only if they confirm your plan\u2019s cap is the constraint. A higher cap makes the error far less likely to come back, but it won\u2019t fix a leaking or poorly coded plugin \u2014 identify the culprit before paying for more resources.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you\u2019re ready to use a web host optimized for WordPress websites, check out our <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.dreamhost.com\/wordpress\/managed\/\">DreamPress plans<\/a><\/span>! We offer optimized WordPress setups, so you spend less time troubleshooting errors and more time working on your website.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Your site goes blank, and in place of your homepage WordPress prints an alarming message: \u201cAllowed memory size exhausted.\u201d Don\u2019t panic \u2014 your website isn\u2019t broken. PHP, the language WordPress is built on, has simply hit the memory ceiling your server allows it. In a nutshell, this error means your server isn\u2019t allocating enough resources [&hellip;]<\/p>\n","protected":false},"author":1056,"featured_media":86851,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_yoast_wpseo_opengraph-title":"Increase WordPress Memory Limit (Fix the Error) - DreamHost","_yoast_wpseo_opengraph-description":"Increase WordPress memory limit by editing wp-config.php via SFTP \u2014 see the exact code to add and how to raise the server-level limit if needed.","_yoast_wpseo_twitter-title":"Increase WordPress Memory Limit (Fix the Error) - DreamHost","_yoast_wpseo_twitter-description":"Increase WordPress memory limit by editing wp-config.php via SFTP \u2014 see the exact code to add and how to raise the server-level limit if needed.","toc_headlines":"[[\"h-why-you-re-seeing-a-wordpress-memory-limit-error-on-your-site\",\"Why you\u2019re seeing a WordPress memory limit error on your site\"],[\"h-how-to-resolve-the-wordpress-memory-limit-error-2-methods\",\"How to resolve the WordPress memory limit error (5 methods)\"],[\"h-faqs-about-the-wordpress-memory-limit\",\"FAQs about the WordPress memory limit\"],[\"h-want-more-wordpress-error-tips\",\"Want more WordPress error tips?\"],[\"h-increasing-php-memory-limit\",\"Increasing the PHP memory limit\"]]","hide_toc":false,"show_updated_at":"1","footnotes":""},"categories":[13127,550,696],"tags":[],"class_list":["post-30501","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-errors-troubleshooting","category-tutorials","category-wordpress"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Increase WordPress Memory Limit (Fix the Error) - DreamHost<\/title>\n<meta name=\"description\" content=\"Increase WordPress memory limit by editing wp-config.php via SFTP \u2014 see the exact code to add and how to raise the server-level limit if needed.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-memory-limit-error\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Increase WordPress Memory Limit (Fix the Error) - DreamHost\" \/>\n<meta property=\"og:description\" content=\"Increase WordPress memory limit by editing wp-config.php via SFTP \u2014 see the exact code to add and how to raise the server-level limit if needed.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-memory-limit-error\/\" \/>\n<meta property=\"og:site_name\" content=\"DreamHost Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DreamHost\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-21T14:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-08-27T21:37:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2026\/08\/blog-hero-how-to-fix-wordpress-memory-limit-error-dreamops-4f531079ec77ada717dfb468.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1536\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Natasha K\u00f6stlin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Increase WordPress Memory Limit (Fix the Error) - DreamHost\" \/>\n<meta name=\"twitter:description\" content=\"Increase WordPress memory limit by editing wp-config.php via SFTP \u2014 see the exact code to add and how to raise the server-level limit if needed.\" \/>\n<meta name=\"twitter:creator\" content=\"@dreamhost\" \/>\n<meta name=\"twitter:site\" content=\"@dreamhost\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Natasha K\u00f6stlin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Increase WordPress Memory Limit (Fix the Error) - DreamHost","description":"Increase WordPress memory limit by editing wp-config.php via SFTP \u2014 see the exact code to add and how to raise the server-level limit if needed.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-memory-limit-error\/","og_locale":"en_US","og_type":"article","og_title":"Increase WordPress Memory Limit (Fix the Error) - DreamHost","og_description":"Increase WordPress memory limit by editing wp-config.php via SFTP \u2014 see the exact code to add and how to raise the server-level limit if needed.","og_url":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-memory-limit-error\/","og_site_name":"DreamHost Blog","article_publisher":"https:\/\/www.facebook.com\/DreamHost\/","article_published_time":"2021-04-21T14:00:00+00:00","article_modified_time":"2026-08-27T21:37:55+00:00","og_image":[{"width":1536,"height":1024,"url":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2026\/08\/blog-hero-how-to-fix-wordpress-memory-limit-error-dreamops-4f531079ec77ada717dfb468.webp","type":"image\/webp"}],"author":"Natasha K\u00f6stlin","twitter_card":"summary_large_image","twitter_title":"Increase WordPress Memory Limit (Fix the Error) - DreamHost","twitter_description":"Increase WordPress memory limit by editing wp-config.php via SFTP \u2014 see the exact code to add and how to raise the server-level limit if needed.","twitter_creator":"@dreamhost","twitter_site":"@dreamhost","twitter_misc":{"Written by":"Natasha K\u00f6stlin","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-memory-limit-error\/#article","isPartOf":{"@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-memory-limit-error\/"},"author":{"name":"Natasha K\u00f6stlin","@id":"https:\/\/www.dreamhost.com\/blog\/#\/schema\/person\/74b2292b1434093c6d22d20f694406ec"},"headline":"How To Fix the WordPress Memory Exhausted Error by Increasing Your Site\u2019s PHP Memory Limit","datePublished":"2021-04-21T14:00:00+00:00","dateModified":"2026-08-27T21:37:55+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-memory-limit-error\/"},"wordCount":2495,"publisher":{"@id":"https:\/\/www.dreamhost.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-memory-limit-error\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2026\/08\/blog-hero-how-to-fix-wordpress-memory-limit-error-dreamops-4f531079ec77ada717dfb468.webp","articleSection":["Errors &amp; Troubleshooting","Tutorials","WordPress"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-memory-limit-error\/","url":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-memory-limit-error\/","name":"Increase WordPress Memory Limit (Fix the Error) - DreamHost","isPartOf":{"@id":"https:\/\/www.dreamhost.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-memory-limit-error\/#primaryimage"},"image":{"@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-memory-limit-error\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2026\/08\/blog-hero-how-to-fix-wordpress-memory-limit-error-dreamops-4f531079ec77ada717dfb468.webp","datePublished":"2021-04-21T14:00:00+00:00","dateModified":"2026-08-27T21:37:55+00:00","description":"Increase WordPress memory limit by editing wp-config.php via SFTP \u2014 see the exact code to add and how to raise the server-level limit if needed.","breadcrumb":{"@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-memory-limit-error\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-memory-limit-error\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-memory-limit-error\/#primaryimage","url":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2026\/08\/blog-hero-how-to-fix-wordpress-memory-limit-error-dreamops-4f531079ec77ada717dfb468.webp","contentUrl":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2026\/08\/blog-hero-how-to-fix-wordpress-memory-limit-error-dreamops-4f531079ec77ada717dfb468.webp","width":1536,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/www.dreamhost.com\/blog\/how-to-fix-wordpress-memory-limit-error\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dreamhost.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Fix the WordPress Memory Exhausted Error by Increasing Your Site\u2019s PHP Memory Limit"}]},{"@type":"WebSite","@id":"https:\/\/www.dreamhost.com\/blog\/#website","url":"https:\/\/www.dreamhost.com\/blog\/","name":"DreamHost Blog","description":"","publisher":{"@id":"https:\/\/www.dreamhost.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dreamhost.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dreamhost.com\/blog\/#organization","name":"DreamHost","url":"https:\/\/www.dreamhost.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dreamhost.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/dhblog.dream.press\/blog\/wp-content\/uploads\/2019\/01\/dh_logo-blue-2.png","contentUrl":"https:\/\/dhblog.dream.press\/blog\/wp-content\/uploads\/2019\/01\/dh_logo-blue-2.png","width":1200,"height":168,"caption":"DreamHost"},"image":{"@id":"https:\/\/www.dreamhost.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DreamHost\/","https:\/\/x.com\/dreamhost","https:\/\/www.instagram.com\/dreamhost\/","https:\/\/www.linkedin.com\/company\/dreamhost\/","https:\/\/www.youtube.com\/user\/dreamhostusa"]},{"@type":"Person","@id":"https:\/\/www.dreamhost.com\/blog\/#\/schema\/person\/74b2292b1434093c6d22d20f694406ec","name":"Natasha K\u00f6stlin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2020\/10\/Natasha-bio-pic-150x150.jpg","url":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2020\/10\/Natasha-bio-pic-150x150.jpg","contentUrl":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2020\/10\/Natasha-bio-pic-150x150.jpg","caption":"Natasha K\u00f6stlin"},"description":"After joining the DreamHost team in 2018, Natasha discovered her talent for helping people achieve website success. Her superpower: a warm, energetic attitude! As a key player in DreamHost\u2019s international marketing efforts, Natasha is excited to help readers across the world build and grow an online presence.","url":"https:\/\/www.dreamhost.com\/blog\/author\/natashakostlin\/"}]}},"lang":"en","translations":{"en":30501,"es":30506,"de":52234,"pl":53799,"pt":53834,"ru":53843,"uk":53882,"it":69046,"fr":71683,"nl":71711},"pll_sync_post":{},"_links":{"self":[{"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts\/30501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/users\/1056"}],"version-history":[{"count":2,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts\/30501\/revisions"}],"predecessor-version":[{"id":91433,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts\/30501\/revisions\/91433"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/media\/86851"}],"wp:attachment":[{"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/media?parent=30501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/categories?post=30501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/tags?post=30501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}