{"id":11767,"date":"2023-12-12T12:27:00","date_gmt":"2023-12-12T12:27:00","guid":{"rendered":"https:\/\/www.20i.com\/blog\/?p=11767"},"modified":"2026-01-09T15:40:37","modified_gmt":"2026-01-09T15:40:37","slug":"wordpress-memory-limit","status":"publish","type":"post","link":"https:\/\/www.20i.com\/blog\/wordpress-memory-limit\/","title":{"rendered":"How To Resolve WordPress Memory Limit Issues"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Some of the common challenges WordPress users face revolve around memory related issues. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress memory limit is a defined threshold available for your website without it exceeding the server\u2019s RAM capacity.&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Some scripts can use a lot of memory, especially if a WordPress plugin is used to import a large amount of data. If a script exceeds the memory limit, it could cause your website or server to crash.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You may have experienced the error message on your website \u201cAllowed memory size exhausted\u201d which generally means that your website has run out of memory &#8211; we briefly touched on this in our <a href=\"https:\/\/www.20i.com\/blog\/wordpress-white-screen-death\/\" target=\"_blank\" rel=\"noreferrer noopener\">White Screen Of Death blog post<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this article, we\u2019ll explore different ways on how you can check the memory limit that your website is set to, how you can increase this and the potential causes.&nbsp;&nbsp;<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How you can check your website&#8217;s memory limit<\/strong>&nbsp;<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A phpinfo page will display all the PHP information that you need, including your website&#8217;s memory limit. It\u2019s very easy to set up and only requires one line of code.&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Firstly, create a file called phpinfo.php. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can do this via your File Manager or you can create this locally and upload via FTP.&nbsp;&nbsp;Add this line of code:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>&lt;?php<\/strong>&nbsp;\n\nphpinfo( );&nbsp;\n\n<strong>?&gt;<\/strong>&nbsp;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now you can load this in your browser via the URL i.e https:\/\/your-domain.com\/phpinfo.php. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should see something like this:&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1400\" height=\"348\" src=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/12\/phpinfo.png\" alt=\"\" class=\"wp-image-11768\" srcset=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/12\/phpinfo.png 1400w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/phpinfo-300x75.png.webp 300w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/phpinfo-768x191.png.webp 768w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/phpinfo-370x92.png.webp 370w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/phpinfo-270x67.png.webp 270w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/phpinfo-570x142.png.webp 570w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/phpinfo-740x184.png.webp 740w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/phpinfo-150x37.png.webp 150w\" sizes=\"auto, (max-width: 1400px) 100vw, 1400px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You can then do a quick find with \u2018ctrl+f\u2019 and search for \u201cmemory_limit\u201d to find the row showing your website\u2019s memory limit.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to identify low memory (and how to increase it)<\/strong>&nbsp;<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you find that your website&#8217;s loading speed has decreased (or won\u2019t load at all) and throws back the \u201cAllowed memory size exhausted\u201d error mentioned above, there are various ways you can modify and increase the PHP Memory limit.&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here are some common examples&#8230;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>PHP Configuration in My20i<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can modify your website\u2019s PHP configurations in <a href=\"https:\/\/my.20i.com\" target=\"_blank\" rel=\"noreferrer noopener\">My20i<\/a> via Manage Hosting &gt; Options &gt; Manage &gt; Web Tools&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1152\" height=\"314\" src=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/12\/webtools.png\" alt=\"\" class=\"wp-image-11769\" srcset=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/12\/webtools.png 1152w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/webtools-300x82.png.webp 300w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/webtools-768x209.png.webp 768w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/webtools-370x101.png.webp 370w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/webtools-270x74.png.webp 270w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/webtools-570x155.png.webp 570w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/webtools-740x202.png.webp 740w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/webtools-150x41.png.webp 150w\" sizes=\"auto, (max-width: 1152px) 100vw, 1152px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Click \u2018PHP Configuration\u2019 you can then easily modify the PHP Memory limit for your website.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1308\" height=\"649\" src=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/12\/phpconfig.png\" alt=\"\" class=\"wp-image-11770\" srcset=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/12\/phpconfig.png 1308w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/phpconfig-300x149.png.webp 300w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/phpconfig-768x381.png.webp 768w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/phpconfig-370x184.png.webp 370w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/phpconfig-270x134.png.webp 270w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/phpconfig-570x283.png.webp 570w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/phpconfig-740x367.png.webp 740w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/phpconfig-150x74.png.webp 150w\" sizes=\"auto, (max-width: 1308px) 100vw, 1308px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>php.ini or .user.ini<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you\u2019ve used the \u2018PHP Configuration\u2019 tool in My20i, this will automatically set a directive in the .user.ini file called <code>memory_limit<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This directive sets the maximum amount of memory a PHP script is allowed to allocate, and you can modify the value within the file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If your website is hosted elsewhere, you\u2019d usually find the file within the root directory of your website files or in the public folder. You can create one if needed using the File Manager or locally and then upload the file via FTP.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>wp-config.php<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">you can define a specific memory limit in the wp-config.php file for WordPress to use. Here is an example:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br><code>define('WP_MEMORY_LIMIT', '256M');<br><\/code><br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>.htaccess<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>.htaccess<\/strong> file can also be used to set PHP values, including the memory limit. Adding this line will set the memory limit:<br><br><code>php_value memory_limit 256M<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Causes and Preventative measures<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Cache Configuration<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Configuring your website to cache will help reduce memory issues, especially if your website receives a high amount of traffic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you have a busy website without caching, it can greatly impact your servers&#8217; resources as the page will need to be generated from the origin server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Caching stores static content, which is delivered much more quickly and has zero impact on your server resources.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At 20i, our <a href=\"https:\/\/www.20i.com\/reseller-hosting\" data-internallinksmanager029f6b8e52c=\"2\" title=\"reseller hosting\" target=\"_blank\" rel=\"noopener\">Reseller hosting<\/a> and 20iCloud servers include our own <a href=\"https:\/\/www.20i.com\/cdn\">fully featured CDN<\/a> and bespoke cache plugin for Managed WordPress.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Use well maintained Plugins and Themes<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Poorly coded plugins and themes can cause memory issues for your website. When choosing your websites plugins and themes, be sure to check out how often they\u2019re updated.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If a plugin or theme has not been updated for a long time, it\u2019s likely to have fallen behind with WordPress core updates and conflict, causing performance and security issues for the website.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Bot Traffic and DDOS Attacks<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Anti-DDoS attacks and Bot Traffic can overwhelm the server resources, causing your website to go down.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At 20i, all our hosting platforms feature 1+tbps Anti-DDoS and bad bot protection at no extra cost.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Inadequate Server Resources<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your website may naturally require more RAM. With our <a href=\"https:\/\/www.20i.com\/web-hosting\" target=\"_blank\" rel=\"noreferrer noopener\">Web Hosting<\/a> you can monitor your website&#8217;s memory usage via the server management page within My20i. You can easily upgrade your server specification if needed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For websites hosted on our Reseller hosting platform, resources are scaled on demand so you will not be hit by LVE limits, ever.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Monitor Memory Usage<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There are various ways you can monitor your website&#8217;s memory usage. A useful plugin called <a href=\"https:\/\/wordpress.com\/plugins\/wp-server-stats\">WP Server Stats<\/a> will display your website&#8217;s PHP memory usage in real time. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is especially useful if you\u2019ve encountered the dreaded \u2018Allowed memory size exhausted\u2019 error message.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"411\" height=\"248\" src=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/12\/wpstats.png\" alt=\"\" class=\"wp-image-11771\" srcset=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/12\/wpstats.png 411w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/wpstats-300x181.png.webp 300w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/wpstats-200x120.png.webp 200w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/wpstats-370x223.png.webp 370w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/wpstats-270x163.png.webp 270w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/wpstats-150x91.png.webp 150w\" sizes=\"auto, (max-width: 411px) 100vw, 411px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If your website is hosted on our Managed Cloud Hosting, you can also monitor the RAM usage within the server management area and identify the website using the most amount of memory.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1266\" height=\"567\" src=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/12\/server-ram.png\" alt=\"\" class=\"wp-image-11772\" srcset=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/12\/server-ram.png 1266w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/server-ram-300x134.png.webp 300w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/server-ram-768x344.png.webp 768w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/server-ram-370x166.png.webp 370w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/server-ram-270x121.png.webp 270w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/server-ram-570x255.png.webp 570w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/server-ram-740x331.png.webp 740w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/12\/server-ram-150x67.png.webp 150w\" sizes=\"auto, (max-width: 1266px) 100vw, 1266px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Final thoughts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Implementing preventative measures such as optimising your website&#8217;s code and configuring your website to cache will make your website resilient against memory issues.&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Monitoring your WordPress website using the <a href=\"https:\/\/wordpress.com\/plugins\/wp-server-stats\" target=\"_blank\" rel=\"noreferrer noopener\">WP Server Stats<\/a> plugin will also keep you one step ahead.&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><div class='code-block code-block-4' style='margin: 8px 0; clear: both;'>\n<hr>\n<br \/><a href=\"https:\/\/www.20i.com\/wordpress-hosting\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2026\/03\/Blog-Ad-WordPress-1200x625-1.png\" loading=\"lazy\" alt=\"Managed WordPress Hosting\"><\/a><\/div>\n\n","protected":false},"excerpt":{"rendered":"Some of the common challenges WordPress users face revolve around memory related issues. WordPress memory limit is a&hellip;","protected":false},"author":25,"featured_media":11780,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"ub_ctt_via":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"csco_singular_sidebar":"","csco_page_header_type":"","csco_page_load_nextpost":"","footnotes":""},"categories":[60,293],"tags":[79,76],"class_list":["post-11767","post","type-post","status-publish","format-standard","has-post-thumbnail","category-web-design-dev","category-wordpress","tag-web-development","tag-wordpress","cs-entry"],"featured_image_src":"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/12\/How-to-resolve-wordpress-memory-limit-issues.png","author_info":{"display_name":"Ben Perry","author_link":"https:\/\/www.20i.com\/blog\/author\/benperry92\/"},"_links":{"self":[{"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/posts\/11767","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/comments?post=11767"}],"version-history":[{"count":6,"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/posts\/11767\/revisions"}],"predecessor-version":[{"id":18235,"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/posts\/11767\/revisions\/18235"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/media\/11780"}],"wp:attachment":[{"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/media?parent=11767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/categories?post=11767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/tags?post=11767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}