WooCommerce Currency Switcher Settings Not Saving: max_input_vars
When WooCommerce currency switcher settings are not saving, the pattern is usually the same: you add currencies or select GeoIP countries, press Save changes, the page reloads as if everything went well, and part of what you entered is gone. In most cases neither FOX nor WordPress decided to drop it. PHP did, before WordPress even saw the request, because the settings form sent more fields than the server's max_input_vars limit allows. Below is how to recognise that, how to raise the limit, and the less common causes when the limit is not the problem.
Why settings disappear after saving
All tabs of the FOX settings page (WooCommerce → Settings → Currency) are one HTML form. Save changes sends every tab in a single request, and every input in it is one variable:
- each currency row in the Currencies tab sends about a dozen fields: code, rate, interest, rate floor and ceiling, symbol, position, decimals, separators, description, flag and the base currency marker;
- each country selected in the GeoIP rules is a separate field, so Select all for one currency adds about 250 at once;
- each currency selected for a gateway in the Payments tab is another field;
- the Options, Advanced and Side tabs add their own settings on top.
PHP's max_input_vars setting caps how many of them a request may carry; the default is 1000. When a form sends more, PHP keeps the first 1000 and silently discards the rest. FOX then saves what it received, and most fields that did not arrive are saved as empty or switched off rather than left as they were. When none of the GeoIP fields arrive, the GeoIP rules are cleared.
The form is sent in page order: Currencies, Options, Advanced, Side, Payments, then GeoIP. The end of the form is cut first, and the more fields there are, the further up the cut moves. That gives the typical symptoms, from the most common:
- GeoIP countries are kept for the first currencies and lost for the third or fourth;
- Payments rules selections are lost;
- options in the Side and Advanced tabs switch themselves off: Is multiple allowed returns to No, or the Payments tab never appears after you switch Payments rules on, because it is shown only when the option was actually stored;
- with about 70 currencies or more, the cut reaches the currency table itself: the last rows vanish, or lose their flags, symbols and descriptions.
Check the limit on your server
Open WooCommerce → Status. In the Server environment section, PHP max input vars shows the current value. Compare it with a rough count of your form: currencies × 13, plus every selected GeoIP country, plus every currency selected in payment rules, plus roughly 100 for everything else. Ten currencies are only about 130 fields, but four of them with Select all in the GeoIP rules add about 1000 more, and the form passes the default limit right in the GeoIP tab.
Two more ways to confirm it:
- The PHP error log, if logging is on, contains a warning like Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. written at the moment you saved.
- The stored value differs from what you selected. With WP-CLI,
wp option get woocs_is_multiple_allowedprints1for Yes; a0after you saved Yes means the field was cut.
Raise max_input_vars
The setting belongs to the PHP configuration of the site, so it is changed in one of these places, depending on the hosting:
- Hosting control panel. Most panels have a PHP settings or "PHP INI editor" page with
max_input_varsin the list. This is the safest way. - php.ini or .user.ini in the site root, where the host allows it:
A; PHP configuration (php.ini or .user.ini in the site root) max_input_vars = 5000.user.inifile is re-read only every few minutes by default, so wait before testing. - .htaccess, only when PHP runs as an Apache module:
If the site answers with a 500 error after this, PHP runs as FastCGI or PHP-FPM, which does not accept# .htaccess in the site root, at the bottom php_value max_input_vars 5000php_value. Remove the line and use the panel or.user.ini. - PHP-FPM pool on your own server:
php_admin_value[max_input_vars] = 5000in the pool configuration, then restart PHP-FPM.
ini_set('max_input_vars', ...) in wp-config.php or a plugin does not work. PHP reads the posted form before any WordPress code runs, and this directive cannot be changed at run time.
5000 is enough for most shops. If several currencies use Select all in the GeoIP rules, or the shop has more than 200 currencies, set 10000 or more; the limit only protects the server from abnormally large requests, and a higher value costs nothing in normal use. Then:
- reload WooCommerce → Status and check that PHP max input vars shows the new value;
- open the FOX settings and re-enter what was lost: the cut fields were saved empty, so they do not come back by themselves;
- save, reload the page, and check the last currency's GeoIP rules and the Advanced tab.
Other reasons a setting does not stick
Currencies that come back after you remove them
FOX needs at least two currencies. When fewer than two are stored, it falls back to its default pair (USD plus EUR, or USD plus your WooCommerce currency), so deleting a row can bring back a currency you just removed. To replace a currency, type the new code into the existing row, press the refresh button next to its rate, adjust the symbol and save.
Do this in a row that is not marked as the base currency. On save, FOX writes the code of the base row into WooCommerce's own currency setting, so changing that code changes the currency of the whole store, while product prices stay the numbers they were.
The Append Currency button shows a message instead of a new row
That message comes from the free build of FOX, which is limited to two currencies. It is not a saving problem; see upgrading FOX from the free to the full version.
Parts of the page with their own save buttons
- Designer. Switcher designs are stored with the Save changes and Save and exit buttons inside the designer panel. The main Save changes at the bottom of the page does not store them.
- GeoIP profiles. Add new profile and Update profile store a profile immediately. Add to: only copies its countries into the rules of one currency on the page; the rules are stored by the main Save changes, and the same field limit applies.
Error 403 when saving
A 403 page instead of the reloaded settings comes from a server security rule, usually mod_security, that dislikes the size or content of the request. See error 403 when saving the plugin settings.
The settings page is blank, loads forever or its buttons do nothing
The tabs, drop-downs and buttons of the settings page are run by JavaScript. If Append Currency, Update all rates or the tabs do not react, open the browser console (F12, tab Console) on the settings page and click the button again. An error from another plugin's admin script stops the FOX scripts on the same page. The file named in the error shows which plugin it is; to confirm, deactivate everything except WooCommerce and FOX on a staging copy and test again.
- A tab is empty although the page loaded: a stylesheet of an admin theme or admin customization plugin is hiding the content. Test with that plugin disabled.
- The page hangs after the Statistic option was enabled. Set Statistic in the Advanced tab to No. If the page cannot be opened at all, run
wp option update woocs_collect_statistic 0with WP-CLI. - The save ends with a timeout or a 500 error. The PHP error log names the file that failed.
As a last resort, the FOX options can be returned to their defaults by setting the option woocs_first_activation to 0 (wp option update woocs_first_activation 0 with WP-CLI, or in the wp_options table) and loading any page of the site once. This resets every option (Is multiple allowed, for example, goes back to Yes), clears the GeoIP rules and the payment rules, and keeps the currency list. Make a database backup first and note your settings.
Checklist
- PHP max input vars in WooCommerce → Status is 5000 or more (10000 with large GeoIP country lists).
- Lost data re-entered and saved once more after the limit was raised.
- Currencies replaced by editing a row, not by deleting it, and the base row left alone.
- Designs and GeoIP profiles saved with their own buttons.
- No errors in the browser console on the settings page.
If the settings still do not stick with a high limit and a clean console, open a topic on the FOX support forum with the number of currencies, the PHP max input vars value and the setting that does not save, and we will look at it.