New 24/7 monitoring and daily cloud backups now included in every Shield Pro plan.

Timeout

Learn how to fix WordPress maximum execution time errors.

Maximum execution time of 30 seconds exceeded means a PHP script ran too long before finishing. Backups, imports, and heavy plugins are usual suspects. This tutorial shows how to raise limits safely and fix the slow process.

Time: 15-30 minutes Level: Intermediate
Neil McNaught, founder of BugShield and WordPress author
Written by
Written by
Updated
Updated

What this problem looks like

Shared hosting often caps PHP at 30 seconds. WordPress backups, WooCommerce imports, and migration plugins regularly exceed that. Raising the limit helps, but optimising the job is the durable fix.

Timeouts during front-end page loads suggest a slow database query or external API call in a plugin. Timeouts during admin tasks suggest batch processing that should run from CLI or cron instead.

Step 1: Pinpoint when the timeout happens

Check debug.log and the on-screen error for the file path. Backup plugins, All-in-One WP Migration, and product importers appear often. Front-end timeouts may implicate search or related-posts plugins.

Step 2: Raise max_execution_time in hosting

In cPanel MultiPHP INI Editor set max_execution_time to 120 for normal sites or 300 for imports. Save and retry the task. You can also add these lines to wp-config.php in your site root, next to wp-admin and wp-content, if your host allows it:

php
@ini_set( 'max_execution_time', '300' );
set_time_limit( 300 );

Step 3: Run heavy tasks via WP-CLI

CLI scripts are not bound by web server timeouts. These commands need SSH access and will not work inside File Manager. For large search-replace or imports:

bash
cd /path/to/wordpress
wp search-replace 'old' 'new' --all-tables
wp cron event run --due-now

Step 4: Reduce plugin batch sizes

In backup and import plugin settings, lower rows per batch. WooCommerce product imports often have a batch size field. Smaller batches finish within 30 seconds on strict hosts.

Step 5: Optimise database and cron

If you have SSH access, run wp db optimize from the WordPress root, or use an optimisation plugin on staging. Disable wp-cron on high-traffic sites and trigger real cron from hosting every five minutes to prevent piled-up jobs that timeout together. Add this to wp-config.php in your site root, next to wp-admin and wp-content:

php
define( 'DISABLE_WP_CRON', true );

When to stop DIY and hire help

Recurring timeouts on page loads, not just imports, often mean a poorly written plugin query. BugShield profiles slow WordPress sites and fixes timeout root causes at a confirmed price without hourly billing surprises.

Questions answered

WordPress maximum execution time FAQs

Answers about PHP timeouts, slow WordPress jobs, safe limit changes, and finding the task that is taking too long.

Is 30 seconds enough for WordPress?

Normal page views should finish in under 5 seconds. Imports and backups need higher limits or CLI execution.

Can max_execution_time cause a white screen?

Yes. Fatal timeout messages may be hidden when display_errors is off, producing a blank page. Check debug.log.

Should I set DISABLE_WP_CRON to fix timeouts?

It moves cron to system cron, which helps piled-up jobs but does not fix a single slow plugin. Configure real cron in hosting after disabling wp-cron.

Why does WooCommerce import timeout?

Large CSV rows and image sideloads are slow. Reduce batch size, raise PHP limits, or import during off-peak hours with more PHP memory.

What causes a WordPress maximum execution time error?

A PHP request exceeded the server time limit. Imports, backups, image processing, updates, slow database queries, or a stuck plugin loop are common causes.

How do I increase maximum execution time for WordPress?

Use the PHP settings provided by your host or ask support. Local php.ini or .user.ini changes work only when the hosting configuration permits them.

Is increasing max_execution_time a permanent fix?

Not always. A modest increase can help legitimate long jobs, but repeated timeouts still require you to find the slow query, remote request, or plugin process.

Why does WordPress still time out after I raise the PHP limit?

A proxy, web server, CDN, database, or external API may have its own shorter timeout. Check logs to identify which layer ended the request.

How can I complete a large WordPress import without timeouts?

Split the import into smaller batches, run it through WP-CLI when available, and pause resource-heavy scheduled tasks until the controlled import finishes.

When should a developer investigate a WordPress execution timeout?

Get help when normal page loads time out, the same job repeatedly stalls, or increasing limits would only keep a broken process running for longer.

Would you rather a developer fixed it?

Request a fix at a confirmed price and speak directly with the BugShield developer working on your site.

Request a Fix