How to Increase the WordPress Memory Limit Safely

Table of Contents

The WordPress memory limit controls how much PHP memory WordPress can use for a request. When the limit is too low, updates, page builders, imports, backups, or plugins may fail with a fatal error such as “Allowed memory size exhausted.”

Before increasing the WordPress memory limit

A higher limit can stop legitimate processes from failing, but it does not fix a memory leak, a broken plugin, or an undersized hosting plan. Create a backup, record the current limit, and identify what action triggers the error before changing configuration.

Check the current WordPress memory limit

In WordPress, open Tools → Site Health → Info → Server and review the PHP memory limit. Your host may also show the value in its PHP configuration panel. The WordPress limit and server-level PHP limit are related; WordPress cannot exceed a hard limit imposed by the host.

Method 1: edit wp-config.php

Use the hosting file manager or SFTP to open wp-config.php in the WordPress root directory. Add the following line above the comment that says to stop editing:

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

For administrator tasks, WordPress can use a separate maximum:

define( 'WP_MAX_MEMORY_LIMIT', '512M' );

Do not define the same constant more than once. Save the file, clear caches, and verify the value in Site Health.

Method 2: change the PHP limit in Hostinger

When WordPress cannot raise the limit, open Hostinger hPanel and go to the website’s PHP configuration. Find the memory-limit setting, choose a suitable value supported by the plan, save, and verify the change in WordPress Site Health.

The exact menu names may change, but the important point is that the server-level PHP limit must be at least as high as the WordPress limit you request.

Method 3: use php.ini or .user.ini

On hosting that allows local PHP configuration, add this setting to php.ini or .user.ini:

memory_limit = 256M

Some servers take several minutes to read updated .user.ini files. Managed hosting may ignore local overrides, in which case use the control panel or contact support.

Method 4: use .htaccess

Apache servers using the appropriate PHP handler may accept:

php_value memory_limit 256M

If this causes a 500 error, remove the line immediately. Many modern managed platforms do not allow PHP values in .htaccess.

How much memory does WordPress need?

Website type Practical starting point
Simple blog or brochure site 128M–256M
Page builder or larger plugin stack 256M
WooCommerce, imports, backups 256M–512M
Heavy processing Measure usage and review hosting resources

These are starting points, not targets. Allocating 512M does not make normal pages faster. It only gives a process permission to use more memory when required.

If the error continues after increasing memory

  1. Check the PHP error log for the exact file and plugin involved.
  2. Disable the suspected plugin on a staging site and repeat the action.
  3. Update WordPress, themes, and plugins.
  4. Remove overlapping optimization, backup, or security plugins.
  5. Break large imports into smaller batches.
  6. Run backups and reports away from peak hours.
  7. Ask the host whether the account is hitting CPU, process, or PHP-worker limits instead.

Common mistakes

  • Editing the wrong wp-config.php: Confirm the file belongs to the active installation.
  • Adding duplicate definitions: WordPress will use the first valid constant and may log warnings.
  • Setting an unlimited value: This can allow one faulty process to consume all available resources.
  • Assuming memory equals speed: Caching, queries, images, and scripts affect performance more directly.
  • Editing production without a backup: One syntax error can make the site unavailable.

Memory limit vs upload limit

The PHP memory limit is different from the maximum upload size, maximum post size, and execution time. Increasing memory will not automatically allow larger file uploads. Review the specific error before changing several values.

Does increasing memory improve SEO?

Not directly. It helps only when low memory causes failed pages, broken updates, timeouts, or instability. For search performance, focus on reliable uptime, fast pages, useful content, and correct indexing. Our website speed guide covers the broader performance work.

Final recommendation

Raise the WordPress memory limit conservatively, verify the result, and investigate the process that needed more memory. If normal requests continuously consume hundreds of megabytes, audit the plugin stack and hosting resources instead of repeatedly increasing the limit.

For high-load planning, see how to handle high traffic on WordPress and our shared hosting vs VPS comparison.

Frequently asked questions

Is 256M enough for WordPress?

It is enough for many websites. WooCommerce, large imports, backups, and complex page builders may require more for specific administrator tasks.

Why does Site Health still show the old limit?

The host may enforce a lower server limit, the configuration file may be in the wrong location, or PHP may not have reloaded the setting yet.

Can a plugin increase the memory limit?

A plugin can request a higher value, but it cannot bypass a server-level restriction. Editing configuration or using the hosting panel is more reliable.

Get a Free Website Growth Audit​

Find out what is stopping your website from generating more enquiries, trust, and sales.

What You Get:
– Homepage clarity review
– SEO structure check
– Speed and mobile review
– Lead capture review
– Conversion improvement suggestions

Best For:
– Small businesses
– Consultants
– Coaches
– Local service providers
– eCommerce stores
– Businesses with low website enquiries

bennie tay logo

We are a leading website design Malaysia service provider, offering complete website solutions to boost your online presence.

Affiliate Disclaimer:

This site is owned and operated by Bennie Tay.  Bennietay.com is an independent ClickFunnels Affiliate, not an employee. Bennietay.com receives referral payments from ClickFunnels. The opinions expressed here are solely from Bennietay.com and are not official statements of ClickFunnels or its parent company, Etison LLC.  This site also participates in other affiliate programs and is compensated for referring traffic and business to these companies.

© All Rights Reserved.