Skip to content
Want to get Premium Web Hosting only at 45₹/Month Signup Now!

How to Increase WordPress Memory Limit in cPanel

Introduction

If you’re running a WordPress website and see errors like:

  • “Allowed memory size of xxxxx bytes exhausted”
  • White screen while uploading themes or plugins
  • Issues while running WooCommerce or page builders like Elementor

…it usually means your WordPress PHP memory limit is too low.

The good news? If you’re hosting with Yash Host, you can increase your WordPress memory limit directly from cPanel in just a few steps — no plugins required.

In this guide, we’ll show you exactly how to do it safely.


Why Increase WordPress Memory Limit?

By default, WordPress sets a memory limit of 32 MB (sometimes 64 MB). For basic blogs this is enough, but if you’re using:

  • WooCommerce (online stores)
  • Page builders (Elementor, WPBakery, Divi)
  • High-resolution images & videos
  • Heavy themes or multiple plugins

…you may need to increase the memory limit to 128 MB, 256 MB, or higher.

This ensures your site runs smoothly without hitting memory errors.


Methods to Increase WordPress Memory Limit in cPanel

There are 3 common methods you can use inside cPanel:


✅ Method 1: Edit wp-config.php File

  1. Log in to your cPanel account.
  2. Go to File Manager → open your WordPress installation folder (usually public_html).
  3. Locate and right-click the wp-config.php file → choose Edit.
  4. Add the following line above the line that says “That’s all, stop editing!”:
define( 'WP_MEMORY_LIMIT', '256M' );
  1. Save changes.
  2. Refresh your site and check if the error is gone.

👉 This method works in most cases, but if your hosting restricts PHP limits, use the next methods.


✅ Method 2: Edit .htaccess File

  1. In File Manager, locate your site’s .htaccess file (in public_html).
  2. Right-click → Edit.
  3. Add this line at the top or bottom:
php_value memory_limit 256M
  1. Save changes.

👉 If you get an internal server error after saving, remove the line — it means your server doesn’t allow .htaccess memory overrides.


✅ Method 3: Edit php.ini or user.ini File

  1. In File Manager, check if you already have a php.ini or .user.ini file in public_html.
    • If not, click +File and create php.ini.
  2. Edit the file and add:
memory_limit = 256M
  1. Save changes.

👉 This is the most powerful method since it overrides PHP configuration directly.

To Change directly in cPanel Follow this guide – How to Increase PHP Memory Limit in cPanel’s PHP INI Editor


How to Verify Memory Limit

After making changes, check if WordPress memory limit has increased:

  • Install & activate the plugin Site Health Info (or use default WordPress Site Health under Tools).
  • Go to: Tools → Site Health → Info → Server.
  • Look for PHP memory limit value.

It should show 256M (or your set value).


  • Basic WordPress site → 64 MB
  • WooCommerce site → 128 MB
  • Heavy plugins + page builders → 256 MB
  • Enterprise site with lots of traffic → 512 MB

At Yash Host, our servers support up to 512 MB memory allocation for WordPress.


Common Issues

  • If changes don’t apply, try all three methods.
  • Some shared hosting plans have hard memory caps — in that case, contact Yash Host Support to raise the limit.
  • Avoid setting unnecessarily high memory limits (e.g., 2GB) as it may affect server performance.

Conclusion

Increasing the WordPress memory limit is one of the fastest ways to fix common errors and improve your site’s performance. By using cPanel (File Manager, .htaccess, or php.ini), you can easily raise the memory limit without extra plugins.

At Yash Host, we make WordPress hosting simple, optimized, and developer-friendly. If you face any issue while increasing the memory limit, our WordPress expert support team is always ready to help.


FAQ (with Schema)

Q1. What is the default WordPress memory limit?
The default limit is usually 32 MB (sometimes 64 MB depending on the host).

Q2. What is the recommended WordPress memory limit for WooCommerce?
We recommend 256 MB for WooCommerce stores to handle large product databases and plugins.

Q3. Can I increase memory limit without cPanel access?
Yes, if you have FTP or SSH access, you can manually edit wp-config.php, .htaccess, or php.ini files.

Q4. Does increasing memory limit make my website faster?
Not directly, but it prevents errors and crashes, ensuring smooth performance for heavy themes/plugins.

Was this article helpful?
YesNo
Back To Top