< All Topics
Print

How to Increase the PHP Memory Limits in WordPress

To increase the PHP memory limit in WordPress, you can follow these steps:

  1. Locate the wp-config.php file: Connect to your WordPress site using an FTP client or access the file manager provided by your hosting control panel. Look for the “wp-config.php” file in the root directory of your WordPress installation.
  2. Create a backup: Before making any changes to the file, it’s always a good practice to create a backup of the original “wp-config.php” file. This ensures that you can restore the file in case any issues arise.
  3. Open the wp-config.php file for editing:
  4. Add the memory limit code: Locate the line that says /* That's all, stop editing! Happy blogging. */ near the end of the file. Just above that line, add the following code:

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

This code increases the PHP memory limit to 256 megabytes (MB). You can adjust the value as needed based on your site’s requirements. Some plugins or themes may require higher memory limits.

  1. Save and upload the modified file: After adding the code to increase the memory limit, save the wp-config.php file on your computer. Then, upload it back to the root directory of your WordPress installation, replacing the existing file.
  2. Verify the increased memory limit: To confirm that the PHP memory limit has been increased, you can use a plugin like “WP-ServerInfo” or “PHP Info” that displays server information. Install and activate the plugin, then visit the corresponding settings page to check the PHP memory limit.

By following these steps, you should be able to increase the PHP memory limit for your WordPress site. However, note that some hosting providers may have restrictions on increasing the memory limit, and you may need to consult with your hosting support for further assistance if the changes don’t take effect.