New 24/7 monitoring and daily cloud backups now included in every Shield Pro plan.

Configuration

How to increase the WordPress PHP memory limit

Memory exhausted fatals appear during large imports, plugin updates, and page builder saves. WordPress can request more PHP memory through wp-config and server settings.

Time: 15-25 minutes Level: Beginner

What this problem looks like

WordPress default memory is often 40M, which is tight for WooCommerce and builders. WP_MEMORY_LIMIT asks PHP for more per request.

Raising memory treats the symptom. Bloated plugins or runaway queries still need investigation on busy sites.

Very high memory limits on shared hosting may get your account suspended. Increase gradually and ask the host what cap they allow.

Set memory in wp-config.php

WP_MEMORY_LIMIT applies to front-end requests. WP_MAX_MEMORY_LIMIT applies to admin tasks such as updates.

php
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

Change PHP memory_limit in hosting

cPanel MultiPHP INI Editor and Plesk PHP settings control the server ceiling. WordPress cannot exceed php.ini memory_limit.

  • Set memory_limit to 256M or 512M for builder sites.
  • Restart PHP-FPM if the host requires it after INI changes.

Verify current limits

bash
wp eval 'echo WP_MEMORY_LIMIT . "\n";'
php -i | grep memory_limit
A phpinfo() page in a staging copy shows effective limits when hosting panels are unclear.

When raising memory does not help

Infinite loops and broken queries still exhaust any limit. Enable WP_DEBUG_LOG and profile heavy plugins.

Consider object caching and disabling admin plugins you do not need during imports.

WooCommerce and import guidance

Product CSV imports and translation plugins often need 512M temporarily. Lower limits after the job completes if the host prefers it.

When to stop DIY and hire help

Chronic memory errors on production shops need code-level fixes, not only INI tweaks. BugShield diagnoses memory and performance issues at a confirmed fixed price.

FAQs

What is a good memory limit for WordPress?

128M to 256M suits most brochure sites. WooCommerce and builders often need 256M to 512M for admin tasks.

Can I set memory in .htaccess?

On some Apache hosts php_value memory_limit works. PHP-FPM nginx stacks use php.ini instead.

Will this speed up my site?

Higher memory prevents fatals but does not replace caching and lean plugins for speed.

Why does admin need more memory than the front end?

Dashboard loads every plugin admin module at once. WP_MAX_MEMORY_LIMIT targets that heavier footprint.

Rather someone else fixed it?

Request a fix at a confirmed price. Named UK developer, secure Vault, direct chat.

Request a Fix