To fix the “WordPress Memory Exhausted” error by increasing PHP memory, you can follow these steps:
Method 1: Edit wp-config.php
- Access Your WordPress Files: You can do this via FTP or through your hosting provider’s file manager.
- Locate
wp-config.php
: This file is in the root directory of your WordPress installation. - Edit
wp-config.php
: Open the file and add the following line before the line that says/* That's all, stop editing! Happy publishing. */
:phpdefine('WP_MEMORY_LIMIT', '256M');
You can adjust
'256M'
to a higher value if needed. - Save Changes: Save the file and re-upload it if you’re using FTP.
Method 2: Edit .htaccess
- Access Your
.htaccess
File: This file is also in the root directory of your WordPress installation. - Edit
.htaccess
: Add the following line at the end of the file:apachephp_value memory_limit 256M
Again, you can adjust
'256M'
as needed. - Save Changes: Save and upload the file if necessary.
Method 3: Edit php.ini
- Access Your php.ini File: This file may be located in your server’s root directory or in a specific directory for your site. If you can’t find it, contact your hosting provider for assistance.
- Edit
php.ini
: Add or modify the following line:inimemory_limit = 256M
Adjust
'256M'
as needed. - Restart Your Server: Some changes to
php.ini
require a server restart to take effect. You might need to restart your web server or contact your hosting provider for assistance.
Method 4: Contact Your Hosting Provider
If you don’t have access to these files or if changes don’t take effect, contact your hosting provider and request an increase in PHP memory. They can adjust the settings for you or provide further guidance.
After applying any of these methods, check if the error is resolved by visiting your WordPress site. If the issue persists, you might need to investigate further or consult with a developer.