How to Increase the WordPress Memory Limit to 256MB

Estimated reading: 3 minutes 64 views

If you’re experiencing issues with your WordPress site due to insufficient memory, you can increase the memory limit to improve performance. This tutorial will show you how to increase the WordPress memory limit to 256MB using several methods.

Step 1: Backup Your Site Before making any changes, it’s always a good idea to create a backup of your site in case anything goes wrong. You can use a plugin like UpdraftPlus or BackWPup to create a full backup of your site’s files and database.

Step 2: Edit the wp-config.php File

  1. Connect to your site’s server using an FTP client like FileZilla or through your web hosting’s file manager.
  2. Locate the ‘wp-config.php’ file in the root directory of your WordPress installation.
  3. Open the ‘wp-config.php’ file in a text editor.
  4. Look for the line that says, “/* That’s all, stop editing! Happy blogging. */”
  5. Just before this line, add the following code:
define('WP_MEMORY_LIMIT', '256M');
  1. Save and close the wp-config.php file.
  2. Refresh your site to ensure that everything is working properly.

Step 3: Edit the PHP.ini File If the above method doesn’t work, you can try increasing the memory limit through the PHP.ini file.

  1. Connect to your site’s server using an FTP client or the file manager provided by your web host.
  2. Locate the ‘php.ini’ file in your server’s root directory. If you can’t find it, create a new file and name it ‘php.ini’.
  3. Open the ‘php.ini’ file in a text editor.
  4. Add or modify the following lines:
memory_limit = 256M
post_max_size = 64M
upload_max_filesize = 64M
  1. Save and close the PHP.ini file.
  2. Restart your web server or ask your hosting provider to do it for you.

Step 4: Edit the .htaccess File If neither of the above methods works, you can try increasing the memory limit through the .htaccess file.

  1. Connect to your site’s server using an FTP client or the file manager provided by your web host.
  2. Locate the ‘.htaccess’ file in your server’s root directory.
  3. Open the ‘.htaccess’ file in a text editor.
  4. Add the following lines at the end of the file:
php_value memory_limit 256M
php_value post_max_size 64M
php_value upload_max_filesize 64M
  1. Save and close the .htaccess file.
  2. Refresh your site to ensure that everything is working properly.

Step 5: Verify the Increased Memory Limit

  1. Log in to your WordPress admin dashboard.
  2. Install and activate the “WP-ServerInfo” plugin.
  3. Navigate to “Dashboard” > “WP-ServerInfo.”
  4. Check the “PHP Memory Limit” value to confirm that it now displays “256M.”

Step 6: Contact Your Hosting Provider If you’re still unable to increase the memory limit, contact your hosting provider for assistance. Some hosting providers have restrictions in place that prevent users from modifying server settings, and they may need to make the change on your behalf.

Conclusion: Increasing the WordPress memory limit to 256MB can help improve your site’s performance and resolve issues related to insufficient memory. Always remember to create a backup of your site before making any changes, and use the methods outlined above to increase the memory limit. If you need further assistance, don’t hesitate to reach out to your hosting provider.

Leave a Reply

Your email address will not be published. Required fields are marked *

Share this Doc

How to Increase the WordPress Memory Limit to 256MB

Or copy link

CONTENTS