Why Your WordPress Site Keeps Throwing a Memory Limit Error — And How to Actually Fix It

errors

When WordPress can't finish loading a page because it ran out of memory, you get a memory limit error. It stops your site cold, sometimes on the front end, sometimes in the admin dashboard, and sometimes both at once. This guide covers why it happens, how to fix it, and what to change so it doesn't keep coming back.

Why Your WordPress Site Keeps Throwing a Memory Limit Error — And How to Actually Fix It

Key Takeaways

Key Takeaways
Photo by Vie Studio on Pexels

What Causes a WordPress Memory Limit Error

A WordPress memory limit error happens when PHP tries to use more RAM than your server has set aside for it. ([C-PENDING — no citation provided]) Every page load triggers PHP to pull your active theme, every active plugin, and WordPress core into memory at once. If the combined total crosses the server's memory cap, PHP stops and throws the error.

Plugins are the most common cause. Each active plugin adds to the memory load on every page request, even pages where that plugin does nothing. A site running twenty plugins carries twenty plugins' worth of overhead on every load. Poorly coded plugins make this worse. They may hold onto memory longer than needed or load resources they never use.

Operations like importing a product CSV, processing a batch of image uploads, or running a database export spike memory demand temporarily. These tasks require significantly more RAM than a normal page load. If your memory cap is already close to your site's baseline usage, these operations push it over.

Shared hosting plans often set PHP memory limits at 64MB or lower. That number made sense for simpler sites, but a standard WordPress install with a page builder and a handful of plugins can exceed it without doing anything unusual.

Is the "Allowed Memory Size Exhausted" Message Always the Same?

The error message isn't always worded the same way, but "allowed memory size exhausted" is the most common version. It includes two pieces of useful information: the byte count that was exceeded, and the file path where PHP stopped. That file path tells you which plugin, theme file, or WordPress function ran out of room.

Enable WordPress debug mode to surface the full error when it's being suppressed. Add define('WP_DEBUG', true); to your wp-config.php file and reload the page. You can also check your current PHP memory allocation in the WordPress admin under Tools, then Site Health, then Info. Reading the error first saves you from raising the limit without knowing why it was hit.

How to Increase PHP Memory Limit in WordPress

There are four ways to raise the PHP memory limit, and they don't all work in every hosting environment. Start with the method that matches your level of server access.

Edit wp-config.php

Open your wp-config.php file and add this line above the /* That's all, stop editing! */ comment:

define('WP_MEMORY_LIMIT', '256M');

This tells WordPress to request 256MB from the server. The server still controls the actual ceiling. If your host caps PHP memory at 128MB, this line won't go beyond that cap.

Editing wp-config.php to Raise the Memory Limit

This method works well on managed WordPress hosting and VPS plans where the server ceiling is set high enough. On shared hosting, the server-level limit often overrides the WordPress request. If the error continues after adding this line, the server cap is blocking it and you'll need one of the methods below.

Edit .htaccess

On Apache servers, add this to your .htaccess file:

php_value memory_limit 256M

Some shared hosts allow PHP value overrides through .htaccess. Others block it. If the line causes a server error, remove it and try a different method.

Edit php.ini

If you can access your server's php.ini file, set the limit there:

memory_limit = 256M

This overrides both WordPress and .htaccess settings. It's the most direct method, but most shared hosting plans don't give you access to php.ini. Managed WordPress hosts and VPS plans typically do.

Contact Your Hosting Provider

If none of the above methods work, your host can raise the limit from their end. Most providers will do this on request. Some shared hosting plans have hard ceilings that require a plan upgrade to pass.

What Limit Should You Set?

A minimum of 64MB covers basic WordPress sites. Sites running WooCommerce, page builders, or many plugins typically need 256MB. Complex or high-traffic sites sometimes run at 512MB.

([C-PENDING — no citation provided]) Newer PHP versions use memory more efficiently than older ones. If your site runs an outdated PHP version, upgrading it can lower memory consumption without changing the limit at all. It's worth checking your PHP version before assuming you need a higher cap.

Reduce WordPress Memory Usage for a Long-Term Fix

Raising the limit stops the error today. Reducing WordPress memory usage is what keeps it from coming back. If your site consumes memory inefficiently, it'll hit the ceiling again, even after you raise it.

Remove Plugins You Don't Actually Use

Every active plugin loads on every page request. Go through your plugin list and deactivate anything you installed to test, anything that duplicates another plugin's function, and anything you haven't used in months. Then delete them. Deactivated plugins don't load, but they still create clutter.

For plugins you keep, check when they were last updated. A plugin with no updates in two years may be loading resources in ways that newer alternatives don't. Replacing one outdated plugin with a maintained equivalent can meaningfully reduce memory use.

Choose a Theme That Loads Only What You Need

Multipurpose themes often load large CSS and JavaScript libraries on every page, whether or not the current page uses those features. A purpose-built theme for your specific site type loads only what it needs. This change is particularly effective for sites where the theme is contributing to memory pressure.

Add Object Caching

Object caching stores the results of database queries so PHP doesn't have to run the same queries repeatedly. Tools like Redis or Memcached handle this at the server level. Many managed WordPress hosting platforms include object caching by default. If yours does, make sure it's active.

Compress Images Before Uploading

PHP doesn't consume significant memory serving images to visitors. It does consume memory when processing them, such as when WordPress generates thumbnail sizes after an upload. Compressing images before you upload them reduces the memory demand of that processing step.

Limit Revisions and Clear Database Bloat

WordPress saves a new revision every time you update a post. On an older site, this can mean thousands of stored revisions. Limiting the revision count in wp-config.php and clearing old ones reduces database overhead, which lowers the work PHP has to do on each request.

WooCommerce Memory Issues and Page Builder Demands

WooCommerce memory issues and the demands of page builders like Elementor and Divi are among the most common reasons WordPress sites hit memory limits. WooCommerce tracks cart sessions, manages product data, and handles checkout processing all at once. Page builders load their editing frameworks on every admin page, not just the pages you're actively editing.

Neither of these tools is doing something wrong. They're doing a lot, by design. If you're running WooCommerce or a page builder and hitting memory limits, the hosting environment needs to match the workload. ([C-PENDING — no citation provided])

Shared hosting pools resources across many accounts, so memory limits are set low to protect other users on the same server. VPS hosting gives you a dedicated resource slice, which means you set the PHP memory limit based on what your site actually needs. Managed WordPress hosting is built for WordPress workloads. Providers in this category configure PHP memory at levels that account for plugins like WooCommerce and don't require you to manually adjust server settings. When optimization alone isn't enough, moving to a better-matched hosting plan is the right next step.

The Bottom Line

A memory limit error tells you something specific: your WordPress site is trying to use more resources than its current environment allows. The cause might be a single poorly coded plugin, a spike from a batch operation, or a hosting plan that was never sized for what your site has grown into.

Raising the PHP memory limit resolves the immediate error. Cutting unused plugins, adding object caching, and running a current PHP version reduce what your site actually consumes. Choosing a hosting environment that matches your workload stops the cycle from repeating. If you're not sure where the problem is on your specific site, a WordPress or hosting professional can help you find it.

FAQs

What does "allowed memory size exhausted" mean in WordPress?

This error means PHP ran out of the memory your server allocated to it before it could finish loading the page. The error message includes the byte limit that was exceeded and the file path where PHP stopped, which points toward the plugin or theme file responsible.

How do I check my current PHP memory limit in WordPress?

Go to Tools, then Site Health, then Info in your WordPress admin dashboard. The PHP memory limit appears there. You can also check it by running a page that outputs phpinfo(). Both methods show the limit your server is currently enforcing.

What PHP memory limit should I set for WordPress?

Set 64MB as the floor for a basic site. Sites running WooCommerce, page builders, or many plugins typically need 256MB. Complex or high-traffic sites sometimes require 512MB. Base the number on your site's actual workload rather than a generic default.

Why does my memory limit error keep coming back after I increase the limit?

A recurring error means your site's memory consumption is growing faster than the cap you set. The cause is usually an inefficient plugin, a memory-intensive operation, or a site that has outgrown its hosting plan. Raising the limit again is a short-term fix. Optimization and a hosting review address the actual problem.

Does my hosting plan affect my WordPress memory limit?

Yes. Your hosting plan sets the ceiling on how much PHP memory your site can access. Shared hosting plans cap memory low by default. VPS and managed WordPress hosting plans give you higher limits and more control. If your host's ceiling is below what your site needs, a plan upgrade is likely necessary.

Sources

  • [C-PENDING — No citations were provided in the metas Citations array. This section will be populated once citation URLs are supplied by the editorial team.]

Business name: Nova Blog

Website URL: (not provided)

Primary keyword: memory limit error

Blog topic: Memory Limit Error

Secondary keywords: (not provided in metas — derived from industry research)

Keyword variations used: WordPress memory limit error, PHP memory limit, increase PHP memory limit, allowed memory size exhausted, WordPress memory limit, reduce WordPress memory usage, WordPress hosting memory limit, WooCommerce memory issues, wp-config.php memory limit, WordPress debug mode, PHP memory limit WordPress

Link to Service Page: (not provided)

Questions: (not provided — FAQs auto-generated)

Topic summary: Nova portal blog post targeting memory limit error (170/KD 26). Technical, honest, grounded in the platform stack (OpenLiteSpeed tenants, K8s isolation, GCS backups, WAF).

Curated citations: (none provided)

Target word count: 1400

Citations array: (empty — no citations provided)


Business Profile Summary (Reproduced Verbatim)

Business Profile: Nova Blog


⚠️ Analysis Notice

> Insufficient data provided. The website content field is empty, and only a company name ("Nova Blog") and domain were supplied. A meaningful business profile cannot be accurately extracted without actual website content.


Partial Profile (Based on Name Inference Only)

> ⚠️ The following is speculative inference based solely on the name "Nova Blog" and should not be treated as verified information.

| Field | Inferred Value |

|---|---|

| Company Name | Nova Blog |

| Likely Industry | Digital Media / Content Publishing / Blogging Platform |

| Confidence Level | Very Low |


What's Needed for a Complete Profile

To generate an accurate and comprehensive business profile, please provide any of the following:

  • [ ] Homepage copy (hero text, taglines, value propositions)
  • [ ] About Us page content
  • [ ] Services or Products page content
  • [ ] Blog or editorial content samples
  • [ ] Footer text (often contains mission/legal info)
  • [ ] Meta descriptions or SEO tags
  • [ ] Pricing page content
  • [ ] Testimonials or case studies

Profile Template (Ready to Populate)

Once content is provided, the following sections will be completed:

🏢 Company Overview

  • Company Name:
  • Industry:
  • Founded / Location:
  • Mission Statement:

🛠️ Services / Products Offered

-

🎯 Target Audience

-

🗣️ Brand Voice & Tone

-

💡 Unique Selling Propositions (USPs)

-

🔑 Key Differentiators

-

📊 Business Model

-

🌐 Digital Presence Indicators

-


Please resubmit with the actual website content to receive a complete and accurate analysis.

See What's Included With Nova Managed Hosting

Nova runs every managed WordPress tenant in an isolated Kubernetes namespace with daily automated backups and managed core/plugin updates. If you're troubleshooting a specific issue on your own site, our team can help.