---
title: Increase WordPress memory limit
canonical: https://wpsecurityninja.com/docs/errors-and-debugging/increase-wordpress-memory-limit/
---
Heavy plugins, large databases, or low host PHP limits can trigger memory exhausted errors. You can try raising the limit in `wp-config.php`. If the host caps memory below that value, ask the host to raise it.

## Edit wp-config.php

Add or update these lines above the “That’s all, stop editing!” comment:

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

Start with conservative values such as `256M` / `512M` unless you already know you need more. Very large numbers like `1024M` only help if the host allows them.

If the change has no effect, contact your host. Some environments ignore `WP_MEMORY_LIMIT`.

## Find the real cause

Memory pressure can also come from another plugin. Enable `WP_DEBUG` logging and inspect `/wp-content/debug.log`. See [How to use WP_DEBUG](https://wpsecurityninja.com/docs/errors-and-debugging/finding-errors-and-solutions/).
