Performance. Security. Support.
Customer area Français
Practical guide

Increase WordPress PHP memory to 256 MB

Check the effective limit and adjust WordPress within your hosting allowance.

Contents and related articles

1. Identify the failure

An “Allowed memory size exhausted” error means a request reached its memory limit. Record the operation: editing, importing or image processing. More memory does not automatically make a site faster or fix an unusually demanding plugin.

2. Read current values

In WordPress, open Tools → Site Health → Info and review Server and WordPress Constants. Note PHP and WordPress limits. Also check WooCommerce → Status where applicable. Per-request PHP memory is different from the account’s total RAM.

3. Confirm the hosting allowance

In DirectAdmin, look for PHP settings offered for your domain; availability depends on the account. If memory_limit is editable, choose an allowed value and save. Otherwise ask support whether 256 MB is appropriate. WordPress configuration cannot bypass a server restriction.

4. Update wp-config.php

Back up the file and edit through File Manager or secure access. Change an existing definition instead of duplicating it. Place the lines below before the stop-editing comment and before wp-settings.php is loaded. Leave database credentials untouched.

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

5. Verify the change

Reload Site Health and repeat the failed operation. If the value stays unchanged, another setting or the server may restrict it. Restore the saved file if a syntax error occurs. Do not publish a phpinfo page to inspect your account.

6. When 256 MB is not enough

Investigate the workload and plugins before raising limits further. WooCommerce recommends at least 256 MB, but large imports or integrations may need more. A higher setting does not add physical resources; a saturated site may need optimisation or a suitably configured VPS.

Related service

VPS hosting

Official documentation

Labels and options vary with versions, plugins and your account. Refer to publisher documentation for your configuration.

WordPress configuration

PHP optimisation

WooCommerce requirements

Still need help?

Find your services and conversations with our team in the client area.