There was a problem loading the comments.

WordPress 503 Error With Elementor: Memory Limit Fix

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

If Elementor pages on a WordPress site return a 503 error while other pages load, and debug.log is empty, check the memory limit first. Elementor loads a lot of code on every page it renders, and a site with no memory setting in wp-config.php can run it short. Read the site's error_log to confirm, then set WP_MEMORY_LIMIT in wp-config.php. This guide covers both steps and what to do if memory isn't the cause.

A memory limit is not the only thing that produces a 503 error in WordPress, so confirm it in the log before you change anything.

Symptoms of a memory-related 503 with Elementor

  • Pages built with Elementor (often the home page, About, Services, Blog) return 503 Service Unavailable.
  • Pages and posts not built with Elementor still load.
  • The 503 starts when Elementor or Elementor Pro is active, and stops when you deactivate it.
  • wp-content/debug.log is empty or doesn't exist.

The empty debug.log is expected. When PHP runs out of memory it stops immediately, and WordPress never gets the chance to write its own debug entry. The evidence is in PHP's error_log, not WordPress's log.

Step 1: Read the PHP error_log

On WP Aligned hosting, PHP logs errors to a file named error_log in the folder of the script that ran. Check public_html/error_log (or the domain's document root) and wp-admin/error_log. For how to open it and group entries by plugin, see WordPress PHP Errors: Deprecated Notices and error_log.

Look at the newest entries, from around the time the 503 happened:

tail -n 50 error_log

A memory problem looks like this:

PHP Fatal error:  Allowed memory size of 134217728 bytes (tried to allocate 262144 bytes) in /home/exampleuser/public_html/wp-content/plugins/elementor/core/example.php on line 120

The first number is the limit PHP applied to that request. 134217728 bytes is 128 MB. If you see this line, go to Step 2.

If the log shows nothing from the time of the 503, or shows a different error, memory may not be the cause. Skip to the "If memory isn't the cause" section below.

Step 2: Check the memory limits in effect

Two limits matter:

Setting Where it's set What it does
PHP memory_limit MultiPHP INI Editor in cPanel The ceiling PHP enforces per request
WP_MEMORY_LIMIT wp-config.php What WordPress asks PHP to allow for front-end requests

To see what WordPress is using, open Tools > Site Health > Info > Server in wp-admin and read the PHP memory limit and WordPress memory limit lines.

To check or change the PHP limit, open cPanel, go to Software > MultiPHP INI Editor, choose the domain and look at memory_limit.

cPanel MultiPHP INI Editor with a domain selected and the memory_limit value highlighted

Step 3: Set WP_MEMORY_LIMIT in wp-config.php

  1. Back up wp-config.php first (download a copy from File Manager).
  2. Open wp-config.php in the site's document root.
  3. Add this line above the comment that says /* That's all, stop editing! Happy publishing. */:

php define( 'WP_MEMORY_LIMIT', '1024M' );

  1. Save the file and reload the page that returned the 503.

We recommend 1024 MB for sites running Elementor. If the site still fails at 1024 MB, don't keep raising the number. Something is using memory it shouldn't, and the next step is finding it (see below).

WP_MEMORY_LIMIT can't lift a request above the PHP memory_limit set for the domain. If the PHP limit is lower than the value you define, PHP's limit wins. Check both.

Step 4: Verify the fix

  1. Load the pages that returned the 503 in a private browser window.
  2. If they load, clear the cache so visitors don't get a stale error page. See How to Clear LiteSpeed Cache on WP Aligned Hosting.
  3. Empty error_log (: > error_log over SSH, or delete it in File Manager) and check it again after a day. No new Allowed memory size entries means it held.
  4. In Tools > Site Health > Info > Server, confirm the WordPress memory limit now shows 1024 MB.

If memory isn't the cause

A 503 is a generic "the server couldn't serve this request" response. If error_log shows no memory error, work through these:

  1. Deactivate Elementor and Elementor Pro briefly. If the pages return, reactivate them one at a time. Elementor add-on plugins are a common source of fatal errors.
  2. Check the PHP version. After a PHP upgrade, older Elementor add-ons can fail. See How to change the PHP version per domain or subdomain in cPanel.
  3. Look for a PHP Fatal error other than memory. The file path in the line names the plugin or theme at fault.
  4. Check for a critical error message. See There has been a critical error on this website.

Prevent it

  • Keep Elementor, Elementor Pro and their add-ons updated together.
  • Remove add-ons the site doesn't use.
  • Set WP_MEMORY_LIMIT when you build a site on Elementor, before launch.
  • Check error_log now and then for Allowed memory size lines.

When to contact us

Open a ticket if:

  • error_log shows a memory error at 1024 MB or higher.
  • The 503 continues and error_log shows nothing for the time it happened.
  • The error began right after a PHP version change and switching back didn't help.

Include the domain, the time of the 503 and a few lines from error_log. See Need Help?.

FAQ

Why is debug.log empty when Elementor pages return a 503?

PHP can stop a request for exhausting memory before WordPress writes anything to debug.log. Read the PHP error_log instead.

How much memory does Elementor need?

We recommend 1024 MB for Elementor sites. Needs vary with the number of add-ons and the size of the pages.

Will raising WP_MEMORY_LIMIT fix every 503?

No. It fixes memory-related 503 errors, which error_log confirms with an Allowed memory size line. Other causes need a different fix.


Share via
Did you find this article useful?  

Related Articles