The WordPress PHP memory limit controls how much server memory a single PHP request can use before it fails. Set it too low, and your site may crash during plugin updates, WooCommerce checkout, page builder editing, image processing, imports, backups, or admin tasks. Set it too high, and one bad plugin or runaway script can consume too much RAM and hurt the whole server.
That is why a WordPress PHP memory limit calculator is useful. Instead of guessing between 128M, 256M, 512M, or 1024M, you can estimate a safer limit based on your site type, plugin load, WooCommerce usage, page builder weight, traffic pattern, and available server RAM.
This guide explains how much PHP memory WordPress needs, how to calculate a safe value, when to increase it, when not to increase it, and how to apply the right settings through wp-config.php, php.ini, .user.ini, or your hosting control panel.
For a quick estimate, use the FyrePress PHP Memory Limit Calculator. It helps calculate practical PHP memory values and WP_MAX_MEMORY_LIMIT settings based on server RAM and site complexity.
TL;DR
Most small WordPress sites work well with 128M to 256M. WooCommerce, Elementor, Divi, LearnDash, membership sites, multilingual sites, and heavy admin workflows usually need 256M to 512M. Very large stores, imports, backups, and complex dashboards may need more, but raising memory blindly is not a performance fix.
- Basic blog: 128M is often enough.
- Business site with plugins: 256M is a safer baseline.
- WooCommerce store: 256M minimum, 512M preferred for heavier stores.
- Page builder site: 256M to 512M, especially for admin editing.
- Large import/export tasks: 512M or more may be needed temporarily.
- Do not use unlimited memory:
-1can let one process consume too much RAM. - Always calculate against server RAM: memory limit is per PHP request, not total website memory.
What Is the PHP Memory Limit in WordPress?
The PHP memory limit is the maximum amount of memory a single PHP script is allowed to use during one request. In WordPress, that request could be a visitor loading a page, an admin saving a post, WooCommerce processing checkout, a plugin updating its database, or a page builder rendering a complex layout.
When a request needs more memory than allowed, WordPress may show an error like:
Fatal error: Allowed memory size of 134217728 bytes exhausted
This message means PHP reached the configured memory ceiling. The number may look technical, but the problem is simple: the request needed more memory than PHP was allowed to use.
A memory limit is not the same as your total server RAM. If your VPS has 4 GB RAM, that does not mean you should set WordPress memory to 4096M. The limit applies per PHP process. If many PHP workers run at the same time, each worker can consume memory up to its configured limit.
PHP Memory Limit vs WordPress Memory Limit
WordPress memory settings and server PHP memory settings are related, but they are not always the same.
| Setting | Where It Is Set | What It Controls |
|---|---|---|
memory_limit |
php.ini, .user.ini, hosting panel, PHP-FPM pool |
The server-level PHP memory ceiling for scripts |
WP_MEMORY_LIMIT |
wp-config.php |
The memory WordPress requests for normal frontend requests |
WP_MAX_MEMORY_LIMIT |
wp-config.php |
The higher memory WordPress requests for admin/backend operations |
In simple terms:
WP_MEMORY_LIMITis usually for public-facing WordPress requests.WP_MAX_MEMORY_LIMITis usually for heavier admin tasks.memory_limitis the server-level PHP limit that may override or restrict what WordPress can request.
If your host caps PHP memory at 128M, adding 512M inside wp-config.php may not work. WordPress cannot always override a lower hard limit set by the hosting environment.
How Much PHP Memory Does WordPress Need?
There is no single perfect number for every WordPress site. A lightweight blog and a WooCommerce store with subscriptions, multilingual plugins, page builders, product filters, abandoned cart tools, and custom reports do not need the same memory limit.
Use this table as a practical starting point:
| Site Type | Suggested WP_MEMORY_LIMIT |
Suggested WP_MAX_MEMORY_LIMIT |
Notes |
|---|---|---|---|
| Simple blog | 128M | 256M | Good for lightweight themes and a small plugin stack |
| Small business website | 256M | 256M to 512M | Useful for contact forms, SEO plugins, caching, and moderate admin tasks |
| Elementor or Divi site | 256M | 512M | Admin editing usually needs more memory than normal visitors |
| WooCommerce store | 256M | 512M | Checkout, orders, reports, and product imports can be memory-heavy |
| Large WooCommerce store | 512M | 512M to 768M | Use with proper hosting, object cache, optimized queries, and log monitoring |
| Membership, LMS, or multilingual site | 256M to 512M | 512M | Complex user roles, translations, lessons, and dynamic pages increase memory use |
| Bulk imports, backups, or image regeneration | 256M to 512M | 512M to 1024M temporarily | Raise only during the task, then monitor and reduce if needed |
These values are not magic speed settings. They are ceilings. If your site only needs 90 MB for a request, setting the limit to 512 MB does not make that request faster. It only allows the request to use more memory if needed.
WordPress PHP Memory Limit Calculator Formula
The safest way to calculate a memory limit is to think beyond one request. You need to account for total server RAM, operating system overhead, database usage, cache services, PHP workers, traffic spikes, and background jobs.
Use this simple formula:
Available PHP RAM ÷ Target PHP Memory Limit = Approximate Safe PHP Workers
Example:
2 GB server RAM
- 700 MB reserved for OS, database, cache, and overhead
= 1.3 GB available for PHP
1.3 GB ÷ 256 MB = about 5 PHP workers
This does not mean every request will use the full 256 MB. Most requests use less. But the calculation helps you avoid setting a limit so high that a few concurrent heavy requests can starve the server.
Quick Calculator Table by Server RAM
The following table gives practical starting points. Adjust based on real error logs, traffic level, PHP-FPM worker settings, database size, cache hit rate, and plugin behavior.
| Server RAM | Best For | Suggested WordPress Memory | Suggested Admin Memory |
|---|---|---|---|
| 1 GB | Small blog or basic site | 128M | 256M |
| 2 GB | Business site or light WooCommerce | 256M | 256M to 512M |
| 4 GB | WooCommerce, page builder, LMS, membership | 256M to 512M | 512M |
| 8 GB | Growing WooCommerce or high-plugin site | 512M | 512M to 768M |
| 16 GB+ | Large store, busy membership, heavy admin workflows | 512M | 768M to 1024M for specific tasks |
For exact recommendations, use the FyrePress PHP Memory Limit Calculator. It helps estimate limits based on your available RAM and site complexity instead of relying on a random value copied from a forum.
Best Memory Limit by Website Type
For a Basic WordPress Blog
A clean blog with a lightweight theme, caching plugin, SEO plugin, and a few editorial tools usually does not need aggressive memory settings. Start with:
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' );
If you are not seeing memory errors, do not raise the limit just because another site recommends a larger number.
For a Small Business Website
A service website with forms, analytics, SEO tools, security plugins, custom blocks, and occasional page builder editing is safer at:
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' );
If the admin area uses a heavy page builder, increase the backend limit:
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
For Elementor, Divi, and Visual Builder Sites
Page builders can use more memory during editing than during normal frontend visits. The public page may be cached and lightweight, while the editor loads many controls, templates, style options, revisions, widgets, and dynamic data.
A practical baseline is:
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
If the editor still fails, do not immediately jump to 1024M. Check plugin conflicts, browser console errors, server logs, PHP version, caching conflicts, and database bloat.
For WooCommerce Stores
WooCommerce needs more memory than a basic blog because it handles products, carts, checkout sessions, payment callbacks, stock management, reports, orders, coupons, shipping rules, taxes, and often many extensions.
A safer WooCommerce baseline is:
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
For large stores, heavy imports, complex filters, subscriptions, bookings, multilingual catalogs, or advanced reporting, you may need:
define( 'WP_MEMORY_LIMIT', '512M' );
define( 'WP_MAX_MEMORY_LIMIT', '768M' );
Do this only if the server has enough RAM and your PHP-FPM worker configuration is sane.
For Imports, Exports, Backups, and Image Regeneration
Bulk operations can temporarily need more memory than normal traffic. Examples include product imports, media thumbnail regeneration, database search-replace, migration plugins, backup creation, and CSV exports.
For these tasks, a temporary admin memory increase may help:
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '768M' );
After the task is complete, monitor logs and reduce the limit if it is no longer needed.
How to Check Your Current WordPress Memory Limit
You can check your current memory limit in several ways.
Method 1: WordPress Site Health
Go to:
WordPress Dashboard → Tools → Site Health → Info → Server
Look for PHP memory limit and WordPress constants. This is the easiest method for non-technical users.
Method 2: WooCommerce Status
For WooCommerce stores, go to:
WooCommerce → Status
Review the WordPress memory limit and server environment values. If WooCommerce warns about memory, treat it as a sign to check both WordPress and server-level PHP settings.
Method 3: Create a PHP Info File
Developers can temporarily create a PHP info file to check server-level settings:
<?php
phpinfo();
Upload it privately, check memory_limit, then delete the file immediately. Do not leave PHP info files publicly accessible because they expose server details.
Method 4: WP-CLI
If you have SSH and WP-CLI access, run:
wp config get WP_MEMORY_LIMIT
wp config get WP_MAX_MEMORY_LIMIT
You can also inspect PHP itself:
php -i | grep memory_limit
How to Increase WordPress Memory Limit Safely
The safest method depends on your hosting environment. Some hosts allow wp-config.php overrides. Others require php.ini, .user.ini, control panel settings, or support intervention.
Option 1: Increase Memory in wp-config.php
Open wp-config.php and add the constants above the line that says:
/* That's all, stop editing! Happy publishing. */
Example:
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
If you are not comfortable editing wp-config.php, use the FyrePress wp-config.php Builder to generate a cleaner configuration block and reduce syntax mistakes.
Option 2: Increase memory_limit in php.ini
If you control the server or hosting environment, update php.ini:
memory_limit = 512M
After changing php.ini, restart the relevant PHP service if required. On PHP-FPM servers, that may involve restarting the PHP-FPM pool.
Option 3: Use .user.ini
Some shared hosting and PHP-FPM setups support .user.ini files. Add:
memory_limit = 512M
Changes may not apply instantly because PHP can cache user-level INI settings for a short period.
Option 4: Use .htaccess Carefully
On some Apache/mod_php setups, this may work:
php_value memory_limit 512M
However, on many modern PHP-FPM or CGI setups, adding php_value to .htaccess can trigger a server error. If your site shows a 500 error after this change, remove the line and use another method.
Option 5: Ask Your Hosting Provider
If your host enforces a hard cap, your local file changes may not work. In that case, ask support to raise PHP memory_limit for your account or move the site to a plan with more resources.
Why Setting Memory Too High Can Be Dangerous
Many WordPress users think, “If 256M is good, 1024M must be better.” That is not how PHP memory works.
The memory limit is a ceiling, not a speed booster. A higher limit allows a request to consume more memory, but it does not optimize the code, fix slow queries, reduce plugin bloat, or make the database faster.
Setting memory too high can create problems such as:
- One broken plugin consuming too much RAM.
- More frequent server swapping under load.
- PHP-FPM workers starving the database or cache service.
- Linux out-of-memory kills on small VPS servers.
- Hidden performance problems that should have been fixed properly.
A good memory limit gives WordPress enough room to complete legitimate tasks while still protecting the server from runaway processes.
Signs Your WordPress Memory Limit Is Too Low
You may need more PHP memory if you see these symptoms:
Allowed memory size exhaustedfatal errors.- White screen of death during plugin updates.
- WooCommerce checkout failures under normal conditions.
- Elementor, Divi, or block editor crashing while editing large pages.
- Image thumbnail regeneration stopping halfway.
- Migration or backup plugins failing without clear explanation.
- Product imports timing out or failing during processing.
- Admin reports loading halfway and then crashing.
If you are troubleshooting memory-related crashes, use the FyrePress WordPress Error Log Decoder to read the failure path and confirm whether memory is the real problem.
Signs Memory Is Not the Real Problem
Not every slow WordPress site needs more memory. Increasing the memory limit will not fix:
- Uncached pages under heavy traffic.
- Slow database queries.
- Bloated autoloaded options.
- Too many external scripts.
- Large unoptimized images.
- Poor hosting CPU performance.
- Badly coded plugins.
- Object cache misconfiguration.
- High bot traffic or brute-force attacks.
If the site is slow but not hitting memory errors, focus on performance diagnostics first. Check caching, database load, Core Web Vitals, plugin weight, server logs, and object cache behavior before raising memory aggressively.
Recommended Setup for Most WordPress Sites
For most modern WordPress websites, this is a safe starting configuration:
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
This gives normal frontend requests a reasonable ceiling while allowing heavier admin operations more room.
For a lightweight blog, you may use:
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' );
For a heavier WooCommerce or page builder site on a capable server:
define( 'WP_MEMORY_LIMIT', '512M' );
define( 'WP_MAX_MEMORY_LIMIT', '768M' );
Do not copy the largest value just because it looks safer. Calculate based on real server capacity.
Production Checklist Before Increasing Memory
Before raising the WordPress PHP memory limit on a live site, follow this checklist:
- Back up
wp-config.php. - Check the current PHP
memory_limit. - Check total server RAM and current RAM usage.
- Review PHP-FPM worker settings if you control the server.
- Confirm whether the site is using WooCommerce, page builders, LMS, or heavy plugins.
- Check error logs for actual memory exhausted errors.
- Make one change at a time.
- Test homepage, admin dashboard, editor, checkout, uploads, and scheduled tasks.
- Monitor logs for 24 to 48 hours after changing limits.
Common Mistakes to Avoid
- Setting memory to
1024Mon a small shared hosting account. - Using
memory_limit = -1on production. - Changing
WP_MEMORY_LIMITbut ignoring server-levelmemory_limit. - Increasing memory without checking logs.
- Using
.htaccessPHP values on a server that does not support them. - Assuming more memory always means faster pages.
- Ignoring PHP workers and total RAM.
- Leaving heavy import tasks running during peak traffic.
- Not testing WooCommerce checkout after server changes.
Best Workflow: Calculate, Apply, Monitor
The right memory limit is not the biggest number. It is the safest number that allows real WordPress tasks to finish without giving broken scripts unlimited room.
- Calculate: Use your server RAM, site complexity, and PHP worker count to estimate a safe limit.
- Apply: Update
wp-config.php,php.ini,.user.ini, or hosting panel settings. - Test: Check admin, editor, checkout, uploads, imports, and plugin updates.
- Monitor: Review PHP error logs, memory usage, and server load after deployment.
- Optimize: If memory keeps rising, investigate plugins, database queries, cron jobs, and background processes.
Start with the FyrePress PHP Memory Limit Calculator, then use the wp-config.php Builder or PHP ini Config Builder to prepare cleaner implementation values.
Final Verdict
Most WordPress sites do not need unlimited PHP memory. They need a balanced memory limit that matches the site’s workload and the server’s real capacity.
For small websites, 128M to 256M is often enough. For WooCommerce, page builders, LMS, membership sites, and heavy admin workflows, 256M to 512M is a better starting point. For large stores, imports, backups, and advanced operations, higher temporary limits may be valid, but only when the server can support them.
The safest answer is not “set everything to 1024M.” The safest answer is: calculate the limit, apply it carefully, test the site, and monitor real memory usage.
Use the FyrePress WordPress PHP Memory Limit Calculator when you want a practical estimate instead of guessing.
FAQs About WordPress PHP Memory Limit
What is the best PHP memory limit for WordPress?
For most WordPress sites, 256M is a safe baseline. Lightweight blogs may work with 128M, while WooCommerce stores, page builders, LMS sites, and membership sites often need 256M to 512M.
What is the difference between WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT?
WP_MEMORY_LIMIT usually applies to normal frontend WordPress requests. WP_MAX_MEMORY_LIMIT applies to heavier admin and backend operations, where WordPress often needs more memory for uploads, updates, editing, and processing tasks.
Is 512M too much for WordPress?
Not always. 512M can be reasonable for WooCommerce, page builders, imports, and complex admin workflows. However, it may be too high for small servers with limited RAM or too many PHP workers.
Should I set PHP memory_limit to -1?
No. Using -1 removes the memory ceiling and can allow one broken plugin or runaway script to consume too much server RAM. It is not recommended for production WordPress sites.
Why does WordPress still show memory exhausted after I increased the limit?
Your host may enforce a lower server-level PHP memory limit, or the change may be in the wrong file. It can also happen when a plugin, import, query, or background task is using abnormal memory and needs deeper troubleshooting.
Does increasing PHP memory make WordPress faster?
Not directly. A higher memory limit prevents memory-related failures, but it does not automatically improve speed. Caching, database optimization, image compression, plugin cleanup, and better hosting have a larger effect on performance.
How do I increase memory limit in wp-config.php?
Add define( 'WP_MEMORY_LIMIT', '256M' ); and, if needed, define( 'WP_MAX_MEMORY_LIMIT', '512M' ); above the “stop editing” line in wp-config.php. Back up the file first.
What memory limit does WooCommerce need?
WooCommerce generally needs at least 256M. Heavier stores with many products, extensions, subscriptions, reports, filters, or imports may need 512M or more, depending on server RAM and traffic.