Severity: Major · Fix time: 5–15 min · Skill level: Intermediate

Maximum execution time exceeded is a PHP fatal error in WordPress that appears when a script takes longer to run than the server’s configured max_execution_time limit — typically 30 seconds by default on shared hosting. WordPress stops the script mid-process and displays the error rather than letting it run indefinitely.

This error most commonly surfaces during large content imports, plugin updates, media processing, backup operations, or any task that requires sustained PHP execution. It doesn’t mean your site is broken — it means one specific task ran too long. The fix is usually straightforward: either increase the time limit, optimize the process causing the timeout, or break the task into smaller chunks.

Need a quick map of every WordPress error? See our 70+ WordPress Errors Guide → for a categorized reference of every common WordPress issue.

How Maximum Execution Time Exceeded Works

PHP has a built-in safety mechanism: max_execution_time. This setting caps how long any single PHP script can run before the server terminates it. The limit exists to prevent runaway scripts from consuming shared server resources indefinitely.

WordPress inherits whatever value is set at the server level. Most shared hosting providers set this to 30 seconds. Managed WordPress hosts often set it to 60–120 seconds. On a VPS or dedicated server, you control it directly.

Common scenarios that trigger this error:

  • WooCommerce or WP All Import CSV imports — Importing thousands of products or posts means PHP processes each row in sequence. Large files routinely exceed 30 seconds.
  • Backup plugin operations — Compressing a large site with many media files can take several minutes.
  • Image regeneration — Plugins like Regenerate Thumbnails reprocess every image in the media library, one by one.
  • Plugin updates on large sites — Some plugins run database migrations during updates that exceed the time limit.
  • External API requests that stall — A plugin waiting on a slow third-party API response can burn through the execution limit while waiting.

Check This First — 2-Minute Diagnostic

  1. Identify when the error appears — Does it happen during a specific action (import, backup, update) or on regular page loads? Triggered errors are far easier to fix than persistent ones.
  2. Check what was running — Recent imports, backup jobs, or plugin updates are the usual suspects.
  3. Read the error message — PHP usually includes the specific file and function that timed out. This narrows the cause immediately.
  4. Check PHP error logs — In cPanel, go to Logs → Error Log and look for “Maximum execution time” entries.
  5. Check your current limit — Visit Tools → Site Health → Info → Server in wp-admin to see your current max_execution_time value.

Purpose & Benefits

1. Preventing Runaway Processes

The max_execution_time limit isn’t your enemy — it’s a guard rail. Without it, a single misbehaving plugin could occupy a PHP worker for minutes or hours, degrading server performance for every other visitor. Understanding this limit helps you respect it rather than fight it.

2. Diagnosing Performance Problems

A script consistently hitting the execution limit is a signal worth paying attention to. An operation that takes 30+ seconds of PHP execution is almost certainly doing something inefficient — whether that’s an unoptimized database query, redundant processing, or an overly complex plugin. Our WordPress development team has seen this pattern in plugins that should be batch-processing in smaller increments.

3. Enabling Heavy Operations Without Risk

Increasing the execution time limit for specific operations (like scheduled imports or backups) — rather than globally — lets you run those processes safely without exposing every page request to an elevated timeout. This is the pragmatic approach for sites that genuinely need longer operation windows.

Examples

1. CSV Product Import Fails at Row 847

A WooCommerce store owner tries to import 2,000 products via a CSV file. The import starts, processes 847 rows, then shows “Maximum execution time of 30 seconds exceeded.” The fix: add set_time_limit(300); to wp-config.php before running the import, then remove it afterward. Alternatively, split the CSV into batches of 500 rows and import them sequentially.

2. Backup Plugin Times Out on Large Media Library

A site with 15GB of uploaded images tries to run a full site backup. The compression process exceeds the execution limit. The better approach: configure the backup plugin to exclude the uploads folder from its compressed backup (since media files are already stored on the server) and back them up separately. Most backup plugins have this option under “Exclusions.”

3. Regenerating Thumbnails After Theme Change

After switching to a new theme with different image size requirements, a site owner runs the “Regenerate Thumbnails” plugin across 3,000 images. The process times out. Fix via WP-CLI instead of the browser:

# Regenerate all thumbnails via WP-CLI — no browser timeout limit
wp media regenerate --yes

WP-CLI bypasses the browser-session PHP execution limit entirely, making it the right tool for bulk operations.

Common Mistakes to Avoid

  • Setting max_execution_time to 0 — A value of 0 means no time limit, which is dangerous on shared hosting. Other users on the server can be impacted if a script runs unchecked. Use a high but finite value (300–600 seconds) instead.
  • Increasing the limit globally without cause — Raising max_execution_time in php.ini or wp-config.php affects every PHP process on the site. Increase it selectively for the operation that needs it, then reduce it again.
  • Fixing the symptom without fixing the cause — If a plugin times out every time it runs a routine task, the plugin itself may be inefficient. Look for a better alternative rather than just raising the limit.
  • Editing php.ini on servers that don’t support it — Some shared hosting environments don’t allow php.ini overrides. Use wp-config.php or .htaccess methods instead, or contact your host.

Best Practices

1. Increase the Execution Time Limit via wp-config.php

For most WordPress sites, editing wp-config.php is the most reliable way to increase execution time:

// Add before "That's all, stop editing!" in wp-config.php
set_time_limit(300);

This sets the limit to 300 seconds (5 minutes) for the WordPress application. Note that some shared hosts ignore this setting — if it doesn’t work, try the .htaccess method or contact your host.

Alternatively, set it in your .htaccess file:

# Increase PHP execution time via .htaccess
php_value max_execution_time 300

Or in php.ini if your host allows it:

max_execution_time = 300

2. Use WP-CLI for Bulk Operations

Browser-based operations are subject to both PHP and HTTP connection timeouts. WP-CLI runs via the command line with no browser session to time out. Use it for:

# Update all plugins via WP-CLI — no execution time limit
wp plugin update --all

# Run a WooCommerce database upgrade
wp wc update

# Import posts from XML
wp import data.xml --authors=create

WP-CLI is the right tool for any operation that consistently times out in the browser.

3. Break Large Imports Into Smaller Batches

Rather than importing 10,000 products in a single operation, split the CSV into files of 500–1,000 rows and import them in separate sessions. Most import plugins (WP All Import, WooCommerce Product Import) support scheduled or batched importing natively. Enable this option before running large imports, and the plugin handles chunking automatically without hitting the execution limit.

Frequently Asked Questions

What causes maximum execution time exceeded most often?

Large imports, backup operations, and image regeneration tasks are the most frequent triggers. Any PHP process that needs to loop over thousands of items — products, posts, images — risks hitting the 30-second default limit on shared hosting. Check what action you were performing when the error appeared; it almost always points directly to the cause.

How do I fix maximum execution time exceeded when locked out of wp-admin?

This error rarely locks you out of wp-admin — it typically appears while performing an admin action, not on the front-end. If wp-admin is affected, connect via SFTP and add set_time_limit(300); to wp-config.php. If a plugin update triggered the error, rename the plugin folder in /wp-content/plugins/ via SFTP to deactivate it.

Can maximum execution time exceeded hurt my SEO?

Not directly, since this error typically only appears when a logged-in admin performs an action — not on public-facing pages. However, if a plugin triggering the error runs on front-end page loads (such as a widget rendering a complex query), visitors will see the PHP error or a blank page, which harms user experience and can affect SEO.

What is the difference between maximum execution time and a connection timeout?

Maximum execution time (max_execution_time) limits how long a PHP script can run on the server. A connection timeout means the browser waited too long for the server to send any response. They can look similar from the visitor’s perspective, but have different fixes: execution time is a PHP config issue; connection timeout is typically a server resource or network issue.

How do I find my current max_execution_time value?

In your WordPress dashboard, go to Tools → Site Health → Info → Server. Look for “PHP max execution time.” You can also check it via WP-CLI with wp cli info or by creating a temporary phpinfo() page — though always remove that page immediately after checking, as it exposes server configuration details.

Related Glossary Terms

How CyberOptik Can Help

Still broken? Our team fixes WordPress errors like this in under 30 minutes for maintenance clients. We handle execution time configuration, plugin performance audits, and server-side optimization for WordPress sites regularly. If your site keeps hitting PHP limits during routine operations, the fix often involves more than just raising a number — it means identifying why the process is slow in the first place. Contact us to discuss your site or explore our WordPress maintenance services.