Php max input time wordpress

This guide teaches you step-by-step how to increase the WordPress memory limit, the upload max size, the maximum post size, the maximum execution time, and the PHP max input vars.

Note: The methods mentioned below may or may not work on your server depending on your configurations, hosting provider limitations, and settings. When in doubt, consult with a WordPress technical expert.

Table of Contents

Add a header to begin generating the table of contents

How To Increase WordPress Memory Limit

  1. Edit the (php.ini) file by adding: memory_limit = 256M
  2. Edit (wp-config.php) file by adding: define (‘WP_MEMORY_LIMIT’, ‘256M’);
  3. Edit the (.htaccess) file by adding: php_value memory_limit 256M

Learn the details step-by-step below.

What Is WordPress Memory Limit?

The WordPress Memory Limit is the maximum amount of memory (RAM) that your website can use at one time. When your site reaches the allocated memory limit, you will encounter a fatal error.

There are several factors that contribute to the consumption of your memory. The notable ones are your WordPress itself, the theme that you are using, and the list of active plugins.

Generally speaking, the bigger and more complex your website is, the more memory it needs.

Why Do I Need To Increase My WP Memory Limit?

The default memory limit for WordPress is 32MB. This limit might be enough for small websites with a limited number of plugins and visitors.

However, if you need to install a fully functional demo of a premium theme or you have a large list of custom plugins that require installation, then increasing your memory limit would be a wise action to take.

Basically, when you start encountering the “Fatal Error: Memory Size Exhausted“, it would be the right time for you to make such changes.

How To Increase The WP Memory Limit?

Method 1 – Change The WP Memory Limit Using The (php.ini) File

  1. Find or locate your php.ini file. If you can not find it, then simply create your own php.ini file and place it in the root directory of your WordPress installation.
  2. Open your php.ini file then edit it using your favorite editor.
  3. Find the line: memory_limit = 32M
  4. Change the 32M or any number you find there to your desired limit (e.g. 256M).
  5. Save your changes and reboot your localhost or server.

Note 1: Many shared hosting providers restrict you from accessing the php.ini file. This method is only applicable in case you have direct access to your php.ini file or if you are running your WordPress on localhost. It is good to note as well that this method only affects your PHP memory limit.

Note 2: If you have created your own php.ini file, then you need to add to the file the code line below:
memory_limit = 256M

Php max input time wordpress

Method 2 – Change The WP Memory Limit Using The (wp-config.php) File

  1. Find your wp-config.php file in the root directory of your WordPress installation.
  2. Open the wp-config.php file with a text editor then locate the line that includes: define(‘WP_DEBUG’, false);
  3. Then add after it, the below line of code: define (‘WP_MEMORY_LIMIT’, ‘256M’);
  4. Save the wp-config.php file then refresh your website.

Php max input time wordpress

Method 3 – Change The WP Memory Limit Using The (.htaccess) File

  1. Search for your .htaccess file which should be located in the root directory of your WordPress installation. If you can’t find it then it might be hidden. Thus, make sure to check your hidden files when locating it.
  2. Open the .htaccess file with a text editor and add the following line of code:
    php_value memory_limit 256M
  3. Save the .htaccess file then refresh your website.

Php max input time wordpress

How To Increase Upload Max Size

  1. Edit the WordPress theme’s (functions.php) file by adding: @ini_set(‘upload_max_size’ , ’64M’);
  2. Edit the (php.ini) file as follows:
    upload_max_filesize = 64M
  3. Edit the (.htaccess) file by adding:
    php_value upload_max_filesize 64M

Learn the details step-by-step below.

What Is Upload Max Size?

It is the maximum allowed size for a file to upload to your WordPress website. A file can be a plugin, theme, image, audio, video, or any other kind of file. The default size is 2MB which is considered by many webmasters a very low upper limit for the allowed upload file size.

Why Do I Need To Increase WP Upload Max Size?

If you upload big images, audio/video, or plugin files that surpasses the default limit, then it might be easier for you to increase your maximum file upload size along with your maximum post size instead of constantly using the FTP manager.

How To Increase WP Upload Max Size?

Method 1 – Change The Maximum File Upload Size Using The Theme (functions.php) File

  1. Open your theme files and locate the functions.php file. You can also contact your theme developer for assistance if required.
  2. Add the below code lines to the file:
    @ini_set(‘upload_max_size’ , ’64M’);
  3. Save the functions.php file then refresh your website.

Php max input time wordpress

Method 2 – Change The Maximum File Upload Size Using The (php.ini) File

  1. Find or locate your php.ini file. If you can not find it, then simply create your own php.ini file and place it in the root directory of your WordPress installation.
  2. Open your php.ini file then edit it using your favorite editor as follows:

    – Find the line of:
    upload_max_filesize = 2M
    – Change the 2M or any number you find there to your desired limit (e.g. 64M).

    Note: If you have created your own php.ini file, then you need to add to the file the code line below:
    upload_max_filesize = 64M

  3. Save your changes and reboot your localhost or server.

Note: Many shared hosting providers restrict you from accessing the php.ini file. This method is only applicable in case you have direct access to your php.ini file or if you are running your WordPress on localhost.

Php max input time wordpress

Method 3 – Change The Maximum File Upload Size Using The (.htaccess) File

  1. Search for your .htaccess file which should be located in the root directory of your WordPress installation. If you can’t find it then it might be hidden. Thus, make sure to check your hidden files when locating it.
  2. Open the .htaccess file with a text editor and add the following line of code.
    php_value upload_max_filesize 64M
  3. Save the .htaccess file then refresh your website.

Php max input time wordpress

How To Increase Post Max Size

  1. Edit the WordPress theme’s (functions.php) file by adding: @ini_set(‘post_max_size’ , ’64M’);
  2. Edit the (php.ini) file as follows: post_max_filesize = 64M
  3. Edit the (.htaccess) file by adding: php_value post_max_size 64M

Learn the details step-by-step below.

What Is Post Max Size?

It is the maximum size of the allowed post data. This setting also affects file upload.

To upload large files, this value must be larger than upload_max_filesize. Generally speaking, memory_limit should be larger than post_max_size.

Why Do I Need To Increase Post Max Size?

If you upload big images, audio/video, or plugin files that surpass the default limit, then it might be easier for you to increase your maximum post size along with your maximum file upload size instead of constantly using the FTP manager.

How To Increase Post Max Size?

Method 1 – Change The Maximum Post Size Using The Theme (functions.php) File

  1. Open your theme files and locate the functions.php file. You can also contact your theme developer for assistance if required.
  2. Add the below code lines to the file:
    @ini_set( ‘post_max_size’, ’64M’);
  3. Save the functions.php file then refresh your website.

Php max input time wordpress

Method 2 – Change The Maximum File Upload Size Using The (php.ini) File

  1. Find or locate your php.ini file. If you can not find it, then simply create your own php.ini file and place it in the root directory of your WordPress installation.
  2. Open your php.ini file then edit it using your favorite editor as follows:
    – Find the line of:
    post_max_size = 32M
    – Change the 32M or any number you find there to your desired limit (e.g. 64M).

    Note: If you have created your own php.ini file, then you need to add to the file the code line below:
    post_max_size = 64M

  3. Save your changes and reboot your localhost or server.

Note: Many shared hosting providers restrict you from accessing the php.ini file. This method is only applicable in case you have direct access to your php.ini file or if you are running your WordPress on localhost.

Php max input time wordpress

Method 3 – Change The Maximum Post Size Using The (.htaccess) File

  1. Search for your .htaccess file which should be located in the root directory of your WordPress installation. If you can’t find it then it might be hidden. Thus, make sure to check your hidden files when locating it.
  2. Open the .htaccess file with a text editor and add the following line of code.
    php_value post_max_size 64M
  3. Save the .htaccess file then refresh your website.

Php max input time wordpress

How To Increase The Max Execution Time (PHP Time Limit)

  1. Edit the WordPress theme’s (functions.php) file by adding: @ini_set(‘max_execution_time’, ‘300’);
  2. Edit the (php.ini) file as follows: max_execution_time = 300
  3. Edit the (wp-config.php) file by adding: set_time_limit(300);

Learn the details step-by-step below.

What Is The Maximum Execution Time?

The PHP Maximum Execution Time or PHP Time Limit is the amount of time in seconds that your website will spend on a single operation before timing out. This is useful to avoid any potential server lockup. The default value of the PHP Time Limit is 40 seconds. When a certain operation reaches this execution time limit, the system will return the following fatal error:
The maximum execution time of X seconds exceeded. ( Where “X” is the value ).

Why Do I Need To Increase My Maximum Execution Time?

If you installing a big plugin or a complete demo for a theme, then the default value of 40 seconds might not be enough to complete the operation. You can also increase your PHP time limit temporarily then decrease it back after the completion of your long operations.

How To Increase The Maximum Execution Time?

Method 1 – Change The Maximum Execution Time Using The Theme (functions.php) File

  1. Open your theme files and locate the functions.php file. You can also contact your theme developer for assistance if required.
  2. Add the below code lines to the file:
    @ini_set(‘max_execution_time’, ‘300’);
  3. Save the functions.php file then refresh your website.

Php max input time wordpress

Method 2 – Change The Maximum Execution Time Using The (php.ini) File

  1. Find or locate your php.ini file. If you can not find it, then simply create your own php.ini file and place it in the root directory of your WordPress installation.
  2. Open your php.ini file then edit it using your favorite editor as follows:
    – Find the line of:
    max_execution_time = 40
    – Change the 40 or any number you find there to your desired limit (e.g. 300).

Note 1: If you have created your own php.ini file, then you need to add to the file the code line below:
max_execution_time = 300

Note 2: Many shared hosting providers restrict you from accessing the php.ini file. This method is only applicable in case you have direct access to your php.ini file or if you are running your WordPress on localhost.

Php max input time wordpress

Method 3 – Change The Maximum Execution Time By Editing the (wp-config.php) File

  1. Find your wp-config.php file in the root directory of your WordPress installation.
  2. Open the wp-config.php file with a text editor then locate the line that includes:
    define(‘WP_DEBUG’, false);
    Then add after it, the below line of code:
    set_time_limit(300);
  3. Save the wp-config.php file then refresh your website.

Php max input time wordpress

How To Increase The PHP Max Input Vars

  1. Edit the (php.ini) file as follows: max_input_vars = 2000
  2. Edit the (.htaccess) file by adding: php_value max_input_vars 2000

Learn the details step-by-step below.

What Is The PHP Max Input Vars?

The PHP Max Input Vars is the maximum number of variables your server can use for a single function to avoid overloads. The default value of the PHP Max Input Vars is 1000.

Why Do I Need To Increase My PHP Max Input Vars?

Increasing the PHP Max Input Vars helps in solving some issues related to your menus. If your menu items are not saving successfully or the last entries are being truncated or left off, then increasing this value will be a recommended action. This is especially useful when you are installing a big demo for a theme with lots of menu entries.

How To Increase The PHP Max Input Vars?

Method 1 – Change The PHP Max Input Vars Using The (php.ini) File

  1. Find or locate your php.ini file. If you can not find it, then simply create your own php.ini file and place it in the root directory of your WordPress installation.
  2. Open your php.ini file then edit it using your favorite editor as follows:
    – Find the line of: max_input_vars = 1000
    – Change the 40 or any number you find there to your desired limit (e.g. 2000).

Note 1: If you have created your own php.ini file, then you need to add to the file the code line below:
max_input_vars = 2000

Note 2: Many shared hosting providers restrict you from accessing the php.ini file. This method is only applicable in case you have direct access to your php.ini file or if you are running your WordPress on localhost.

Php max input time wordpress

Method 2 – Change The PHP Max Input Vars Using The (.htaccess) File

  1. Search for your .htaccess file which should be located in the root directory of your WordPress installation. If you can’t find it then it might be hidden. Thus, make sure to check your hidden files when locating it.
  2. Open the (.htaccess) file with a text editor and add the following line of code:
    php_value max_input_vars 2000
  3. Save the (.htaccess) file then refresh your website.

Php max input time wordpress

How To Increase The PHP Max Input Time

  1. Edit the (php.ini) file as follows: max_input_time = 1000
  2. Edit the (.htaccess) file by adding: php_value max_input_time 1000

Learn the details step-by-step below.

What Is The PHP Max Input Time?

The PHP Max Input Time sets the maximum time in seconds a script is allowed to parse input data, like POST and GET. Timing begins at the moment PHP is invoked at the server and ends when execution begins.

Why Do I Need To Increase My PHP Max Input Time?

Increasing the PHP Max Input Time helps in solving issues when uploading large files or installing a big demo of a premium theme.

How To Increase The PHP Max Input Time?

Method 1 – Change The PHP Max Input Time Using The (php.ini) File

  1. Find or locate your php.ini file. If you can not find it, then simply create your own php.ini file and place it in the root directory of your WordPress installation.
  2. Open your php.ini file then edit it using your favorite editor as follows:
    – Find the line of:
    max_input_time = 120
    – Change the 120 or any number you find there to your desired limit (e.g. 1000).

Note 1: If you have created your own php.ini file, then you need to add to the file the code line below:
max_input_time = 1000

Note 2: Many shared hosting providers restrict you from accessing the php.ini file. This method is only applicable in case you have direct access to your php.ini file or if you are running your WordPress on localhost.

Php max input time wordpress

Method 2 – Change The PHP Max Input Time The (.htaccess) File

  1. Search for your (.htaccess) file which should be located in the root directory of your WordPress installation. If you can’t find it then it might be hidden. Thus, make sure to check your hidden files when locating it.
  2. Open the (.htaccess) file with a text editor and add the following line of code:
    php_value max_input_time 1000
  3. Save the (.htaccess) file then refresh your website.

Php max input time wordpress

Summaries

Readable Name Technical Name Recommended Value
WordPress Memory Limit memory_limit 256MB
WordPress Maximum Upload File Size upload_max_filesize 64MB
WordPress Maximum Post Size post_max_size 64MB
WordPress Maximum Execution Time max_execution_time 300
PHP Maximum Input Vars max_input_vars 2,000
PHP Maximum Input Time max_input_time 1,000

Part 2 - Summary Of Changes To (wp-config.php)

Php max input time wordpress

set_time_limit(300);
define (‘WP_MEMORY_LIMIT’, ‘256M’);

Part 3 - Summary Of Changes To (php.ini)

Php max input time wordpress

memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
max_input_vars = 2000
max_input_time = 1000

Part 4 - Summary Of Changes To (.htaccess)

Php max input time wordpress

php_value memory_limit 256M
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_vars 2000
php_value max_input_time 1000

Part 5 - Summary Of Changes To The Theme's Functions

Php max input time wordpress

@ini_set(‘upload_max_size’ , ’64M’);
@ini_set(‘post_max_size’, ’64M’);
@ini_set(‘max_execution_time’, ‘300’);

Part 6 - References

  • PHP Runtime Configuration: https://www.php.net/manual/en/info.configuration.php
  • Editing The (wp-config.php): https://codex.wordpress.org/Editing_wp-config.php

All Your WordPress Needs In One Package

Let’s imagine for a second that you need the following:

The best premium WordPress themes with all the modern features that you would dream of having. That includes web accessibility, responsiveness, conversion-focused layouts, full compatibility with page builders, RTL support, AMP support, bloat-free, extreme speed, validated secure codes, and hundreds of ready-made templates.

You also need white-label options and full freedom without limitations. You also like to get everything with lifetime updates without subscriptions, restrictions, or license keys.

On top of all that, you also like to have the best premium WordPress plugins that would cover all your needs — from speed, security, cleaning, maintenance, page builders, and beyond.

Sounds too good to be true? Well, it was until we made it happen!

WordPress Guides

Best Collection Of WordPress Guides & Checklists

Our complete and latest collection of WordPress guides and resources that cover everything you need to get the most out of your WordPress website.

Download Them All!

All of our guides will be sent to your inbox

How do I increase PHP max input time in WordPress?

How To Increase The Max Execution Time (PHP Time Limit).
Edit the WordPress theme's (functions.php) file by adding: @ini_set('max_execution_time', '300');.
Edit the (php.ini) file as follows: max_execution_time = 300..
Edit the (wp-config. php) file by adding: set_time_limit(300);.

What is Max input time in PHP?

Using PHP max_execution_time directive By default, the maximum execution time for PHP scripts is set to 30 seconds. If a script runs for longer than 30 seconds, PHP stops the script and reports an error.

How do I increase the PHP max time limit and max input vars in WordPress?

How to Increase the Max Input Vars Limit.
In your WordPress root installation locate any of these .htaccess , php.ini , .user.ini or wp-config.php..
Edit the file and paste the directive code..
Once you are done making changes save the file..

How do I increase the maximum execution time of a WordPress site?

Use the WP Maximum Execution Time Exceeded Plugin.
Log into WordPress and select Plugins > Add New..
Search for Use the WP Maximum Execution Time Exceeded and select Install..
Select Activate once the option becomes available..