{"id":1634,"date":"2017-01-07T14:50:19","date_gmt":"2017-01-07T06:50:19","guid":{"rendered":"http:\/\/cn.hostease.com\/xueyuan\/?p=1634"},"modified":"2017-01-07T14:50:19","modified_gmt":"2017-01-07T06:50:19","slug":"wordpress-max_input_vars%e8%ae%be%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/cn.hostease.com\/xueyuan\/jishu\/chengxujiaoben\/wordpress-max_input_vars%e8%ae%be%e7%bd%ae\/","title":{"rendered":"WordPress-max_input_vars\u8bbe\u7f6e"},"content":{"rendered":"<h3>max_input_vars<\/h3>\n<p>The most common issue stems from the <code>max_input_vars<\/code> PHP directive, which was introduced in PHP 5.3.9. By default, max_input_vars is set to 1000, which can easily be reached with the WordPress menu system, since each menu item sends about 12 variables per item.<\/p>\n<h4>Solution<\/h4>\n<p>The solution is to simply configure the <code>max_input_vars<\/code> so that it is large enough to handle the number of variables being sent by WordPress to save your menu.<\/p>\n<h5>php.ini<\/h5>\n<p>If you have access to your <code>php.ini<\/code>, you can just add this directive (or change the value of the existing directive) to includes your max input variables:<\/p>\n<div>\n<div id=\"highlighter_30265\" class=\"syntaxhighlighter  php\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"php plain\">max_input_vars = 3000;<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>If you don\u2019t have access to this file (as with many shared hosts), you may need to contact your host to increase this limit.<\/p>\n<h5>.htaccess<\/h5>\n<p>Alternatively, you can try placing this in your <code>.htaccess<\/code>. This won\u2019t work on some servers, so your mileage may vary.<\/p>\n<div>\n<div id=\"highlighter_663229\" class=\"syntaxhighlighter  php\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"php plain\">php_value max_input_vars 3000<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h5>.user.ini<\/h5>\n<p>If you have a .user.ini file, you can add the following to override the default php.ini value<\/p>\n<div>\n<div id=\"highlighter_965999\" class=\"syntaxhighlighter  php\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"php plain\">max_input_vars = 5000;<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<p>\u539f\u6587\u94fe\u63a5\uff1ahttps:\/\/sevenspark.com\/docs\/ubermenu-3\/faqs\/menu-item-limit<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>max_input_vars The most common issue stems from the max &#8230; <a title=\"WordPress-max_input_vars\u8bbe\u7f6e\" class=\"read-more\" href=\"https:\/\/cn.hostease.com\/xueyuan\/jishu\/chengxujiaoben\/wordpress-max_input_vars%e8%ae%be%e7%bd%ae\/\" aria-label=\"\u9605\u8bfb WordPress-max_input_vars\u8bbe\u7f6e\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[14,11],"tags":[524],"class_list":["post-1634","post","type-post","status-publish","format-standard","hentry","category-wordpress","category-chengxujiaoben","tag-wordpressmax_input_vars"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/1634","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/comments?post=1634"}],"version-history":[{"count":1,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/1634\/revisions"}],"predecessor-version":[{"id":1635,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/1634\/revisions\/1635"}],"wp:attachment":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/media?parent=1634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/categories?post=1634"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/tags?post=1634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}