Have you achieved the maximum things menu constrain on WordPress? When you include more than a specific measure of menu things do they simply erase on sparing? This instructional exercise will demonstrate you to build this breaking point and clarify what’s causing it.
Why Can’t I Add More Menu Items?
The reason that you can’t add any more menu items to your WordPress menus is because of your server settings. There was a new php.ini option added called max_input_vars in the PHP 5.3.9 update. Max_input_vars controls the maximum amount of input variables. This is to help protect against denial of service attacks. Most servers will be set to ‘1000’ max_input_vars, this is roughly around 90 menu items.
How To Tell What Your max_input_vars Value is?
The best way to tell what your max_input_vars is to create a phpinfo.php file and upload it on your server. The phpinfo file will tell you what your php server settings are.
- Create a file called phpinfo.php
- Add this line of code into the phpinfo.php file
<?php phpinfo(); ?>
- Upload phpinfo.php to your server
- Navigate to where you uploaded it on your server for example www.example.com/phpinfo.php
- Scroll down to till you find max_input_vars and the number beside it is what your server will be set at.
How To Check Your Menu Items Limit With Woocommerce
Alternatively if you have woocommerce installed you can check by:
- Logging to the WordPress admin section
- Go to Woocommerce
- Then click on system status
- Scroll down until you see PHP Max Input Vars
Creating the Administration Page
As we continue with the plugin in this article, this is what we’re going to be doing:
- Create the markup for the administration page that inherits the native WordPress styles.
- Introduce an option with which the user can interact.
- Sanitize the option before saving it.
- Retrieve the value of the option and set it equal to the value in the page.
In this tutorial, we’re going to focus on the next two points. In the next article, we’ll focus on points three and four.
For those who are familiar with the Settings API, this seems like overkill. But as you’ll see through the remainder of this tutorial and this series, there’s a reason why we’re going to be breaking it down into smaller pieces like this.
Read More : SOCIAL NETWORK ANALYSIS
Increasing Your Max_input_vars Value
The best way I’ve found to increase your max_input_vars value is to:
- Connect to your site via FTP or File Manager
- Navigate to wp-admin folder
- Create a file inside the wp-admin folder called php.ini
- Add in this line:
max_input_vars = 5000
Check To See If Your Max_input_vars Has Changed
Finally check to see it has worked and if you need to add more menu items just increase the max_input_vars value to whatever you need.