
9 Essential WordPress Security Tips to Protect Your Website
February 16, 2024
ClickFunnels VS WordPress From Someone Who Uses BOTH DAILY
February 22, 2024Two critical settings that may need adjustment are the PHP time limit and the maximum input variables (max_input_vars). This article and video guides you through the process of increasing these limits, ensuring your WordPress site runs efficiently and effectively.
Understanding PHP Time Limit and Max Input Vars
Before diving into the how-to, it’s essential to understand what these terms mean.
- PHP Time Limit: This is the maximum time a PHP script is allowed to run before it is terminated. The default value is often 30 seconds, which is adequate for most tasks. However, complex scripts, such as those used in WordPress, might require more time.
- Max Input Vars: This setting determines how many input variables may be accepted. Input variables include request variables like GET, POST, and COOKIE data. A low limit can cause issues with menu saving and other functionalities in WordPress.
Increasing these limits can prevent errors such as “Maximum execution time of 30 seconds exceeded” or issues with saving large menus or with complex themes and plugins.
Increasing PHP Time Limit and Max Input Vars in WordPress
Method 1: Editing the wp-config.php File
- Access Your wp-config.php File: This file is located in your WordPress site’s root directory. Access it via FTP or File Manager in your hosting control panel.
- Modify the File: Add the following lines to increase the PHP time limit and max input vars:
@ini_set('max_execution_time', '300'); // Increase PHP time limit to 300 seconds
@ini_set('max_input_vars', '3000'); // Increase max input vars to 3000
(Adjust the numbers as needed)
Method 2: Updating the .htaccess File
- Locate Your .htaccess File: This is also in your WordPress site’s root directory.
- Edit the File: Add the following lines:
php_value max_execution_time 300
php_value max_input_vars 3000
Again, adjust the values as per your requirements.
Method 3: Using php.ini File
- Create or Edit php.ini File: This file may not exist in your WordPress directory. If it doesn’t, create a file named
php.ini
. - Add the Required Code: Insert the following lines:
max_execution_time = 300
max_input_vars = 3000
Method 4: Contact Your Hosting Provider
If you’re uncomfortable editing files or if the methods above don’t work, contact your hosting provider. Most providers are willing to adjust these settings for you.
Enjoy the content? Sign up for my newsletter! I don’t sell your email and I don’t email frequently. You’ll receive content just like this from myself, not ChatGPT or a team of marketers that aren’t subject matter experts. #thelastrealblogstanding