One of the most well-known and adaptable CMS (content management systems) available today is, without question, WordPress. Millions of websites all around the world are powered by it. Conversely, when your website grows and acquires more complexity, you could periodically experience performance issues because of memory limitations.
Users of WordPress regularly face memory limit issues, which can cause problems and impair the site’s ability to function properly. This is a typical issue. We will look into the elements that affect WordPress’ memory limits in this post, and then we will walk you through the procedures required to raise those limits to get the optimum performance for your website.
An Explanation of WordPress’ Memory Limit WordPress’ memory limit denotes the maximum amount of memory it can use while carrying out its tasks. This restriction may cause issues for WordPress processes, including the infamous “Fatal Error: Allowed Memory Size Exhausted” message.
Fatal error: Allowed memory size of 41943040 bytes exhausted fatal error allowed memory size “
This warning lets you know that your website has run out of memory and can’t perform some actions. The likelihood that WordPress’ memory limit will be exceeded/controlled can be increased by highly sophisticated plugins, theme configurations, and manual processes.
Before going any further, Let’s start with a simple definition of PHP memory limit and default values for memory limit in WordPress!
What is the WordPress PHP memory limit?
The PHP memory limit for WordPress is a server-side configuration that determines the maximum amount of memory (RAM) that PHP scripts can allocate while running on your WordPress website. It helps ensure that PHP scripts have enough memory to execute efficiently and avoid memory-related errors or crashes.
The default PHP memory limit for WordPress is often set to 32MB or 64MB, depending on the server configuration. However, the memory requirements of a WordPress website can vary based on the theme, plugins, and complexity of the site.
You can increase the limit by taking advice from your hosting support. Or hire a professional developer to customize the limit to match your site requirements. A memory limit of 128MB is generally enough for WordPress CMS though with cloud servers it can vary with your site traffic on different locations.
How to Increase Your WordPress Site’s Memory Limit Step by Step:

Before starting to change the Memory limit, there are some steps that you should understand and consider these server customizations.
- Current memory limit should be known: Before making any changes, you must ascertain the WordPress website’s current memory limit. You can ask your hosting company for help or use the WordPress Health Check plugin to retrieve this data.
- Create a backup of your website: Every time you make changes to the configuration of your website, you must create a backup of it. You can quickly restore your website if something goes wrong while the process is completed.
Editing your wp-config.php file
By default memory limit is defined in wp-config.php in the installation files. Now let’s move on to your server files and find wp-config.php (Use developer guidance if possible)
WP-Config.php file modification: Open the wp-config.php configuration file in a text editor, then find the line that defines the RAM cap. Ideally, it should resemble this:
define('WP_MEMORY_LIMIT', '32M');
Frequently, 32M or 64 megabytes are the pre-configured RAM limit. You are free to change this value to suit your organization’s requirements. For example, setting it to 128M or 256M will result in a larger RAM allocation.
define('WP_MEMORY_LIMIT', '128M');
Publish and save changes: After increasing the memory limit setting, you must save your changes to the wp-config. php file before uploading the new version of the file to your server to replace the old one.
Check to Make Sure the Memory Limit Was Successfully Raised: You may either rerun the WordPress Health Check plugin or use the dashboard supplied by WordPress to check the system health of your website to confirm that the memory limit was successfully adjusted.
Check the website’s functionality: You should thoroughly examine the functionality of your website after increasing the RAM limit to ensure that all of its components are working as they should. Check all the necessary pages, functions, and plugins to ensure no compatibility issues.
If you have followed all the steps it still doesn’t work. Then you need to configure the php.ini file to make memory changes.
Steps to Edit your PHP.ini file to increase the Memory limit
To increase the PHP memory limit, you can edit the php.ini file. Please note that the steps may vary depending on your server configuration and hosting environment. Here’s a general guide on how to do it:
1. Locate the php.ini file:
- For most Linux-based servers, the php.ini file is typically located in the /etc/php/ directory.
- On Windows servers, it is often found in the PHP installation folder (e.g., C:\php\).
2. Backup the php.ini file:
Before making any changes, it’s essential to create a backup of the php.ini file to avoid any accidental data loss or configuration issues.
3. Open the php.ini file in a text editor:
Use a text editor like Notepad (Windows) or nano/vim (Linux) to open the php.ini file.
4. Find the memory_limit directive:
Look for the line in the php.ini file that sets the memory_limit value. It should look like this:
memory_limit = 64M
5. Modify the memory_limit value:
Change the value to the desired memory limit. For example, if you want to set it to 256MB, the line will become:
memory_limit = 256M
6. Save the changes:
After updating the memory_limit value, save the php.ini file.
7. Restart your web server:
Alternatively, if you don’t have access to the php.ini file, you can try using the .htaccess or wp-config.php method to increase the PHP memory limit (as mentioned in the previous response). However, note that not all hosting providers allow changes via .htaccess or wp-config.php, and modifying the php.ini file is the most reliable way if you have access to it.
Always check with your hosting provider or system administrator if you are unsure about how to increase the PHP memory limit or if there are any restrictions on your server.
Increasing WordPress’s RAM limit has the following advantages:
Increased Memory Limit: Your website can tackle challenging activities and database queries more swiftly if it has a higher memory limit. This will enhance the responsiveness and speed of the website. Pages load more rapidly as a result, which lowers bounce rates and enhances the user experience overall. If you want to keep your visitors and climb the search engine rankings, you must have a website that loads quickly and is responsive.
Enhanced Stability and Reliability: Proper memory allocation lowers the possibility of encountering fatal errors and white screens of death, which can annoy website administrators and users. If you grant your website access to enough memory resources, you can keep it stable and dependable even when there is a lot of traffic or processes that consume a lot of memory.
Resource-intensive plugins and themes, such as those used for online shopping or multimedia content, may require more memory to function well. Raising the RAM limit can reduce the likelihood of conflicts or performance slowdowns. This enables resource-intensive components to get the necessary resources to continue operating without being hampered.
Additional Advice for Solving Memory-Related Issues:

Place Restrictions on Resource-Intensive Plugins by Identifying Them: Set usage restrictions for any plugins that use excessive memory by doing frequent audits of the ones already installed on your website. Try using alternatives if you can, and if you can’t, look for plugins that serve the same purpose more effectively.
Implement Caching: Use caching plugins or server-level caching solutions to save static versions of the pages on your website. Caching reduces the number of dynamic requests sent to the server, reducing RAM usage and quickening web page loading times.
Optimize Images: Image optimization is crucial since viewing huge photos can consume a lot of memory. Always optimize your photographs before adding them to your WordPress media library. Use compression to shrink image files without compromising the image’s quality.
Activate PHP Version 7 or Newer: PHP is the engine that powers the WordPress platform. Upgrading to PHP 7 or a higher version can significantly improve your website’s performance and memory use because more recent versions of PHP are more efficient and effective.
Change to Managed WordPress Hosting if you can: Consider switching to managed WordPress hosting if memory problems persist despite your efforts to optimize the system. Using one of these hosting providers, which offers memory allocation and server resources that have been properly tuned, can dramatically enhance WordPress performance.
Increasing WordPress’s RAM limit is a simple task, but it’s crucial if you want to boost your website’s overall effectiveness and dependability. You may avoid memory-related problems and give your consumers a smooth surfing experience if you employ the above-mentioned techniques. To avoid potential issues, always update your WordPress core, themes, and plugins to the most recent versions. If the RAM allowance on your server is increased, you can confidently enhance your website’s capabilities and expand your online presence.
Also, Read About –Top 10 Extremely Successful Tips to Improve Your WordPress Theme in 2023
7 Evergreen Reasons to Use WordPress in 2023
Tips for Selling Your First WordPress Theme

