---
title: "Error: &#8220;Allowed memory size exhausted&#8221; when editing a View"
date: 2026-11-17
updated: 2026-11-17
author: "Rafael Bennemann"
link: "https://www.gravitykit.com/docs/gravityview/common-problems/view-editor-memory-exhausted/"
category: "GravityView > Common Problems"
---

When the View editor needs more memory than PHP allows, PHP stops the page before it finishes. Instead of the View editor, you see WordPress's message "There has been a critical error on this website."

![WordPress's critical error message, "There has been a critical error on this website. Please check your site admin email inbox for instructions.", shown in place of the View editor](https://www.gravitykit.com/wp-content/uploads/2026/11/wordpress-critical-error-view-editor.png)
*The same message can have other causes, so check the error log before you change anything*

## Confirm that memory is the cause

Look for a line like this in your server's error log, from the time you opened the View:

```
PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 2949120 bytes) in /wp-includes/script-loader.php on line 3080
```

- The first number is the limit in bytes: 268435456 bytes is 256 MB.
- The file at the end is where the page was when it ran out. It is often a WordPress file, and it doesn't mean that file is broken.

If your host doesn't give you an error log, [How to enable logging and use WP Debug in GravityKit](https://www.gravitykit.com/docs/gravityview/advanced/gravityview-logging-tools/) shows how to turn on the WordPress debug log from GravityKit's settings.

The separate Social Sharing & SEO plugin can cause the same message. If the log has no memory error and that plugin is active, see [The Yoast SEO box on a View is missing or shows an error](https://www.gravitykit.com/docs/gravityview/common-problems/my-yoast-meta-box-is-blank/).

On GravityView Pro 3.12.0 with All in One SEO active, the View editor can run out of memory however high the limit is. If that is your setup, update GravityView before you raise the limit.

## Why the View editor runs out first

The memory limit covers WordPress and every plugin that runs on the page. The View editor puts the form's fields, the layouts, the widgets and the View's settings on one page. On a test site it needed about as much memory as the block editor, and more than the other dashboard pages tested.

How much memory a page needs also depends on the server. On the same test site, the View editor needed 30.8 MB with PHP's OPcache on and 127 MB with it off.

## Raise the memory limit for dashboard pages

WordPress sets a separate memory limit for dashboard pages, named `WP_MAX_MEMORY_LIMIT`. It is 256 MB, unless your server's limit or `WP_MEMORY_LIMIT` is already higher. To raise it:

- Open `wp-config.php` in the main folder of your WordPress site, with your host's file manager or an FTP program.
- Add this line above the line that reads `/* That's all, stop editing! Happy publishing. */`:

```
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
```

- Save the file and open the View again.
If `wp-config.php` already has a `WP_MAX_MEMORY_LIMIT` line, change the value on that line. A second line has no effect, because PHP keeps the first value.

WordPress applies `WP_MAX_MEMORY_LIMIT` only for users who can manage the site's settings, which by default means administrators. If the error appears for someone with another role, also raise `WP_MEMORY_LIMIT`, the limit WordPress uses for every other page:

```
define( 'WP_MEMORY_LIMIT', '512M' );
```

## Check the new limit

1. Go to **Tools**, then **Site Health**, and click the **Info** tab.
2. Open the **Server** section.

![The Server section of Site Health Info, with PHP memory limit at 256M and the row PHP memory limit (only for admin screens) at 512M outlined](https://www.gravitykit.com/wp-content/uploads/2026/11/wordpress-site-health-php-memory-limit-admin-screens.png)**PHP memory limit** is the limit for the site's pages. When WordPress raises it for dashboard pages, a second row, **PHP memory limit (only for admin screens)**, shows the raised value.

If that row is missing while **PHP memory limit** is lower than the value you set, or a new error still names 268435456 bytes, WordPress didn't raise the limit. Check these:

- Your line is above the "That's all" line.
- `wp-config.php` has only one `WP_MAX_MEMORY_LIMIT` line.
- Your server lets WordPress change the limit. If it doesn't, your host can raise PHP's `memory_limit` for you.

In WordPress 7.0 and newer, the same **Server** section also has an **Opcode cache** row. If it doesn't say **Enabled**, ask your host to turn OPcache on.