Some WordPress plugins and themes require more memory than the default allocation. By default, WordPress sets the PHP memory limit to 40MB, which may not be sufficient for complex sites. On ruachost.com, you can increase the memory limit by editing the wp-config.php file.
Why Increase the Memory Limit?
-
Prevents “Allowed memory size exhausted” errors.
-
Ensures heavy plugins (e.g., WooCommerce, page builders) run smoothly.
-
Improves site stability and performance.
Steps to Change the WordPress Memory Limit
-
Log in to your hosting account (via cPanel or File Manager).
-
Navigate to your WordPress installation directory.
-
Locate and open the wp-config.php file.
-
Search for the following line (if it exists):
define( 'WP_MEMORY_LIMIT', '40M' ); -
Change the value to a higher limit, such as 64MB or 128MB:
define( 'WP_MEMORY_LIMIT', '128M' ); -
If the line does not exist, add the following code just above the line:
/* That's all, stop editing! Happy publishing. */Insert:
define( 'WP_MEMORY_LIMIT', '128M' ); define( 'WP_MAX_MEMORY_LIMIT', '256M' ); -
Save the file.
-
Log in to WordPress → Go to Tools → Site Health → Info → WordPress Constants to confirm the new memory limit.
Important Notes
-
Always back up your site before editing configuration files.
-
Use a child theme if editing theme‑related settings.
-
Increasing memory beyond what your server can handle may cause performance issues.