WordPress Memory Limits and Timeouts

Increase limits only when justified and correct the operation that consumes excessive resources.

1 min read

  • Article
  • Intermediate
  • 2 minutes read
  • Reviewed August 4, 2026
  • WordPress maintenance and troubleshooting

Memory limits restrict how much memory a PHP process can use.

Execution timeouts limit how long selected requests or operations may run.

Increasing limits can allow legitimate heavy work to finish, but it can also hide unbounded queries, large files or inefficient loops.

Identify the Exact Error

Look for messages such as:

  • Allowed memory size exhausted.
  • Maximum execution time exceeded.
  • Gateway timeout.
  • Request timeout.
  • Upstream timed out.
  • Worker terminated.

The layer matters. PHP, web server, proxy, CDN and database can each have different limits.

WordPress Memory Constants

WP_MEMORY_LIMIT can request a memory limit for WordPress.

WP_MAX_MEMORY_LIMIT relates to selected administration operations.

PHP and hosting configuration can prevent WordPress from raising the limit beyond the server maximum.

Common Causes

  • Large imports.
  • image processing.
  • backup archives.
  • unbounded queries.
  • recursive code.
  • huge autoloaded options.
  • plugin conflicts.
  • report generation.
  • too many records per admin page.
  • external API waits.

Correct the Workload

Prefer:

  • Pagination.
  • batches.
  • background queues.
  • streaming.
  • smaller image sizes.
  • query indexes.
  • cache.
  • strict remote timeouts.
  • cleanup of unnecessary loaded data.

Frequently Asked Questions

What memory value should every WordPress site use?

There is no universal value. It depends on workload and hosting architecture.

Will a larger timeout fix imports permanently?

It may allow one run to finish, but reliable imports should use bounded batches and resumable processing.

Continue Learning

Previous: Fixing WordPress Database Connection Errors

Next: Fixing WordPress Permalink and 404 Problems