How to Increase WordPress Memory Limit for Better Performance

Your WordPress Site Keeps Crashing or Showing Errors. The Fix Might Be One Line of Code.

The WordPress memory limit determines how much server memory your site can use. When it is too low — and many shared hosting plans set it too low by default — your site crashes during updates, shows white screens during peak traffic, and fails to process large uploads. Increasing it is the simplest performance fix for many Gulf sites.

“A low PHP memory limit is the silent cause of more WordPress errors than any other configuration issue. Increase it once, and dozens of mysterious problems disappear.”

How to Increase the Memory Limit

Option 1: wp-config.php. Add define('WP_MEMORY_LIMIT', '256M'); before the line that says “That’s all, stop editing.” This is the most reliable method. Option 2: php.ini. If you have access, add memory_limit = 256M. This increases memory for all PHP applications on the server, not just WordPress. Option 3: .htaccess. Add php_value memory_limit 256M. Only works on Apache servers with PHP running as a module. Option 4: Contact your host. If none of the above work, your host has restricted memory limits and you need their help to increase it. For professional configuration, see our WordPress Services page.

What limit to set: 128MB minimum for a basic site. 256MB for sites with page builders or WooCommerce. 512MB for large multisite or high-traffic sites.

“One line of code. Thirty seconds of work. Fewer crashes, faster backups, smoother updates. The WordPress memory limit fix has the best effort-to-impact ratio of any optimization.”