Did you know that most WordPress websites have a PHP memory limit of only 40 MB? While smaller websites can run smoothly with such low memory, sites that use more plugins, features, and images need a higher limit to perform efficiently.
For better website functionality, you can raise your WordPress memory limit to 256MB and hire and this article would show you how.
Wix vs WordPress: Which One Is Best?
By Aliza Irfan on November 10, 2025Key Takeaways
- The WordPress memory limit controls how much server memory is available for use on your website.
- When the limit is too low, your site may slow down, freeze, or show the “Allowed memory size exhausted” error.
- You can increase the memory limit by editing your site’s configuration files like
wp-config.or.htaccess. - Some hosting providers set a limit to how much memory your website can get, so your changes might not apply until you contact support or upgrade your plan.
- Always verify your new memory limit after making changes through the Site Health tool on your site’s dashboard.
- If you keep running into memory restrictions, you may need to switch to a hosting plan that offers better performance like hostonce.
What Is the WordPress Memory Limit?
The WordPress memory limit determines how much processing power WordPress can use to handle your site’s functions. Every time you open a page, upload a file, or run a plugin, your site consumes a portion of this memory.
When your site’s memory usage goes beyond this limit, it struggles to complete certain actions, which often leads to the “Allowed memory size exhausted” error. This usually happens when you install new plugins, upload large images, or perform tasks that demand more resources than your current memory allocation allows.

Ready for a Faster WordPress Site?
Experience optimized WordPress hosting with higher PHP memory, faster response times, and solid reliability.
Why your WordPress Website Needs a Higher PHP Memory Limit
As you add more plugins and themes to your WordPress website, you need a higher PHP memory limit or the site would begin to have slow loading times, freeze or display the “Allowed memory size exhausted” error.
Every tool you add to your website increases the workload on your server. Some tools such as visual page builders, advanced SEO tools, and eCommerce plugins, consume more memory than others. Large image files, videos, and animations can also push your site beyond its available memory.
Increasing the WordPress memory limit helps your content to load correctly, keeps your admin dashboard responsive, and avoids other memory related errors. In short, a higher memory limit gives you WordPress site consistent uptime such that it runs efficiently and reliably.
How to Increase WordPress Memory Limit
The most common approach to increasing your WordPress memory limit is to edit your website files manually using an FTP client or the File Manager in your hosting control panel. Another option is to contact your hosting provider and request a higher limit. When editing manually, you have to take extra care to avoid errors that could break your website. The steps below shows you how you can safely increase your WordPress memory limit and if followed correctly, there would be no harm to your website.
Method 1: Edit the wp-config.php File
The wp-config.php file contains important WordPress configuration settings for your website. By adding a single line of code to this file, you can increase your memory limit to the desired range. You can access it directly through your hosting File Manager or by using an FTP client (like FileZilla) if you prefer to connect to your site’s files remotely.
Follow these steps to increase the PHP memory limit on WordPress by editing the wp-config.php file:
- Access Your Website Files on your File manager
- Log in to your web hosting admin dashboard and open the File Manager, or connect to your site using an FTP client.
- Find the wp-config.php File
- In the WP file manager folder, look for a file called wp-config.php.
- Right-click it and select Editor or View/Edit, depending on your hosting control panel or FTP software.

- Add the Memory Limit Line
- Inside the file, scroll down until you see the line that says: /
* That's all, stop editing! Happy publishing. */ - Just above that line, insert the following code:
define('WP_MEMORY_LIMIT', '256M');
- Inside the file, scroll down until you see the line that says: /

- Save and Close the File
- Once you’ve added the line, save the changes.
- If you’re using an FTP client, it may ask to upload the modified file back to the server — click Yes or OK
- Go back to your WordPress dashboard and refresh the page.
Expert Tip
While increasing your memory limit can solve immediate issues, long-term stability depends on optimization. Keep your plugins and themes lean, use caching tools to lighten the server’s workload, and always run the latest PHP version for better performance and efficiency. Regular monitoring of your server usage helps you detect growing problems early and maintain a fast, reliable WordPress site.
Method 2: Edit the .htaccess File
Before editing the .htaccess file, create a backup copy because a small mistake in the .htaccess file can break your site.
Follow these steps to increase the PHP memory limit on WordPress by editing the.htaccess file:
- Access the .htaccess File
- Log in to your admin dashboard and open the File Manager, or connect to your website using an FTP client like FileZilla.
- Locate the .htaccess file. If you don’t see it, check your settings to ensure that hidden files are visible.

- Open and Edit the File
- Right-click on the .htaccess file and select Edit. If you do not find the edit option, download the file and open it on your notepad.
- Add the following line:
php_value memory_limit 256Mat the end of the file. Below the line #END WordPress.

- Save and Upload the File
- Save your changes and close the editor.
- If you’re using FTP or you made the edit on your notepad, upload the updated file back to your server, replacing the old version.
- Check if the Change Worked
- Visit your WordPress dashboard or refresh the page that previously showed the memory error.

Reliable Hosting Starts with Hostonce
Choose Hostonce and enjoy performance-focused WordPress hosting designed to handle any workload.
How to Check and Troubleshoot Your WordPress Memory Limit Increase
After applying any of the methods above, it is important for you to confirm that your WordPress memory limit increase worked. This ensures that your site is actually using the new value instead of the default one.
To check your current memory limit:
- Log in to your WordPress dashboard.
- Go to Tools → Site Health → Info → Server.
- Look for the line that says PHP memory limit. This shows the amount of memory currently allocated to your site.

Troubleshooting Tips
If your WP memory limit increase didn’t work, there are a few possible causes:
- Syntax errors: A missing semicolon or incorrect placement of a code line in files like
wp-config.phpor.htaccesscan cause the change to fail. Double-check your edits for accuracy. - Caching issues: Browser or web caches might prevent your site from reflecting the latest configuration. Clear all caches and try again.
- Hosting restrictions: Some hosting providers do not allow users increase memory limits manually. In this case, you need to contact your host to request a higher PHP memory limit. If they don’t allow it, consider switching to a hosting provider that offers more flexibility and better resource allocation.
Increasing your PHP memory limit in WordPress should now give your site the space it needs to run smoothly — but always remember that server-level settings may ultimately depend on your hosting plan and provider.

Don’t let poor hosting drag down your website
Stop struggling with limits and slow performance. Switch to Hostonce for more memory, speed, and control.
Conclusion
Higher WordPress limits ensures proper website functionality. If the limit is too low, your site performs slowly and experiences more downtime. Increasing it through methods like editing wp-config.php, or adjusting .htaccess gives your site the extra space it needs to perform better.
Also, proper management of your tools, themes, and hosting environment is important. To keep your site working efficiently, update plugins, remove unused themes, and regularly monitor your hosting resources. By doing these, you can keep your site fast, stable, and ready for any function you need to carry out.
5 Best WordPress Crowdfunding Plugins in 2026
By Aliza Irfan on November 10, 2025FAQs
What happens if I increase the memory limit but still get the “Allowed memory size exhausted” error?
If the error persists, it likely means your hosting provider has a maximum limit that overrides your local changes. Some hosts restrict how much memory can be allocated to PHP processes for performance and security reasons. In that case, you’ll need to contact your hosting provider to request a higher limit.
Is it safe to increase the WordPress memory limit to a high value like 512M or 1024M?
You can safely increase the limit as long as your server has enough resources to support it. However, setting it unnecessarily high won’t improve performance and could lead to instability if your hosting plan doesn’t provide that much memory. For most websites, a limit between 128M and 256M is sufficient.
Can I increase the WordPress memory limit on shared hosting?
Yes, but within the limits of your hosting plan. Shared hosting often has a lower maximum PHP memory allocation, and even if you edit files like wp-config.php or .htaccess, the host may enforce a cap. If you need more memory for plugins or high-traffic sites, upgrading to a VPS or cloud hosting plan is usually the best solution.
Do I need to change my hosting provider if I can’t increase the memory limit?
Not always, but it can become necessary. If your current host restricts PHP memory and doesn’t allow higher allocations—even after support requests—you may have outgrown their plan. Switching to a provider that offers more control over server settings ensures better performance and scalability for your site.

Hostonce is the #1 WordPress Host
Ranked by 930+ customers in G2's Best Software Awards.