Home
About
Categories
Blog
Free Tools
Contact
Sign In

At The Tech Forte, we bring you the latest in technology, trends, and insights to keep you informed and ahead of the curve. Our platform is designed to help tech enthusiasts, professionals, and businesses navigate the ever-evolving digital landscape.

Quick Links

  • Home
  • About
  • Categories
  • Blog
  • Free Tools
  • Contact
  • Privacy Policy

Categories

  • Technology
  • Productivity Tools
  • AI Tools
  • Digital Marketing
  • Tech Tips
  • Business
  • Corporate Investment

Categories

  • AI & Automation
  • Gadget Reviews
  • Guides & Tutorials
  • Health
  • SEO Guides
  • Trading & Investment
  • Market Trends

© 2026 The Tech Forte. All rights reserved.

Proudly Developed By HINTSOL
  1. Home
  2. Blog
  3. Bug Fixes
  4. Fix Memory Exhausted Error - Increase PHP Memory in WordPress
Share
Bug Fixes

Fix Memory Exhausted Error - Increase PHP Memory in WordPress

If you’ve ever come across a fatal error message saying “Allowed memory size exhausted” on your WordPress website, don’t worry—you’re not alone. This is a common error, and the good news is that it’s easy to fix this Memory Exhausted Error.

In this guide, we’ll walk you through what causes the WordPress memory exhausted error and how to increase PHP memory in WordPress like a pro, even if you’re not a developer. Let's fix it step-by-step!

1. What is the WordPress Memory Exhausted Error?

WordPress is built using PHP, a server-side programming language. Your web hosting server allocates a specific amount of memory that PHP scripts can use. When your website exceeds this limit, WordPress throws a fatal error like this.

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate XXXX bytes)

This is known as the WordPress memory exhausted error, and it usually happens when plugins, themes, or custom scripts consume more memory than what’s available.

2. Common Causes of PHP Memory Exhaustion

Let’s understand what might be eating up your memory:

  • A poorly coded plugin or theme
  • Too many active plugins
  • Heavy processes (image imports, backups, etc.)
  • High-site traffic or large database queries
  • Shared hosting with low memory allocation

By default, WordPress tries to allocate 40MB for single sites and 64MB for multisite installations, which is often not enough.

3. How to Increase PHP Memory in WordPress (Step-by-Step)

Here are different methods to increase the PHP memory limit on your WordPress site. You can try them based on the level of access your hosting provider gives you.

1. Increase Memory via wp-config.php

This is one of the safest and most commonly used methods.

Steps:

  1. Log in to your hosting panel (cPanel/File Manager or FTP).
  2. Locate the wp-config.php file at the root of your WordPress installation.
  3. Add the following line just before the line that says /* That's all, stop editing! */ :

define('WP_MEMORY_LIMIT', '256M');

This tells WordPress to raise its memory limit to 256MB.

2. Modify the php.ini File

This is ideal for users on VPS or dedicated servers.

Steps:

  1. Access your hosting panel and go to your file manager or use FTP.
  2. Look for the php.ini file in the root or public_html folder.
  3. Add or edit the following line:

memory_limit = 256M

Save the file and check if the error has been resolved.

3. Edit .htaccess File (Advanced)

If your host supports it, you can use the .htaccess file to change memory settings.

Steps:

  1. Go to your WordPress root directory.
  2. Open or create a .htaccess file.
  3. Add the following line:

php_value memory_limit 256M

Note: This may not work on all shared hosts and could result in a 500 error. Test carefully.

4. Hosting Panel Option (For Beginners)

Some hosting providers like Hostinger, Bluehost, or SiteGround provide an option to increase memory from their dashboard.

Steps:

  1. Log in to your hosting account.
  2. Go to the PHP settings or PHP configuration area.
  3. Look for the “memory_limit” field and change it to 256M or higher.
  4. Save changes.

5. Still Not Working?

If none of the methods are working, your host may have a server-level restriction.

Here’s what to do:

  • Contact your hosting support
  • Request them to increase your PHP memory limit
  • If needed, consider upgrading to a better hosting plan

6. Pro Tips to Avoid Running Out of Memory

Even after fixing the issue, memory exhaustion can return if your site isn’t optimized. Here are a few smart habits:

  • Deactivate and delete unused plugins
  • Use lightweight themes
  • Optimize images before uploading
  • Install a caching plugin (like WP Rocket or W3 Total Cache)
  • Avoid auto-importing large files frequently

7. How Much Memory Should You Allocate?

  • For blogs and small business sites: 128MB – 256MB is sufficient.
  • For WooCommerce stores or membership sites: 256MB – 512MB is better.
  • If you're running custom applications or large sites: 512MB or more might be needed.

8. Quick Summary

MethodDescription
wp-config.phpThe easiest method to set a memory limit
php.iniServer-level change for memory limit
.htaccessConditional method works on some servers
Hosting PanelUse GUI to increase memory via settings
Hosting SupportAsk for assistance if all else fails

Frequently Asked Questions (FAQ)

A: It’s usually 40MB for regular sites and 64MB for multisites but can vary based on your host.

A: Yes, increasing memory helps improve stability and performance. Just ensure your hosting plan supports it.

A: At least 256MB is recommended, though 512MB offers smoother performance for larger stores.

A: It won’t break your site, but the server may ignore it if it exceeds its limits.

A: While some plugins let you view current memory usage, they can’t override server restrictions like the methods above.

📝 Final Thoughts

Running into the WordPress memory exhausted error can be frustrating, but now you know exactly how to fix it. Whether it’s through editing wp-config.php, updating php.ini, or getting help from your hosting provider, solving the problem is easier than it sounds.

By increasing the PHP memory limit, you make your site more stable, more scalable, and ready for growth. Don’t let a technical error slow you down—your website deserves peak performance!

Enjoyed this article?

Share it with your network

H

Written by Hintsol

Platform administrator and chief editor with over 10 years of experience in digital publishing.

View all posts →

Comments (0)

No comments yet. Be the first to comment!

Leave a Comment

Table of Contents

1. What is the WordPress Memory Exhausted Error?2. Common Causes of PHP Memory Exhaustion3. How to Increase PHP Memory in WordPress (Step-by-Step)4. Hosting Panel Option (For Beginners)5. Still Not Working?6. Pro Tips to Avoid Running Out of Memory7. How Much Memory Should You Allocate?8. Quick SummaryFrequently Asked Questions (FAQ)📝 Final Thoughts

Categories

Technology64Gadgets Reviews40AI Trends36Corporate Investment25Guides & Tutorials21AI Tools19Future Technology18Sports18Business16Health15SEO Guides12Developer Trends11Digital Marketing11Education11WP Solutions8Google AdSense7AI & Automation7Cybersecurity4Tech Industry4Blog3Travel & Culture3Web Technology2Lifestyle2Market Trends2Productivity Tools2Tech News1Programming Languages1Tools1Work From Home1Tech Tips1Bug Fixes1Trading & Investment1Policy & Regulation1Industry Insights0

Share Article

Facebook
X
LinkedIn
WhatsApp
Reddit
Telegram
Pinterest
Email