When you first start using hosting, you are usually still using the default settings and need to increase the WordPress memory limit so your website can run smoothly.
Requirements for Increasing WordPress Memory Limit
- Have access to the .htaccess file, or
- Have access to the wp-config.php file
- The max memory limit has not reached the maximum threshold set by the hosting provider
Issues Caused by Insufficient WordPress Memory Limit
- The website displays a 500 error code
How to Determine if an Error is Caused by Insufficient Memory Limit
- Open the hosting file manager, or a local file manager (if you are not using hosting yet)
- Search for the file error_log
- Make sure the error_log was updated today, or the last time you encountered the error
- Open the error_log file, and check the last line of the file.
- If you see Fatal error: Allowed memory size of XXXXX bytes exhausted or Fatal error: Out of memory, then the cause of your website error is an insufficient memory limit.
Actually, increasing the memory limit can be done through PHP configuration in Plesk, cPanel, CyberPanel, and similar tools. However, because not all WordPress sites use or have access to those, this method only covers the .htaccess and wp-config.php files.
If you do not have access to a control panel file manager like cPanel, Plesk, and so on, you can use a file manager plugin in WordPress
How to Increase Memory Limit via .htaccess
- Open the file manager in your hosting, or a WordPress plugin
- Search for the file named .htaccess
- If it is not found, you can look for the settings menu and enable the feature Show Hidden Files
- Edit the file .htaccess
- Add the following code below the line # END WordPress
php_value memory_limit 256MAdjust 256 to the limit you want to apply in MB
- Save File
- Open your WordPress website again.
- If you are using a cache plugin, you can clear the cache first after saving the .htaccess file
How to Increase Memory Limit via wp-config.php
- Open the file manager in your hosting, or a WordPress plugin
- Search for the file named wp-config.php, then edit the file
- Add the following code above the line /* That’s all, stop editing! Happy publishing. */ or /* That’s all, stop editing! Happy blogging. */
define ( 'WP_MEMORY_LIMIT', '256M' );Adjust 256 to the limit you want to apply in MB
- Save File
- Open your WordPress website again.
- If you are using a cache plugin, you can clear the cache first after saving the .htaccess file
COMMENTS
Loading...