More fixes

"Maximum execution time of 30 seconds exceeded" in WordPress

A white page or a half-loaded admin screen says "Fatal error: Maximum execution time of 30 seconds exceeded in /wp-includes/... on line ...". It usually appears during an import, a backup, an image regeneration, a plugin update or a big WooCommerce report. It means PHP stopped one request because it ran longer than the server allows. The file it names is where PHP happened to be when the clock ran out, not the cause. The cause is whatever made that one request do too much work, or wait too long on something else.

What the owner sees

harborviewdental.example/wp-admin/admin.php?page=import

What the checks found


  

Find out which case it is (five minutes)

  1. Note what you were doing. One button (import, backup, "regenerate thumbnails", a report) points to a job that is too big for one request. Every page, all the time, points to a plugin, a theme or a stuck outside call.
  2. Read the path in the message. A path under /wp-content/plugins/<name>/ names the plugin that was running. A path under /wp-includes/ (for example class-wp-http-curl.php or class-wpdb.php) means WordPress was waiting on a remote server or on the database when the clock ran out.
  3. Check the error log in the host panel (or wp-content/debug.log with WP_DEBUG_LOG on) for the lines just before the fatal error; they often name the plugin or the slow query.
  4. On a staging copy, turn plugins off and switch to a default theme (or use the Health Check plugin's troubleshooting mode, which does it for your login only). If the error stops, turn them back on one at a time.

The fixes, by case

  1. A big one-off job (import, backup, thumbnail regeneration). Run it in smaller batches, or with a tool that works in steps (most importers and backup plugins have a "batch size" or "chunk" setting; WP-CLI runs it from the server with no web timeout). Raising the limit for that one job, in the host panel, and lowering it again after is also fine.
  2. A plugin that hangs on every page. Usually it calls an outside service on each page load (a licence check, a feed, a social count) and that service is slow or down. Update the plugin, or replace it. See the cURL error 28 guide for outside calls that time out.
  3. A slow database query. A huge options table, years of post revisions or a report that scans every order. Clean the autoloaded options and old revisions, and add the plugin's own database indexes if it offers them. See the slow site guide.
  4. Updates or installs that stop half-way. If an update was cut off, the site may be left in maintenance mode or with a half-copied plugin. See stuck in maintenance mode and install or update failed.
  5. The limit itself is very low. Some cheap hosting sets it to 30 seconds and the host panel lets you raise it (often "PHP options" or "MultiPHP INI Editor": max_execution_time). 60-120 seconds is normal for the admin side; it does not fix a hang, it only gives a big job room to finish.
  6. Test: run the same job or open the same page again, and check the error log stays quiet for a day.

What you see, what it means, what it needs

What you seeWhat it meansUsual fix
Only during an import, backup or regenerationOne job too big for one requestSmaller batches, WP-CLI, or a raised limit for that job
Path in /wp-content/plugins/<name>/That plugin was running when time ran outUpdate, configure or replace that plugin
Path in class-wp-http-curl.php or class-requestsWaiting on another serverFind the outside call; the host or the service is slow or blocked
Path in class-wpdb.phpWaiting on a slow database queryClean the database, add indexes, fix the report
On every page since an updateA plugin or theme now loops or hangsRoll that one update back, then report it
"Allowed memory size exhausted" insteadMemory, not timeSee the memory guide

What not to do

Most of these are one oversized job or one plugin waiting on a slow outside service, and are gone once that job is batched or that plugin is fixed. If it happens on every page and the log does not name a plugin, that is what the box below is for. Related: memory exhausted, white screen and "There has been a critical error".