1. Home
  2. Troubleshooting
  3. Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in WordPress

Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in WordPress

This error means is that your site requires more memory than the default allocated memory provided by your server.

Solve this by increasing the PHP memory limit.

Update WP-Config

Edit the wp-config.php file on your WordPress site.

Copy this to the bottom of the file:

define( 'WP_MEMORY_LIMIT', '256M' );

This tells WordPress to increase the PHP memory limit to 256MB.

Update .HTACCESS

Edit the .htaccess file on your WordPress site.

Paste the following code before the line that says #END WORDPRESS.

php_value memory_limit 256M

This tells WordPress to increase the PHP memory limit to 256MB.

Update PHP.INI

Alternatively you can update PHP.INI to increase the memory limit. Find your PHP.ini file and look for this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ; Maximum amount of memory a script may consume                                                                                                                                                                                              ; https://php.net/memory-limit                                                                                                                                                                                                               memory_limit = 256M 

After updating, restart Apache.

Updated on December 12, 2023
Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Email: support@noc.org