Why this happens

PHP allocates a fixed amount of memory for each page load, controlled by your hosting's memory_limit setting. When a plugin, theme, or custom code tries to use more memory than that limit allows - often while processing images, generating a large report, or running a heavy import - PHP stops the script and throws this fatal error rather than let it run unbounded.

Step-by-step fix

  1. Open cPanel or your hosting File Manager and go to your website's root folder (where wp-config.php is located).
  2. Edit the wp-config.php file.
  3. Find this line: /* That's all, stop editing! Happy publishing. */
  4. Just above it, add this line: define('WP_MEMORY_LIMIT', '256M');
  5. Save the file and refresh your website.
  6. If the issue continues, ask your hosting provider to raise the PHP memory_limit to 256M or higher.

How to prevent it happening again