HomeHow ToIncrease Memory Limit in Wordpress

Increase memory limit in WordPress

Do you have a website running on WordPress CMS? Maybe this article interests you. One of the common errors in WordPress, especially on websites that are “overloaded”, is that the default memory is not enough to run everything properly. This is how errors like

wp-admin page Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 122880 bytes) in /myphpfile.php on line 127

WordPressIf you try to find a solution to the problem from Google, many will refer you to making edits to the wp-config.php file to increase the memory limit set by WordPress. However, the WP_MEMORY_LIMIT that they tell you to “tweak” does not exist in the file. So before you start adding additional code to this file, try opening the default-constants.php file from the /wp-includes/ path.

The memory settings used by WordPress 4, including WP_MEMORY_LIMIT, are located in default-constants.php. Change the values ​​as shown below and you're good to go.

 // set memory limits if ( !defined('WP_MEMORY_LIMIT') ) { if( is_multisite() ) { define('WP_MEMORY_LIMIT', '64M'); } else { define('WP_MEMORY_LIMIT', '40M'); } }

Change it to

// set memory limits if ( !defined('WP_MEMORY_LIMIT') ) { if( is_multisite() ) { define('WP_MEMORY_LIMIT', '64M'); } else { define('WP_MEMORY_LIMIT', '96M'); } }

If the problem persists, contact your server administrator to change the PHP memory limit.

📧
Subscribe to the SecNews Newsletter

The most important Security & Technology news in your Inbox.

SecNews
SecNewshttps://www.secnews.gr
In a world without fences and walls, who needs Gates and Windows

SEARCH

FOLLOW US

📧
Newsletter SecNews
The most important Security & Technology news in your inbox.

LIVE NEWS