Black Friday: 30% OFF on all plans, applied automatically at checkout View plans
Log in Cart

max_input_vars, memory_limit and company: the settings that unblock WordPress

Five PHP directives explain most import and upload failures. What each one does and where to change it.

Updated on Sep 2, 20262 min read
Demos and templates

Almost every failure in demo import, heavy theme upload, or options panel saving comes down to one of these five PHP directives. It’s worth knowing which symptom maps to which number, because that saves you from changing five things when one would fix it.

Where to see the current values

In the dashboard: Tools > Site Health > Info > Server. This is the most reliable reading, because it shows what’s actually in effect for your WordPress, not what’s written in some file that might be getting ignored.

The five, and the symptom for each

max_execution_time: the maximum time a PHP script is allowed to run. Symptom: the operation stops midway, always at roughly the same point. Working value: 300.

memory_limit: how much memory PHP can use. Symptom: a blank white screen with no message at all, or an allowed memory size exhausted error. Working value: 300M.

max_input_vars: how many fields PHP accepts in a submission. This is the trickiest of the five: it doesn’t throw an error. The theme’s options panel saves and comes back with half the settings lost; the import finishes incomplete. Working value: 5000.

upload_max_filesize: the maximum size of a single uploaded file. Symptom: the 60 MB theme won’t upload. Working value: 100M.

post_max_size: the maximum size of the entire submission. It needs to be equal to or greater than upload_max_filesize, or the smaller limit wins and you’re left thinking the change didn’t take effect. Working value: 100M.

Where to set it

In order of likelihood of working:

  • Hosting control panel. cPanel, Plesk, and hPanel have a PHP configuration screen. When it exists, it’s the right path: the change survives updates and doesn’t depend on which server is running.
  • .user.ini in the WordPress root, one directive per line: memory_limit = 300M. Works on most modern hosts.
  • .htaccess in the root, with php_value in front: php_value memory_limit 300M. Only works on Apache. On nginx the file is ignored entirely, with no warning.
  • php.ini, when the host gives you access to it.

After making a change, reload the Site Health page and check whether the number changed. If it didn’t, the file you edited isn’t the one that’s actually in effect there. Try the next one on the list.

If the host won’t allow it

Cheap shared plans tend to lock these values down. Two workarounds: send large files via FTP, which bypasses the upload limit, and import the demo in parts, when the theme offers the option to choose what gets imported.