The "Allowed memory size of X bytes exhausted" error means a plugin, theme, or WordPress process tried to use more memory than PHP was allowed to give it, so PHP stopped it. It usually shows up as a blank section of a page or a full white screen with this message written in plain text. Raising the memory limit fixes most cases, though a poorly coded plugin can also be the real culprit.
Step 1: Raise the WordPress memory limit
- Connect to your site's files using the File Manager in your control panel, or an FTP client.
- Open wp-config.php, found in your WordPress installation's root folder.
- Find the line that reads /* That's all, stop editing! Happy publishing. */.
- Just above that line, add: define('WP_MEMORY_LIMIT', '256M');
- Save the file and reload your website to see if the error is gone.
WP_MEMORY_LIMIT only raises the ceiling WordPress itself asks for. If your hosting account's PHP memory limit is set lower than this value, PHP will still cut it off there. Step 2 raises that underlying server limit.
Step 2: Raise the server's PHP memory limit
In cPanel
- Log in to cPanel and open MultiPHP INI Editor under the Software section.
- Select your domain from the dropdown, or switch to Editor Mode for full control.
- Find memory_limit and set it to 256M or higher.
- Click Apply (or Save) and reload your website.
In DirectAdmin
- Log in to DirectAdmin and open Select PHP Version under the Extra Features or Software section.
- Click Switch to PHP options (or the equivalent settings link for your version).
- Find memory_limit and change it to 256M or higher.
- Click Save and reload your website.
If you don't see a memory_limit option in either panel, or your account's plan caps it below what you need, contact support and ask for it to be raised.
If the error keeps coming back
A high memory limit that still gets exhausted usually points to one plugin or theme consuming far more memory than it should, often after an update. Deactivate your plugins one at a time (or all at once, then reactivate them one by one) to find the one causing the spike, and check whether an update is available for it.
Avoid setting the memory limit unreasonably high (such as 2G or more) just to make the error disappear. It masks the real problem and can slow the whole server down if a runaway process keeps consuming memory unchecked.
For a broader look at PHP limits beyond memory, see How to Increase PHP Upload and Memory Limits for Your Website.