"Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate X bytes)" β this means WordPress ran out of PHP memory. It is common after adding new plugins or when your WordPress database grows large. The number 67108864 = 64MB is the default PHP memory limit.
Most common causes we diagnose:
Systematic, fast, and safe process:
Add these lines before "That's all, stop editing!": define("WP_MEMORY_LIMIT", "256M"); define("WP_MAX_MEMORY_LIMIT", "512M");
Add php_value memory_limit 256M to .htaccess file. If on Nginx, contact your host to increase PHP-FPM memory_limit.
Use Query Monitor plugin to identify which plugins consume the most memory and find lighter alternatives.
Our WordPress expert responds in minutes.
Minimum 128M, recommended 256M, and for WooCommerce stores or sites with many plugins: 512M. The PHP memory_limit must also support this on the server side.
With high limits, the issue is usually a specific plugin with a memory leak. We use profiling tools to identify which exact plugin or code path is exhausting memory.
It's the PHP memory_limit allocated per request. WordPress default is 40M; modern sites need 256M or more. The error happens when a single request (page load, plugin process) tries to allocate more memory than this limit.
Heavier pages (admin, importing data, generating reports) allocate more memory. A page with a complex query, big image processing, or a poorly-coded plugin can exceed the limit while simpler pages stay under.
Up to a point. Hosting plans cap memory per process (256M-1024M typical). Beyond that, the issue is usually a memory leak, not legitimate need. We profile memory usage to fix the root cause instead of just bumping the limit.
Multiple places, in order of priority: PHP-level (php.ini), .htaccess (php_value memory_limit), WordPress (define WP_MEMORY_LIMIT in wp-config.php). The lowest of these wins. We verify which one your hosting actually applies.
Yes. A plugin loading all 50,000 posts into memory at once, or a poorly-written infinite loop, can exhaust 512M instantly. We use Query Monitor to find which plugin is the memory hog.
Cron jobs run multiple plugins simultaneously and can include heavy tasks (backups, image regeneration). Their combined memory usage often exceeds normal page loads. We split cron tasks or run them via real system cron with higher limits.
Yes β common with high-resolution photos. WordPress generates multiple thumbnail sizes during upload, each requiring memory proportional to image dimensions. We bump WP_MEMORY_LIMIT and use ImageMagick instead of GD for lower memory usage.
Yes. WP_MEMORY_LIMIT is for front-end (default 40M, recommend 256M). WP_MAX_MEMORY_LIMIT is for admin and cron (default 256M, recommend 512M). Setting both correctly handles different workload sizes.
Indirectly. Object caching (Redis/Memcached) reduces DB queries, which reduces PHP memory needed per request. Sites with object caching often need 30-50% less PHP memory.
Yes. If display_errors is off (good for production), a memory exhaustion can produce a blank page or 500 with no visible reason. We always check error logs for 'Allowed memory size exhausted'.
WooCommerce sites with 1000+ products and Elementor: 512M minimum. Heavy stores with subscriptions, marketplaces, or membership: 768M-1024M. We measure peak usage and right-size accordingly.
Yes. MySQL has its own memory pool (innodb_buffer_pool_size). When MySQL exhausts memory, queries fail and WordPress shows DB connection errors. We tune MySQL memory in addition to PHP.
Sometimes β if the plugin's data tables grew bloated with logs or transients. We clean expired transients, archive old logs, and optimize plugin tables before assuming the plugin is inherently memory-heavy.
Site showing a critical error? We diagnose and fix it fast β same day, no data loss.
Response in minutes. No data loss. No diagnosis charge.
wpfix.blimx.com