Increasing PHP memory limit with max_input_vars

By default, the maximum number of input variables (through GET and POST requests) allowed for PHP scripts is set to 1000. It’s your PHP memory limit, which helps you run plugins and scripts. To verify the current value of the max_input_vars directive and other directives, you can use the phpinfo() function.

As for increasing PHP max_input_vars. There are several ways to do it.


The following are some solutions available to fix your max_input_vars size issue in WordPress.

1). Contact your Hosting Company

Yes, this is the most prefer way. Contact your hosting provider company and Ask them to increasing the max_input_vars size according to your requirements (recommended set it to 3000).


2). Check your current server settings

Another solution is, you can login to your server’s cPanel and look there for PHP settings. Often there’s an option to edit PHP settings “per host” or “per domain” and you may find it there.

If there’s no such option:

1. create a file named “php.ini”
2. put following line inside

max_input_vars = 3000;

3. save the file and upload it to your server to the root (main) folder of your domain.

Note :- Most of the Shared Hosting Company does not allow access to this file. In that way so if above doesn’t work, there’s another way to check:


3). Using .htaccess file

In WordPress, there is a .htaccess file. WordPress uses this file to manipulate how Apache (server) serves files from its root directory, and sub-directories. Therefore, this file is very important. Do not edit what’s originally written in this file. You can add some directives at the end of the file to increase the max_input_vars.

  1. Use your favorite FTP program to access your WordPress installation.
  2. Go to the root directory, it’s the directory where you can find your wp-config.php file. You should be able to find your .htaccess file.
  3. Download a copy of it onto your computer to save as backup.
  4. Open it and added the following into a newline at the end of the file.
    php_value max_input_time 3000
  5. Save your changes and overwrite the .htaccess file on your server.
  6. Go back to your System Informations and check if your values have changed. If not, you should contact your hosting company for assistance in editing these values in your php.ini file.

If that doesn’t work either or breaks the site, edit the file again to remove the line and save the file.


Finally, if you find the “Increase the PHP Max Input Vars” tutorial useful, feel free to share it with your friends. and show us some love.

Thank You

Share this post:

Leave a Reply