How to Increase Memory Limit WordPress in Simple Step

Are you trying to upload a theme or plugin ZIP file but encountering the “maximum memory limit exhausted” error. In this comprehensive guide, we’ll walk you through to effectively increase memory limit WordPress in simple steps, resolving those errors and getting your site back.

Why Increase Memory Limit WordPress?

WordPress websites require memory to run various functions, from displaying images and loading themes to handling plugins and complex functionalities. If the allocated memory is insufficient, errors like the one mentioned above can occur, causing issues like:

  • Slow website loading times
  • White screen of death (WSoD)
  • Plugin installation or update failures
  • Incomplete data processing

By increasing the memory limit, you provide your website with more resources to perform tasks effectively, resulting in a faster, more stable, and error-free experience for both you and your visitors.

Methods to Increase the Memory Limit (with Detailed Steps!)

There are several ways to increase the memory limit in WordPress, each with its own advantages and considerations. Let’s explore them:

1. Increase Memory Limit in WordPress Using wp-config

Important Note: Always back up your wp-config.php and .htaccess files before making any edits. It’s also crucial to increase the memory limit in small increments and test your website thoroughly after each change to ensure everything functions as expected.

This method directly instructs WordPress to use a higher memory limit and is generally the most effective approach:

read more about: WordPress login issues.

Access your WordPress files: Utilize an FTP client (File Transfer Protocol) or your web hosting control panel’s file manager to access your WordPress installation’s root directory.

Locate wp-config.php: This file contains essential WordPress configuration settings.

Edit wp-config.php: Download the file and open it in a text editor (like Notepad++ or Sublime Text). Be cautious when editing this file, as errors can lead to website malfunctions.

Increase the memory limit: Look for the line that says /* That’s all, stop editing! Happy blogging. */. Before this line, paste the following code, replacing 256M with your desired memory limit (in Megabytes, MB):

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

2. Editing .htaccess (For Apache Servers):

This method works if your web server is running Apache and allows overriding PHP settings through the .htaccess file:

  • Locate .htaccess: Similar to wp-config.php, find the .htaccess file in your WordPress root directory.
  • Edit .htaccess: Download the file and open it in a text editor. if you have dedicated text editor in you hosting or server then use it.
  • Increase the memory limit: Add the following line at the beginning of the file:
php_value memory_limit 256M

3. Increase Memory Limit in WordPress Using Plugin

read more about: background updates are not working in WordPress.

If you’re not comfortable editing files directly, several plugins can help you manage the memory limit:

  • Search for “Increase Maximum Upload File Size” plugins: In your WordPress dashboard, navigate to the “Plugins” section and search for plugins like “WP Memory Limit” or “Increase Maximum Upload File size.”
increase memory limit using plugin
  • Install and activate: Choose a reputable plugin, install it, and activate it.
  • Adjust the memory limit: The plugin will typically provide a user-friendly interface to adjust the memory limit to your desired value.
Increase Maximum Upload File Size plugin overview

Here you can select number of GB how much you want, also you can set maximum execution time so that when anything was uploaded the execution time give more time to execute the process normally.

4. Editing php.ini

This method requires access to your server’s root directory, which might not be available on all hosting plans:

  • Locate php.ini: The location of the php.ini file can vary depending on your web hosting provider. You might need to contact your hosting support for assistance. if in many case you have a search button in you panel so that search here multiphp editor.
multiphp editor option in panel
  • Edit php.ini: Open the php.ini manager or editor in a text editor with administrative privileges.
  • Increase the memory limit: Locate the line that says memory_limit and modify the value to your desired memory limit (in MB). If the line doesn’t exist, add it.
increase memory limit and maximum upload size option in control panel

If you have issue on uploading any theme file or plugin file in WordPress so that you have to change the upload_max_filesize to your desired memory limit (in MB).


Is increasing the memory limit safe?

Generally, yes. But be mindful of security and server resource limitations. Allocate the memory your site truly needs.

I increased the limit, but errors persist. What now?

Try deactivating plugins, reinstalling corrupted themes/plugins, or checking for server-side issues.

How much memory limit should I set?

Start with 256MB and gradually increase as needed. Monitor performance after each change.

Where can I find more help troubleshooting memory errors?

The WordPress community offers extensive resources online. Search for “troubleshooting WordPress memory errors” to find helpful guides and solutions.

Leave a Reply

Your email address will not be published. Required fields are marked *