HomeMethod

Knowledge

Web VitalsTechniquesSnippetsAnswersImpactsBottlenecks

Increase WP_MEMORY_LIMIT

  • WordPress

You can increase the WP_MEMORY_LIMIT by editing the wp-config.php file.

Add the following line to increase the limit:

increase-memory-limit.php
<?php
/**
 * Increase WordPress Memory Limit
 *
 * Raises the PHP memory available to WordPress scripts. The default is 40M
 * (256M for multisite). Increase it when you hit "Allowed memory size exhausted"
 * errors, especially with large imports or complex page builders.
 *
 * Usage: Add to wp-config.php, above the "That's all, stop editing!" line.
 *        Adjust the value as needed (128M, 256M, 512M).
 *
 * @category wordpress
 * @language php

 *
 * @author Adame Dahmani https://adame.io
 * @support Support my family project: https://adame.io/fundraiser
 */
define( 'WP_MEMORY_LIMIT', '256M' );

In the above example, the value 256M will allow scripts to use up to 256 megabytes of RAM.

Support our family now