A WordPress memory error may appear during a plugin installation, product import, image resize, or backup. “Allowed memory size exhausted” refers to the working memory available to one PHP request, not to free disk space.
Raising the limit can let a legitimate heavy task finish, but an arbitrarily high value may only postpone a plugin or query problem. First identify the effective PHP limit and reproduce the failing action. Then change the setting that actually controls the site and repeat the same test.
- What is the WordPress memory limit?
- When should you increase it?
- The difference between WordPress and PHP limits
- What to check before changing anything
- Increase the limit in your hosting panel
- Increase it through wp-config.php
- Use php.ini or .user.ini
- Verify the effective value
- What to do when more memory does not fix the problem
- WordPress memory limit: the practical recommendation
What is the WordPress memory limit?
WordPress runs on PHP. Every page view, plugin action, image resize, update, and import needs temporary working memory while PHP executes the code. The memory limitdefines how much RAM one PHP request may use before the server stops it.
Think of it as a workbench. A larger bench gives you room for a bigger job, but it does not make a badly organised job efficient. If a plugin keeps loading unnecessary data, giving it more space may only delay the next failure.
The memory limit is not the same as disk storage. A hosting account can have many gigabytes free and still stop a request at 128 MB because that is the active PHP limit.
When should you increase it?
Not every slow page or blank screen is a memory problem. Check the limit when the error message specifically mentions exhausted memory or when a repeatable heavy task fails.
- A product import stops at the same stage.
- A large image cannot be processed.
- A backup or migration job ends unexpectedly.
- A plugin administration screen opens with a fatal error.
- WordPress shows
Allowed memory size of ... bytes exhausted.
Normal pages may run comfortably with 128 MB, while importing 5,000 WooCommerce products needs more. Increasing the limit can help, but splitting the import into smaller batches may be just as important.
The difference between WordPress and PHP limits
Several values can appear on the same site. PHP’s memory_limitis the server-level ceiling. WordPress can request memory through WP_MEMORY_LIMITand WP_MAX_MEMORY_LIMIT, but it cannot exceed a limit enforced by the server.
- PHP memory_limit:the maximum available to one PHP request.
- WP_MEMORY_LIMIT:the amount WordPress requests for normal front-end work.
- WP_MAX_MEMORY_LIMIT:a higher request used for certain administration tasks.
If PHP is capped at 128 MB, adding 512 MB to wp-config.phpwill not create the missing memory. The hosting configuration must allow the higher value.
What to check before changing anything
Open Tools → Site Health → Info → Serverand record the PHP memory limit shown by WordPress. Then note the exact action that fails. “The site crashes sometimes” is difficult to investigate. “A 300 MB product import fails after two minutes” gives you a reproducible test.
Also save a copy of any file you plan to edit. Downloading wp-config.php, php.ini, or .user.inigives you a quick way back if a typing mistake takes the site offline.
Increase the limit in your hosting panel
For most site owners, the hosting panel is the simplest method. Plesk, cPanel, and many managed dashboards include a PHP settings screen for each domain.
- Sign in to the hosting control panel.
- Select the domain that runs WordPress.
- Open PHP Settings, PHP Options, or the equivalent page.
- Find
memory_limitand choose a reasonable value, such as 256M. - Save the change and restart PHP-FPM only if the panel asks you to do so.
A standard site may work well with 256 MB. A large store, page builder, migration, or media workflow can need more. Use the lowest value that completes the real task reliably instead of selecting the largest value available.
Increase it through wp-config.php
If the hosting panel does not expose the setting, tell WordPress how much memory to request. Open wp-config.phpin the WordPress root directory and add these lines before the comment that says to stop editing:
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );The first value applies to normal WordPress requests. The second is available for heavier administration work. These are examples, not universal requirements. The active PHP limit shown at this stage tells you which configuration layer is currently in control.
Save the file and open both the front end and wp-admin. If a syntax error causes a blank page, restore the backup and check the quotation marks and semicolons.
Use php.ini or .user.ini
With suitable server access, you can change PHP directly:
memory_limit = 256MSome servers read this from php.ini; shared PHP-FPM environments often support .user.ini. The correct file and directory depend on the host. Editing a configuration file used by another PHP version will have no effect.
This method is useful for experienced administrators. On managed hosting, the control panel or support team is usually the safer route.
Verify the effective value
Saving a number in a file does not prove that PHP accepted it. Return to Site Health and check the value WordPress reports. Then repeat the same action that failed before. Keep the import file, image, or backup settings unchanged so the comparison remains meaningful.
The official WordPress wp-config.php documentation explains the memory constants. Hosting providers may apply additional limits, so their documentation still matters.
What to do when more memory does not fix the problem
If the request still fails, or quickly consumes the new limit, look for the cause rather than doubling the number again. A plugin may load every product at once, an import may use batches that are too large, or image processing may be working with files far bigger than the site needs. If the memory limit error returns after the change, the log usually points to the task that still needs attention.
- Disable the suspected component on a staging site and repeat the request.
- Split imports, exports, and backups into smaller batches.
- Resize unusually large images before uploading them.
- Read the PHP error log around the time of the failure.
- Check whether scheduled scans, backups, or cron jobs run at the same time.
If a task fills 256 MB and then fills 512 MB soon afterwards, it probably has a growing workload or inefficient loop. More memory may postpone the symptom, but it will not remove the underlying problem.
ALL IN ONE WP SETTINGS · PHP LIMITS
Manage PHP limits from one clear WordPress screen
A value written to wp-config.phpis only a request; the active PHP environment may impose a lower ceiling. AIOWS PHP Limits displays the limits WordPress currently receives, which helps distinguish a saved setting from the effective result.
Where the server environment supports it, the module can attempt changes to memory, upload, POST, execution-time, and input limits. The same screen can then be used to check whether PHP accepted the new value.
AIOWS cannot override a hosting policy or make inefficient code memory-efficient. If the active value remains unchanged, use the reported information when checking the relevant PHP configuration or contacting the host.
- View the effective limits for this WordPress installation.
- Attempt supported changes without editing theme files.
- Check the active value again after saving.
- Share clear diagnostic values with hosting support.
WordPress memory limit: the practical recommendation
The safest way to change the WordPress memory limitis straightforward: find the effective value, identify the failing action, change one setting, and repeat the same test. That gives you evidence instead of guesswork.
For related server limits, read the guides on maximum execution time errorsand increasing the upload size. The same principle applies: check the active value before editing several layers at once.








