If WordPress shows an exhausted-memory error, a blank screen, a failed update, or a plugin that stops loading, you may need to increase the WordPress memory limit. The safest fix is not simply to enter a very large number: first confirm which limit is being reached, back up the site, raise the limit in the correct configuration layer, and test the original task again.
In this guide
WordPress memory is PHP memory allocated to one request. It is different from your server’s total RAM, storage space, and the memory used by your computer. A limit change can help a demanding plugin or dashboard operation, but it will not repair a PHP compatibility problem, a plugin conflict, a runaway query, or an undersized hosting plan.
What the WordPress memory limit controls
WordPress commonly uses two related settings. WP_MEMORY_LIMIT applies to normal site requests, while WP_MAX_MEMORY_LIMIT can allow a higher limit for administration tasks such as editing, importing, or media processing. The exact effective value still depends on the PHP configuration imposed by your host.
For example, WordPress may request 256 MB while the server permits only 128 MB. In that situation, editing wp-config.php alone cannot exceed the host’s PHP ceiling. Conversely, a high PHP ceiling does not mean every WordPress request should use it.
Confirm that memory is actually the problem
Before changing production files, record the symptom and when it occurs. Memory exhaustion is more likely when one particular import, editor, image operation, backup, or plugin action fails while simpler pages work. Look for a PHP fatal error containing wording such as Allowed memory size exhausted in your hosting error log or WordPress debugging log.
The wording and location of logs vary by host. If you cannot access them, ask hosting support for the PHP error corresponding to the failure time. Do not assume that every “critical error,” 500 error, or blank page is a memory issue; existing guides for critical WordPress errors and 500 Internal Server Errors cover other causes.
Check the active value in the dashboard
If you can open the dashboard, look under Tools → Site Health → Info. Exact labels can vary by WordPress version and hosting setup. Expand the server or WordPress constants sections and note the reported PHP memory limit and WordPress memory limit. Take a screenshot or copy the values before making changes.
If the dashboard is unavailable, use your host’s PHP information or server panel if it provides one. Avoid uploading a public phpinfo() page: it can reveal useful server details to anyone who finds the URL, and it must be removed immediately if used temporarily.
Prepare before editing configuration
- Create a current backup. Keep both the database and WordPress files, and confirm that the backup can be restored or that your host provides a usable restore point.
- Use a staging site when possible. Test the memory change there before touching a busy production site.
- Keep an alternate access method. Have hosting file manager, SFTP, or the host’s recovery tools available in case a syntax mistake prevents the site from loading.
- Change one layer at a time. Multiple simultaneous edits make it difficult to identify which setting worked.
Editing wp-config.php, PHP configuration, .htaccess, or DNS is more sensitive than changing a dashboard setting. If you are not comfortable restoring a file, ask your host or a WordPress professional to apply the change.
Method 1: Set WordPress memory in wp-config.php
This is often the first practical method when the host permits WordPress to request more memory. Connect through SFTP or your hosting file manager and download a backup copy of wp-config.php before editing it. The file is normally in the site’s root directory, alongside folders such as wp-admin, wp-content, and wp-includes.
Add the constants before the line that says WordPress should stop editing, commonly shown as /* That's all, stop editing! Happy publishing. */:

define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
Use values appropriate for your site and host rather than copying these numbers automatically. If either constant already exists, edit the existing line instead of creating a duplicate. PHP configuration values are normally written with M for megabytes.
Save the file, upload it, and load the dashboard or the page that previously failed. A missing semicolon, misplaced quote, or duplicate constant can cause a PHP parse error, so restore the backup immediately if the site becomes inaccessible.
Method 2: Ask the host to raise the PHP limit
If Site Health still reports the old value, or the fatal error says the allowed memory is lower than the value you requested, the server is enforcing a ceiling. Contact hosting support and provide:
- the domain and affected URL or task;
- the time of the failure and the exact error text;
- the current PHP memory limit;
- the WordPress values you requested; and
- the memory limit you need, based on the failed operation.
Some hosts expose PHP settings in a control panel, but the menu name and available controls differ. Look for a PHP version or PHP options area and confirm that the setting applies to the correct domain, site directory, and PHP version. Do not change a shared server-wide setting unless your host explicitly instructs you to do so.
On managed WordPress hosting, the provider may intentionally control these values. In that case, a support request is safer than trying to override the platform.
Method 3: Use php.ini or .user.ini only when supported
Some hosting environments allow a local PHP configuration file. A php.ini or .user.ini file may contain settings such as:
memory_limit = 256M
Whether this works depends on the PHP handler, hosting plan, file location, and how quickly PHP reloads per-directory settings. A local file can also affect more than WordPress, so do not create one based on guesswork. Ask the host which filename and directory they support, whether the value is permitted, and how to verify it.
Do not place PHP directives in .htaccess unless your host specifically documents that method for your server configuration. An unsupported directive can produce a 500 error. For safe background on that file, see Mastering .htaccess for WordPress.
Verify the change and retest the cause
- Return to Tools → Site Health → Info, or use the host’s supported PHP information, and confirm the active values.
- Clear only relevant caches: page cache, object cache, opcode cache, or a host cache if your provider says it is required. Do not purge every system blindly.
- Repeat the exact operation that failed, such as the import, image processing task, or plugin screen.
- Check the error log again. A new error may identify the actual bottleneck.
- Test both the public site and essential admin functions while logged in and logged out.
If the limit increased but the same request still fails, note the new “allowed” and “tried” memory values in the error. A request that tries to allocate far more memory may be triggering a plugin or theme defect rather than needing an unlimited increase.
If increasing memory does not fix the problem

Find the task that consumes memory
Temporarily deactivate the plugin most closely associated with the failing action, preferably on staging first. If the problem disappears, reactivate plugins one at a time and test after each change. Do not leave security, ecommerce, or essential functionality disabled on a live site longer than necessary.
A conflict can also involve the active theme or custom code. Use a staging copy or a controlled conflict test rather than randomly deleting plugin files. The WordPress Site Repair service may be appropriate when the dashboard is inaccessible or the cause is unclear.
Check PHP compatibility and resource limits
Older code may fail under the current PHP version, while newer code may require a supported version. Memory is also only one resource: CPU limits, execution time, process limits, database errors, and disk space can stop the same operation. If the issue began after a PHP change, compare the site’s PHP version and review compatibility rather than raising memory repeatedly.
For a broader performance investigation, see plugins to improve WordPress performance. Performance tools can help identify heavy requests, but adding another optimization plugin is not a substitute for finding the failing component.
Quick decision guide
- Site Health shows a low limit and wp-config.php is allowed: request a moderate increase there, then verify.
- wp-config.php requests more but the active limit stays low: ask the host to raise the PHP ceiling.
- Only one plugin task fails: investigate that plugin, its data volume, and compatibility before increasing memory again.
- The site fails immediately after editing a file: restore the backup and check for syntax errors or unsupported directives.
- Several unrelated requests fail with resource errors: review hosting capacity, PHP workers, CPU, database health, and logs with the host.
Questions to ask before making the limit larger
What is a reasonable WordPress memory limit?
There is no universal number. Use the smallest value that supports the site’s normal workload and remains within the host’s documented allowance. A larger limit can hide inefficient code and allow one request to consume more shared resources.
Can I increase memory from the WordPress dashboard?
Usually, no. Themes and plugins may expose their own settings, but WordPress does not provide one universal dashboard control for the server’s PHP memory ceiling. Verify any plugin-specific instruction before relying on it.
Does more memory make WordPress faster?
No. More memory prevents some requests from being terminated, but it does not automatically improve response time. Caching, database queries, image processing, plugin code, and hosting capacity may be the real performance issue. WordPress’s official documentation is a useful reference when checking version-specific behavior.
Should I set the limit to 1G?
Not as a first step. An unusually high value can conceal a runaway process and may be ignored by the host. Identify the failing request, test a sensible increase, and review logs before raising it further.



