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

Timeout

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

What this problem looks like

Shared UK 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.

php
@ini_set( 'max_execution_time', '300' );
set_time_limit( 300 );
Some hosts disable set_time_limit on shared plans. If ini_set has no effect, upgrade PHP settings in hosting or run the job via WP-CLI.

Step 3: Run heavy tasks via WP-CLI

CLI scripts are not bound by web server timeouts. 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

Run wp db optimize or use a 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.

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.

FAQs

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 on upgraded PHP memory.

Rather someone else fixed it?

Request a fix at a confirmed price. Named UK developer, secure Vault, direct chat.

Request a Fix