WordPress Fatal Error: Maximum Execution Time Exceeded
Warning Frequency: CommonError message:
Fatal error: Maximum execution time of 30 seconds exceededThis 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
- Plugin or theme running a slow operation (imports, backups, image processing)
- Slow database queries (unoptimized queries, missing indexes)
- External API calls timing out (checking for updates, license verification)
- PHP max_execution_time set too low (default 30 seconds)
- Large WordPress import or WooCommerce product sync
How to Fix It
- Increase execution time in php.ini:
max_execution_time = 300 - Or in .htaccess:
php_value max_execution_time 300 - Or in wp-config.php:
set_time_limit(300); - Run heavy operations via WP-CLI instead of the browser (CLI has no time limit by default)
- Use a plugin like WP Crontrol to run long tasks as background cron jobs
- 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.