WordPress Fatal Error: Maximum Execution Time Exceeded

Warning Frequency: Common
Error message: Fatal error: Maximum execution time of 30 seconds exceeded

This error occurs when a PHP script runs longer than the allowed time limit. The default is usually 30 seconds. Complex operations like imports, exports, and backups frequently hit this limit.

Common Causes

  1. Plugin or theme running a slow operation (imports, backups, image processing)
  2. Slow database queries (unoptimized queries, missing indexes)
  3. External API calls timing out (checking for updates, license verification)
  4. PHP max_execution_time set too low (default 30 seconds)
  5. Large WordPress import or WooCommerce product sync

How to Fix It

  1. Increase execution time in php.ini: max_execution_time = 300
  2. Or in .htaccess: php_value max_execution_time 300
  3. Or in wp-config.php: set_time_limit(300);
  4. Run heavy operations via WP-CLI instead of the browser (CLI has no time limit by default)
  5. Use a plugin like WP Crontrol to run long tasks as background cron jobs
  6. Optimize slow database queries u2014 use Query Monitor plugin to identify them

Frequently Asked Questions

What is a safe max_execution_time for WordPress?
300 seconds (5 minutes) is safe for most operations. For large imports or migrations, you might temporarily set it to 600 or run the operation via WP-CLI.
Can I set max_execution_time to unlimited?
You can set it to 0 (unlimited), but this is risky on shared hosting as a runaway script could consume all server resources. Use 300-600 instead.
Get WordPress Performance Tips

Plugin reviews, speed optimization guides, and error debugging — straight to your inbox.

No spam. Unsubscribe anytime. We respect your privacy.