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.
Opens WPIDE on
Code
// 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 add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.