# Raise the Memory Limit for Admin Tasks

> Gives memory-hungry admin tasks like image processing and imports more room, without raising the limit for every front-end visit.

- Type: PHP
- Runs: Run everywhere
- Category: [Performance](https://wpide.com/library/category/performance/)
- Tags: performance, memory, admin
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/raise-admin-memory-limit/

## Code

```php
// Memory available to admin screens, image editing and similar heavy tasks.
$wpide_admin_memory = '512M';

add_filter( 'admin_memory_limit', function () use ( $wpide_admin_memory ) {
    return $wpide_admin_memory;
} );

add_filter( 'image_memory_limit', function () use ( $wpide_admin_memory ) {
    return $wpide_admin_memory;
} );
```

## Notes

Your host's PHP limit still applies; this cannot go above it.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Raise the Memory Limit for Admin Tasks" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
