{"id":36909,"date":"2021-09-23T09:39:44","date_gmt":"2021-09-23T09:39:44","guid":{"rendered":"\/tutorials\/?p=36909"},"modified":"2025-02-27T05:36:07","modified_gmt":"2025-02-27T05:36:07","slug":"wordpress-memory-limit","status":"publish","type":"post","link":"\/ph\/tutorials\/wordpress-memory-limit","title":{"rendered":"WordPress Memory Limit: Fixing and Increasing PHP Memory"},"content":{"rendered":"<p>If your WordPress website has a lot of media content or is running large scripts, you may encounter the following error message while editing it:<\/p><ul class=\"wp-block-list\">\n<li>Fatal error: Allowed memory size of XXXXX bytes exhausted.<\/li>\n\n\n\n<li>Fatal error: Out of memory.<\/li>\n<\/ul><p>This means that your WordPress code requires more memory than the default value provided. However, resolving this problem is simpler than it appears, and it doesn&rsquo;t demand any technical expertise.<\/p><p>In this article, we&rsquo;ll clarify what the WordPress memory limit is, demonstrate how to increase it, and explore why you might encounter one of the error messages mentioned above.<\/p><p>\n\n\n\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-what-is-the-wordpress-memory-limit\">What Is the WordPress Memory Limit?<\/h2><p>The WordPress memory limit is also known as <strong>WordPress PHP memory limit<\/strong> or simply <strong>PHP memory limit<\/strong>. It mainly sets the maximum amount of memory that a script can use on the website. <\/p><p>By default, the WordPress memory limit is set to only <strong>32 MB<\/strong>, but you can increase it using several methods if needed.<\/p><p>Servers store all the data and websites&rsquo; files. Thus, a server must have the necessary storage capacity, processors, and RAM or memory in order to keep the site running.<\/p><p>The RAM capacity of a server varies depending on the hosting provider and plan used. A starter plan usually offers a low amount of RAM compared to a business or professional plan.<\/p><p>Every web application and function takes up some memory. The more plugins installed or media files uploaded, the more memory the site will require. If it runs out of memory, the site&rsquo;s loading speed may decrease, or worse, it won&rsquo;t load at all.<\/p><p>Hence, the WordPress memory limit is there to ensure that the website scripts don&rsquo;t exceed the server&rsquo;s RAM capacity.<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-increase-the-wordpress-memory-limit\">How to Increase the WordPress Memory Limit?<\/h2><p>To increase the WordPress memory limit, you can modify the <strong>.htaccess<\/strong> or <a href=\"\/ph\/tutorials\/wp-config-php\"><strong>wp-config.php<\/strong> file<\/a>, set it using the hPanel <strong>PHP Configuration<\/strong>, or upgrade your hosting plan.<\/p><h3 class=\"wp-block-heading\" id=\"h-how-to-increase-the-wordpress-memory-limit-using-an-ftp\">How to Increase the WordPress Memory Limit Using an FTP<\/h3><p>One way to edit the <strong>.htaccess<\/strong> or <strong>wp-config.php<\/strong> file is via an FTP client like <a href=\"https:\/\/filezilla-project.org\/\" target=\"_blank\" rel=\"noopener\">FileZilla<\/a>. Make sure to <a href=\"\/ph\/tutorials\/ftp\/filezilla-ftp-configuration\">connect FileZilla with your site&rsquo;s FTP account<\/a> before continuing with one of the following tutorials:<\/p><p><strong>Editing the .htaccess file<\/strong><\/p><ol class=\"wp-block-list\">\n<li>Access the site&rsquo;s <strong>public_html<\/strong> folder or root directory and find the <strong>.htaccess<\/strong> file.<\/li>\n\n\n\n<li>Right-click on the file and select <strong>View\/Edit<\/strong> to be directed to the text editor.<\/li>\n<\/ol><figure class=\"wp-block-image size-full\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/09\/FTP-view-edit.png\"><img decoding=\"async\" width=\"682\" height=\"433\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/09\/FTP-view-edit.png\" alt=\"Selecting to View\/Edit the .htaccess file on FileZilla.\" class=\"wp-image-36913\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/FTP-view-edit.png 682w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/FTP-view-edit-300x190.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/FTP-view-edit-150x95.png 150w\" sizes=\"(max-width: 682px) 100vw, 682px\" \/><\/a><\/figure><ol start=\"3\" class=\"wp-block-list\">\n<li>Look for the line:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># END WordPress<\/pre><p>Add the following code beneath it:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php_value memory_limit 256M<\/pre><figure class=\"wp-block-image size-full\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/09\/memory-limit.png\"><img decoding=\"async\" width=\"642\" height=\"390\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/09\/memory-limit.png\" alt=\"Editing the .htaccess file by adding the code.\" class=\"wp-image-36914\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/memory-limit.png 642w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/memory-limit-300x182.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/memory-limit-150x91.png 150w\" sizes=\"(max-width: 642px) 100vw, 642px\" \/><\/a><\/figure><ol start=\"4\" class=\"wp-block-list\">\n<li><strong>Save <\/strong>the file and close the editor.<\/li>\n\n\n\n<li>Click <strong>Yes <\/strong>when FileZilla asks whether to upload the modified file, then reload the site.<\/li>\n<\/ol><p><strong>Modifying the wp-config.php file<\/strong><\/p><ol class=\"wp-block-list\">\n<li>In the root folder, right-click on the <strong>wp-config.php<\/strong> file and select <strong>View\/Edit<\/strong>.<\/li>\n<\/ol><figure class=\"wp-block-image size-full\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/09\/wp-config-view-edit.png\"><img decoding=\"async\" width=\"683\" height=\"434\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/09\/wp-config-view-edit.png\" alt=\"Selecting to View\/Edit the wp-config.php file on FileZilla.\" class=\"wp-image-36915\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/wp-config-view-edit.png 683w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/wp-config-view-edit-300x191.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/wp-config-view-edit-150x95.png 150w\" sizes=\"(max-width: 683px) 100vw, 683px\" \/><\/a><\/figure><ol start=\"2\" class=\"wp-block-list\">\n<li>Find the line containing <strong>WP_MEMORY_LIMIT<\/strong> and change <strong>64M<\/strong> to <strong>256M<\/strong>.<\/li>\n\n\n\n<li>If it doesn&rsquo;t exist, insert the following code above the line: <\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">define('WP_MEMORY_LIMIT', '256M');<\/pre><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/08\/wp-config-memory-limit.png\"><img decoding=\"async\" width=\"855\" height=\"562\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/08\/wp-config-memory-limit.png\" alt=\"Modifying the wp-config.php file by adding the code.\" class=\"wp-image-114791\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2024\/08\/wp-config-memory-limit.png 855w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2024\/08\/wp-config-memory-limit-300x197.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2024\/08\/wp-config-memory-limit-150x99.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2024\/08\/wp-config-memory-limit-768x505.png 768w\" sizes=\"(max-width: 855px) 100vw, 855px\" \/><\/a><\/figure><\/div><ol start=\"4\" class=\"wp-block-list\">\n<li>Save the changes and upload the file.<\/li>\n<\/ol><p>When visiting the site, you shouldn&rsquo;t experience the &ldquo;memory limit exhausted&rdquo; error again.<\/p><h3 class=\"wp-block-heading\" id=\"h-how-to-increase-the-wordpress-memory-limit-using-the-file-manager\">How to Increase the WordPress Memory Limit Using the File Manager<\/h3><p>A more straightforward method to modify the<strong> .htaccess<\/strong> or <strong>wp-config.php<\/strong> file is via the file manager on your control panel. For this tutorial, we&rsquo;ll be using hPanel:<\/p><ol class=\"wp-block-list\">\n<li>Access <strong>hPanel<\/strong>, navigate to the <strong>Files <\/strong>section, and select <strong>File Manager<\/strong>.<\/li>\n<\/ol><figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-sidebar-1.png\"><img decoding=\"async\" width=\"448\" height=\"522\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-sidebar-1.png\" alt=\"Accessing Files Manager under the Files section on your hPanel\" class=\"wp-image-80655\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/hpanel-files-filemanager-sidebar-1.png 448w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/hpanel-files-filemanager-sidebar-1-257x300.png 257w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/hpanel-files-filemanager-sidebar-1-129x150.png 129w\" sizes=\"(max-width: 448px) 100vw, 448px\" \/><\/a><\/figure><ol start=\"2\" class=\"wp-block-list\">\n<li>Open the <strong>public_html<\/strong> folder or root directory, and double-click on the <strong>wp-config.php<\/strong> file.<\/li>\n<\/ol><figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/filemanager-wp-config-1.png\"><img decoding=\"async\" width=\"1024\" height=\"646\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/filemanager-wp-config-1-1024x646.png\" alt=\"The location of wp-config.php file on the public_html folder\" class=\"wp-image-80701\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/filemanager-wp-config-1.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/filemanager-wp-config-1-300x189.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/filemanager-wp-config-1-150x95.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/filemanager-wp-config-1-768x485.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><ol start=\"3\" class=\"wp-block-list\">\n<li>Insert the code mentioned on the FTP tutorial based on the file chosen, then press <strong>SAVE &amp; CLOSE<\/strong> when done.<\/li>\n<\/ol><p>Though you won&rsquo;t be making any significant changes using the methods above, you should <a href=\"\/ph\/tutorials\/backups\/downloading-website-backup\">back up your site<\/a> before editing it. This ensures you won&rsquo;t lose your WordPress site if something goes wrong.<\/p><h3 class=\"wp-block-heading\" id=\"h-how-to-increase-the-wordpress-memory-limit-from-the-hpanel\">How to Increase the WordPress Memory Limit From the hPanel<\/h3><p>An alternative solution for Hostinger clients is to set the memory limit via <strong>PHP Configuration<\/strong> on the hPanel:<\/p><ol class=\"wp-block-list\">\n<li>Log in to <strong>hPanel<\/strong>, scroll down to the <strong>Advanced <\/strong>section, and select <strong>PHP Configuration<\/strong>.<\/li>\n<\/ol><figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-advanced-phpconfiguration-1.png\"><img decoding=\"async\" width=\"398\" height=\"316\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-advanced-phpconfiguration-1.png\" alt=\"The PHP configuration option under the Advanced section on your hPanel\" class=\"wp-image-80722\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/hpanel-advanced-phpconfiguration-1.png 398w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/hpanel-advanced-phpconfiguration-1-300x238.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/hpanel-advanced-phpconfiguration-1-150x119.png 150w\" sizes=\"(max-width: 398px) 100vw, 398px\" \/><\/a><\/figure><ol start=\"2\" class=\"wp-block-list\">\n<li>Choose <strong>PHP Options<\/strong> and find the <strong>memory_limit<\/strong> field.<\/li>\n\n\n\n<li>Click on the dropdown menu and pick the highest amount.<\/li>\n<\/ol><figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-advanced-php-options-memory-limit.png\"><img decoding=\"async\" width=\"1024\" height=\"134\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-advanced-php-options-memory-limit-1024x134.png\" alt=\"The memoryLimit settings on PHP Configurations on the hPanel\" class=\"wp-image-80739\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/hpanel-advanced-php-options-memory-limit.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/hpanel-advanced-php-options-memory-limit-300x39.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/hpanel-advanced-php-options-memory-limit-150x20.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/hpanel-advanced-php-options-memory-limit-768x100.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><p>If the memory limit is already at the maximum, then the last option is to upgrade your hosting plan to get more RAM.<\/p><p>For example, our <a href=\"\/ph\/wordpress-hosting\">WordPress Business and Cloud Startup plans<\/a> provide more RAM compared to the <strong>Premium <\/strong>plan.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a href=\"\/ph\/wordpress-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner-1024x300.png\" alt=\"\" class=\"wp-image-111781\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2024\/06\/New-WP_in-text-banner-1024x300.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2024\/06\/New-WP_in-text-banner-300x88.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2024\/06\/New-WP_in-text-banner-150x44.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2024\/06\/New-WP_in-text-banner-768x225.png 768w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2024\/06\/New-WP_in-text-banner-1536x450.png 1536w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2024\/06\/New-WP_in-text-banner.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-how-to-check-the-wordpress-memory-limit\">How to Check the WordPress Memory Limit?<\/h2><p>Once you&rsquo;ve configured the memory limit, you might want to see if it worked. The following steps apply to users who are running <strong>WordPress 5.2<\/strong> and above:<\/p><ol class=\"wp-block-list\">\n<li>Access the <strong>WordPress dashboard<\/strong>, hover on <strong>Tools, <\/strong>and select <strong>Site Health<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/09\/WordPress-site-health.png\"><img decoding=\"async\" width=\"1024\" height=\"449\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/09\/WordPress-site-health-1024x449.png\" alt=\"Selecting Site Health in the WordPress dashboard.\" class=\"wp-image-36922\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/WordPress-site-health-1024x449.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/WordPress-site-health-300x132.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/WordPress-site-health-150x66.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/WordPress-site-health-768x337.png 768w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/WordPress-site-health.png 1346w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"2\" class=\"wp-block-list\">\n<li>Choose the <strong>Info <\/strong>tab and click on <strong>Server<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/09\/info-server.png\"><img decoding=\"async\" width=\"1024\" height=\"609\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/09\/info-server-1024x609.png\" alt=\"Choosing the info tab and clicking on Server. \" class=\"wp-image-36925\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/info-server-1024x609.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/info-server-300x178.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/info-server-150x89.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/info-server-768x457.png 768w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/info-server.png 1026w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>Scroll down through all server settings until you find the <strong>PHP memory limit<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/09\/server-settings-php-memory-limit.png\"><img decoding=\"async\" width=\"942\" height=\"435\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/09\/server-settings-php-memory-limit.png\" alt=\"PHP memory limit - 256M.\" class=\"wp-image-36928\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/server-settings-php-memory-limit.png 942w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/server-settings-php-memory-limit-300x139.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/server-settings-php-memory-limit-150x69.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/09\/server-settings-php-memory-limit-768x355.png 768w\" sizes=\"(max-width: 942px) 100vw, 942px\" \/><\/a><\/figure><\/div><h2 class=\"wp-block-heading\" id=\"h-what-causes-the-wordpress-memory-limit-exhausted-error\">What Causes the &ldquo;WordPress Memory Limit Exhausted&rdquo; Error?<\/h2><p>The most common cause is that the memory limit may still be set to the default value instead of the highest option. Hence, it&rsquo;s important to check it before you start fixing the problem.<\/p><p>If that&rsquo;s not the case, then you might be outgrowing the hosting resources. As your WordPress website grows, the size of its database, plus the number of scripts and files, also increases. In addition, there might be plugins or themes that need extra memory to run as well.<\/p><p>Hosting providers allocate only a certain amount of resources, including the RAM limit, for different types of hosting plans. When starting your WordPress journey, you might have chosen a plan with limited RAM due to affordable prices, but it might be time to upgrade it.<\/p><p>Other than the memory limit exhausted error, you may also encounter the following issue:<\/p><p><strong>yourfile.png exceeds the maximum upload size for this site<\/strong><\/p><p>In this case, visit our <a href=\"\/ph\/tutorials\/how-to-increase-the-maximum-file-upload-size-in-wordpress\">How to Increase the Maximum File Upload Size<\/a> article to find solutions other than increasing the memory limit to fix that specific issue.<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>The WordPress PHP memory limit is the amount of memory available for scripts to run on your WordPress site. It ensures that the site doesn&rsquo;t exceed the server&rsquo;s RAM capacity given by the hosting provider.<\/p><p>The limit is usually set to 32 MB, which may not be enough to run a media-rich site and all its plugins. Thus, you will receive the exhausted memory error message when a script goes over the limit.<\/p><p>Here&rsquo;s a recap on how to increase the WordPress memory limit:<\/p><ul class=\"wp-block-list\">\n<li>By editing the <strong>.htaccess<\/strong> or <strong>wp-config.php<\/strong> file via an FTP or file manager.<\/li>\n\n\n\n<li>Set the size limit through PHP configurations on hPanel.<\/li>\n\n\n\n<li>Upgrade your hosting plan to use more resources.<\/li>\n<\/ul><p>Don&rsquo;t be afraid to contact our customer support team if you have additional questions or if the chosen method didn&rsquo;t solve the problem.<\/p><p>\n\n\n<div class=\"protip\">\n                    <h4 class=\"title\">Learn Other Advanced WordPress Techniques<\/h4>\n                    <p><a href=\"\/ph\/tutorials\/create-a-shortcode-in-wordpress\">How to Create a Shortcode in WordPress<\/a><br>\n<a href=\"\/ph\/tutorials\/wordpress-localhost\">WordPress Localhost<\/a><br>\n<a href=\"\/ph\/tutorials\/speed-up-wordpress\">How to Speed Up WordPress<\/a><br>\n<a href=\"\/ph\/tutorials\/remove-sidebar-wordpress\">How to Remove Sidebar in WordPress<\/a><br>\n<a href=\"\/ph\/tutorials\/wordpress-icons\">How to Use WordPress Icon Fonts<\/a><br>\n<a href=\"\/ph\/tutorials\/wordpress-a-b-testing\">WordPress A\/B Testing Guide<\/a><a><br>\n<\/a><a href=\"\/ph\/tutorials\/wordpress-staging-environment\">How to Create a Staging Envinorment in WordPress<\/a><br>\n<a href=\"\/ph\/tutorials\/how-to-add-php-code-to-wordpress-post-or-page\">How to Add PHP to WordPress<\/a><\/p>\n                <\/div>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If your WordPress website has a lot of media content or is running large scripts, you may encounter the following error message while editing it: This means that your WordPress code requires more memory than the default value provided. However, resolving this problem is simpler than it appears, and it doesn&rsquo;t demand any technical expertise. [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ph\/tutorials\/wordpress-memory-limit\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":69236,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"WordPress Memory Limit: How to Fix or Increase the PHP Memory Limit","rank_math_description":"Increasing the WordPress memory limit is not complicated - follow our guide to learn how to do that without any technical experience.","rank_math_focus_keyword":"wordpress memory limit","footnotes":""},"categories":[22635,22632],"tags":[],"class_list":["post-36909","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security-and-maintenance","category-wordpress"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/wordpress-memory-limit","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/aumentar-memoria-wordpress","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/limite-de-memoire-wordpress","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/como-aumentar-la-memoria-de-wordpress","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-menaikkan-wordpress-memory-limit","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/wordpress-memory-limit","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/wordpress-memory-limit","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/wordpress-memory-limit","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/como-aumentar-la-memoria-de-wordpress","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/como-aumentar-la-memoria-de-wordpress","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/como-aumentar-la-memoria-de-wordpress","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/aumentar-memoria-wordpress","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/wordpress-memory-limit","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/wordpress-memory-limit","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/wordpress-memory-limit","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/wordpress-memory-limit","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/36909","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/comments?post=36909"}],"version-history":[{"count":26,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/36909\/revisions"}],"predecessor-version":[{"id":123634,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/36909\/revisions\/123634"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/media\/69236"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/media?parent=36909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/categories?post=36909"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/tags?post=36909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}