Search Knowledge Base
Table of Contents
< Go Back To Home

Fatal error: Allowed Memory Size Error in WordPress (Increase WordPress Memory Limit)

Have you ever encountered the dreaded “allowed memory size exhausted” error on your WordPress website? This frustrating message can bring your website to a standstill, hindering user experience and potentially impacting conversions. But fear not, WordPress warriors! This blog post delves into the causes of this error and equips you with effective solutions to overcome it.

Let us quick fix one of the most common error for WordPress – Fatal error: Allowed memory size of bytes exhausted. This tutorial will also guide you on how to increase php memory limit in WordPress.

Understanding the Memory Monster:

WordPress websites rely on server memory, also known as PHP memory limit, to function effectively. This memory acts as a temporary workspace, handling tasks like loading plugins, themes, and processing data. When this allocated memory becomes insufficient, the aforementioned error arises, causing your website to malfunction.

Error Code: “Allowed memory size of” xxxxxxxx bytes exhausted (tried to allocate xxxxx bytes)

Simply follow the below steps to Fix the WordPress Memory Exhausted Error.

Step 1:

Login to Control Panel / cPanel.

Step 2:

Navigate & open File Manager

Step 3:

Open public_html folder

Step 4:

Edit wp-config.php file (do it by right clicking on the file and click edit)

Step 5:

Copy & paste the below code at the bottom of the file and click on save.

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

Step 6:

  • Thats all! You have fixed the Fatal error for allowed memory size in WordPress and increased the WordPress memory size for smooth & stable working of a WordPress website.
  • You can change 256M upto 1024M depending upon the RAM / Memory Limit assigned in your hosting plan. Consider using myglobalHOST hosting for wordpress as we offer minimum of 1GB RAM per account.

Common Culprits Behind the Memory Drain:

Several factors can contribute to memory exhaustion in WordPress. Here are some of the most frequent offenders:

  • Resource-intensive plugins: Certain plugins, particularly those with complex functionalities, can consume a significant amount of memory. Regularly deactivating and updating unused or outdated plugins can free up valuable memory space.
  • Memory-hungry themes: Themes with intricate designs and heavy features can also add to the memory burden. Consider evaluating and potentially switching to a lighter theme if necessary.
  • Unoptimized images: Large, unoptimized images can significantly impact website loading speed and memory usage. Compressing images before uploading them can significantly reduce their file size and alleviate memory strain.
  • High traffic volume: Unexpected spikes in website traffic can also trigger memory exhaustion. Upgrading your hosting plan to accommodate higher traffic volumes may be necessary in such scenarios.

Taming the Memory Beast: Solutions at Your Fingertips:

Now that we’ve identified the potential culprits, let’s explore the solutions that can help you fix the WordPress memory exhausted error and restore your website’s functionality:

  • Increase PHP memory limit: This involves modifying your website’s configuration file (wp-config.php) to allocate a higher memory limit. However, it’s crucial to consult with your hosting provider before making any changes to ensure compatibility and avoid potential conflicts.
  • Utilize caching plugins: Caching plugins store frequently accessed website elements, reducing the need to re-generate them on every page load. This can significantly improve website performance and reduce memory consumption.
  • Optimize your database: Over time, your WordPress database can accumulate unnecessary data, such as revisions, spam comments, and deleted posts. Regularly optimizing your database by removing redundant data can free up valuable memory space.
  • Consider a memory management plugin: Several WordPress plugins specifically address memory management issues. These plugins can help monitor memory usage, identify memory leaks, and even automatically optimize your website’s memory consumption.

Remember, prevention is key! Regularly updating your themes and plugins, optimizing images, and implementing caching mechanisms can go a long way in preventing memory exhaustion in the future.

By employing these strategies, you can effectively conquer the “allowed memory size exhausted” error and ensure your WordPress website thrives in the digital landscape.

Bonus Tip: Regularly monitoring your website’s performance using tools like Google Analytics and monitoring plugins can help you identify potential performance issues early on, allowing you to take proactive measures before encountering the memory exhausted error.

This blog post equips you with the knowledge and tools to combat the “allowed memory size exhausted” error in WordPress. Implement these solutions to maintain a smooth-running website and deliver an exceptional user experience to your visitors.