WordPress allocates a fixed amount of PHP memory to run your site. Most shared hosting accounts start with a limit somewhere between 32MB and 64MB — enough for a simple site, but often not enough once you add a page builder, several active plugins, or start editing larger posts. When that ceiling is hit, WordPress either throws a fatal error, shows a white screen, or silently fails on a specific action.
The good news is that increasing this limit is straightforward on most hosts. There are three places you can make the change: wp-config.php, a php.ini file, or directly through your hosting dashboard. This guide covers all three methods, so you can pick whichever matches your setup.
Quick Answer
Open wp-config.php in your file manager or FTP client and add this line just before the comment that reads “That’s all, stop editing! Happy publishing”:
define( 'WP_MEMORY_LIMIT', '256M' );
Save the file and reload your site. If the error is gone or the plugin now activates, you are done. If the line already exists with a high value, or your host restricts this method, use one of the alternative approaches below.
Why the PHP Memory Limit Matters
PHP memory errors are one of the most common causes of WordPress issues on shared hosting. A memory-exhausted site can show a blank white screen of death, return an error when saving a post, cause the admin area to stop loading, or prevent a plugin from activating entirely. The most common triggers are:
- Installing a new plugin that requires more memory than your current limit
- Running a page builder like Elementor or Bricks on a complex page
- Importing content or running a bulk update
- WooCommerce processing a large product catalogue
- Caching plugins regenerating cache files
The official WordPress recommendation is a minimum of 64MB, but 256MB is a safe general-purpose value for most small to medium sites. Large WooCommerce stores or sites with heavy image processing may need more.
Step 1 — Check Your Current PHP Memory Limit
Before making any changes, check what WordPress is currently working with. Go to Tools → Site Health in your WordPress dashboard and click the Info tab. Scroll to the PHP section — you will see both the PHP memory limit set by the server and the value WordPress itself is allowed to use (the WP_MEMORY_LIMIT value).
The WordPress Site Health tool also flags memory as a concern if the limit is set too low, which makes it a useful first check before editing any files. If the value is already 256MB or above, look elsewhere for your issue — memory is not the cause.
Step 2 — Edit wp-config.php (Recommended First)
This is the standard way to raise the memory limit in WordPress. Open your file manager in cPanel or connect via FTP, then navigate to the root of your WordPress installation. Open wp-config.php for editing.
Find the line that reads:
/* That's all, stop editing! Happy publishing. */
Add the following line immediately above it:
define( 'WP_MEMORY_LIMIT', '256M' );
Save the file. Return to Tools → Site Health → Info and check the PHP section to confirm the new value. You can find the full documentation for this setting in the WordPress developer documentation on wp-config.php.
If you also need to raise the memory limit for admin-heavy tasks — such as bulk plugin updates or large media uploads — add this line below the first:
define( 'WP_MAX_MEMORY_LIMIT', '256M' );
Step 3 — Edit php.ini (If wp-config.php Has No Effect)
If editing wp-config.php makes no difference — this happens when the host sets the PHP memory limit at the server level and does not allow WordPress to override it — try editing the php.ini file directly.
In your file manager, look for a file called php.ini in the root of your site. If it does not exist, create one. Add this line:
memory_limit = 256M
Save the file and reload your site. Some Apache-based hosts also accept this directive in an .htaccess file:
php_value memory_limit 256M
Whether these methods work depends on your hosting configuration. Shared hosts often lock down php.ini changes to prevent resource abuse across accounts.
Step 4 — Use Your Hosting Control Panel
Many managed WordPress hosts and cPanel-based shared hosts include a PHP settings panel where you can adjust the memory limit without editing any files. The location varies by host:
- cPanel: Look for Select PHP Version or PHP Configuration under the Software section. Find
memory_limitin the list and update it. - SiteGround / Cloudways and other managed hosts: These typically have a PHP Settings or Server Settings section. Set
memory_limitto 256M. - Local (by Flywheel): Right-click the site, go to Site setup → PHP version and adjust the php.ini settings from there.
If none of these options are visible, contact your host’s support directly and ask them to raise the PHP memory limit to 256MB. Most reputable hosts will do this without issue.
Practical Tips
In most sites I build, 256MB is the safe default to start with. It covers standard shared hosting setups with a reasonable plugin stack. Going straight to 512MB or 1GB is rarely necessary and will not improve performance — it just reserves more potential memory for PHP to use.
Always check Site Health after making the change, not just whether the white screen has gone away. The Info tab shows exactly what value WordPress is reading — it confirms the change was applied at the right layer.
If you increase the limit and the error persists, the issue may not be memory at all. Deactivate your plugins one at a time to isolate a conflict. A single poorly coded plugin can exhaust even a generous memory allocation.
Common Mistakes
- Adding the line in the wrong place in wp-config.php. It must go before the “stop editing” comment, not after it. Lines placed after that comment may not be processed correctly by WordPress.
- Using the wrong format for the value. Write it as
'256M'— not256or'256MB'. PHP expects the M suffix without the B. - Assuming wp-config.php always works. On restrictive shared hosts, the server-level limit overrides what WordPress sets. If the change does not appear in Site Health, move on to the php.ini method or contact your host.
- Setting the limit too low the first time. Going from 64MB to 128MB when you actually need 256MB means repeating this process in a few months. Set 256MB as your baseline now.
When to Contact Your Host Instead
If you have tried all three methods and the memory limit in Site Health still shows the original value, your host is enforcing a hard server-level cap. This is common on budget shared hosting where resources are pooled across many accounts.
Your options at that point are: contact support and ask them to raise the limit for your account, upgrade to a higher hosting tier with more PHP resources, or migrate to a host that allows more flexible PHP configuration. For most WordPress sites that have outgrown budget shared hosting, moving to a VPS or managed WordPress plan resolves both memory and performance issues in one step.
Conclusion
Start with the wp-config.php method — it works on the vast majority of hosts and takes under two minutes. If that does not take effect, work down through php.ini and your hosting control panel before reaching out to support. Once the limit is raised and confirmed in Site Health, most memory-related WordPress errors clear up immediately. For a broader foundation — from choosing your host to launching a fully working site — the step-by-step guide to building a WordPress website covers the complete process.

Etienne Basson works with website systems, SEO-driven site architecture, and technical implementation. He writes practical guides on building, structuring, and optimizing websites for long-term growth.