If WordPress runs out of PHP memory, a plugin, page editor or import may stop before it finishes. Requesting a memory limit of 256 MB can give a legitimate workload more room, provided your hosting configuration allows it. It is a capacity adjustment, not an automatic speed boost.
This guide explains how to check the current limit, request 256 MB safely and decide when the underlying problem needs investigation or a hosting upgrade.
What the PHP memory limit means
PHP is the software that runs much of WordPress. Its memory_limit sets how much memory a script can allocate. A limit written as 256M is commonly described as 256 MB. It is a per-script limit, not the total RAM included in your hosting account, and does not reserve that amount for every page visit.
WordPress also has settings that request memory for ordinary operation and more demanding administrative tasks. The effective allowance depends on PHP settings and whether the host permits WordPress to change them. See the PHP memory-limit reference for the underlying setting.
A message containing Allowed memory size exhausted is evidence that an operation hit its memory allowance. A slow page, blank screen or server error can have other causes, so do not assume that every fault is a memory problem.
Check the current limit first
- In WordPress, open Tools > Site Health > Info and expand the server information. Look for the PHP memory limit; administrative and ordinary request values may be reported separately.
- If WooCommerce is installed, also check WooCommerce > Status for the WordPress memory value and relevant server information.
- Record the values and the operation that fails, such as saving a page or importing products. Keep the exact error text if available.
If your effective limit already meets or exceeds 256 MB, do not reduce it just to match this article. A configured value is a ceiling, not a report of how much memory an operation actually uses. WooCommerce’s memory-limit guidance explains these checks.
Prepare for a safe change
Take a backup and make sure you can restore the file you intend to edit. Use a staging copy where practical, particularly for a shop. Read our backup restoration guide if you need help planning recovery.
Use your hosting file manager or SFTP and a plain-text editor. Do not use a word processor. Keep downloaded configuration backups privately on your computer rather than leaving extra copies in a public website folder. Configuration files can contain database passwords; never paste their complete contents into a public forum or ticket.
Method 1: request 256 MB in wp-config.php
The wp-config.php file is normally in your WordPress installation’s root directory, alongside folders such as wp-admin and wp-content. If you cannot identify the correct installation, ask support rather than editing another website’s file.
- Download a private backup of
wp-config.php, then open the original for editing. - Search for
WP_MEMORY_LIMITandWP_MAX_MEMORY_LIMIT. Update existing definitions instead of adding duplicates. Leave higher existing values alone unless support recommends changing them. - If absent, add the definitions below before the stop-editing comment and before WordPress loads
wp-settings.php. Keep them inside the existing PHP code; do not add another opening PHP tag. - Save the file and check both the website and dashboard.
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' );
WP_MEMORY_LIMIT requests the ordinary WordPress allowance. WP_MAX_MEMORY_LIMIT requests the allowance for administrative or other elevated tasks. These requests still depend on PHP allowing the change. See WordPress PHP optimisation guidance.
If saving introduces an error, restore the original file using your file manager or SFTP. Check straight quotes, parentheses and semicolons before trying again. For file placement and configuration conventions, use the official wp-config.php documentation.
Method 2: use hosting PHP settings
If your control panel provides editable PHP options, this is another way to change the PHP-level allowance without modifying WordPress code. The available controls depend on your account and server configuration.
- Open the hosting control panel and select the correct website or domain.
- Look for PHP settings or PHP options, if available. Locate
memory_limit. - If the permitted choices include it, select or enter
256Mand save. - Check the effective value in WordPress, then repeat the affected operation.
Do not switch PHP versions or change unrelated options just to find the memory setting. If the control is missing, locked or offers a lower maximum, ask Ginger to confirm what your account allows.
Method 3: a host-approved PHP configuration file
Some environments allow a per-directory .user.ini file; others use an approved php.ini configuration. Use this method only when the host confirms which file and location are supported.
memory_limit = 256M
For a supported .user.ini setup, edit or create the file in the location provided by support and preserve its other settings. It uses INI syntax, so the line above does not need PHP tags or a define() statement. Changes may take a few minutes to be reread.
The PHP documentation for .user.ini explains that this mechanism applies to CGI/FastCGI configurations. It is not universal. Do not create multiple configuration files and hope one works, or edit the server’s global configuration.
We recommend asking support instead of adding a generic php_value rule to .htaccess. Whether that works depends on the PHP handler, and an unsupported directive can cause a server error. A memory-limit plugin also cannot bypass your hosting restrictions.
Verify that the change worked
- Reopen the memory information in Site Health and, if relevant, WooCommerce Status. Compare it with the original values.
- Check the storefront, dashboard and the task that previously failed. For a shop, also check cart and checkout.
- If an error remains, note its time and exact wording so support can inspect the relevant logs.
You do not need to publish a PHP information page to check this. If WordPress still reports a lower limit, the wrong installation may have been edited, the server may not have reread a supported file, or the host may restrict overrides. If the error now occurs at the higher limit, investigate the workload rather than raising it repeatedly.
WooCommerce: 256 MB is a sensible starting point
A WooCommerce shop generally has a heavier workload than a basic WordPress website. Product data, carts and checkout add work, and larger plugins, page builders, payment gateways, subscriptions, imports and image processing can increase memory demand further.
Consider 256 MB a reasonable starting point, not a guarantee that every store or import will fit. WooCommerce’s server recommendations specify a WordPress memory limit of 256 MB or greater. The necessary headroom depends on the plugin combination, data size and work being performed.
Test demanding operations separately. For a large import, consider smaller batches and inspect the importer’s recommendations. A sudden increase after an update deserves investigation for a plugin issue or inefficient processing. More memory may let the operation finish without explaining why its requirements changed.
For payment and recurring-billing checks, read our payment gateway setup guide and WooCommerce Subscriptions guide.
More memory does not automatically mean more speed
Increasing the ceiling helps when a legitimate operation needs more memory than it was allowed. It does not automatically speed up a page that was already operating comfortably below that ceiling, fix a slow database query or remove heavy images and scripts.
Use our WordPress speed guide to measure the problem. Compare the same pages and operations before and after changes. Keep memory errors separate from slow response times and from account-wide resource restrictions.
Several simultaneous PHP processes share the account’s available resources. A 256 MB per-script allowance is not a promise that your plan can sustain unlimited concurrent processes using that much memory. If the site regularly reaches CPU, RAM, I/O or process limits, it may have outgrown shared hosting; confirm that with resource measurements and a review of the application.
When to open a support ticket
Open a Technical Support ticket if you cannot identify the correct file, cannot change the setting, are unsure about plan limits or still receive memory errors.
Include your website address, the current reported limit, the task that fails, the error text and time, and which method you tried. For WooCommerce, mention imports, page builders or other demanding extensions involved. Send redacted screenshots rather than configuration files containing secrets.
When to consider VPS hosting
A VPS becomes worth considering when an optimised WordPress or WooCommerce site consistently needs more capacity than its shared account can provide. Signs include repeated resource-limit events during ordinary traffic, slow checkout at busy times or background imports and renewals competing with customer requests.
With a suitably sized Ginger VPS hosting plan, you have an allocated pool of virtual CPU, RAM and storage resources for your environment, with more scope to configure PHP workers, memory allowances and background processing around the website’s needs. Virtual CPU allocation does not necessarily mean dedicated physical processor cores; the configuration and workload still matter.
A VPS can provide greater capacity and control, but it still needs sensible sizing, maintenance and application optimisation. We can review your traffic, concurrent work and resource usage through WooCommerce hosting and management support before recommending a move. Explore VPS hosting or contact our team to discuss the right next step.
Put the guidance into practice.
Need help with your website? Explore WordPress hosting, WooCommerce hosting and support or WordPress care.