To increase the maximum upload file size in WordPress, you can try the following methods:
Method#1: Editing the php.ini File
- Locate the php.ini file on your server. If you’re unsure of its location, you can create a new file called “info.php” and place the following code in it:
phpinfo(); - Upload the info.php file to your WordPress root directory.
- Access the info.php file in your web browser (e.g., http://www.example.com/info.php) to view the PHP configuration information.
- Look for the “Loaded Configuration File” value to identify the exact php.ini file being used.
- Open the php.ini file in a text editor.
- Find and modify the following settings (or add them if they don’t exist):
upload_max_filesize = 64Mpost_max_size = 64Mmax_execution_time = 300- Save the changes to the php.ini file.
- Remove the info.php file from your server.
Method#2: Editing the .htaccess File
- Access your WordPress root directory using an FTP client or file manager.
- Locate the .htaccess file. If you can’t find it, make sure your FTP client or file manager is configured to show hidden files.
- Open the .htaccess file in a text editor.
- Add the following code at the beginning or end of the file:
php_value upload_max_filesize 64Mphp_value post_max_size 64Mphp_value max_execution_time 300php_value max_input_time 300- Save the changes to the .htaccess file.
Method#3: Modifying the functions.php File
- Access your WordPress theme directory using an FTP client or file manager.
- Locate the functions.php file within your active theme folder.
- Open the functions.php file in a text editor.
- Add the following code at the end of the file:
@ini_set( 'upload_max_size' , '64M' );@ini_set( 'post_max_size', '64M');@ini_set( 'max_execution_time', '300' );- Save the changes to the functions.php file.
Method#4: Using a Plugin
- Log in to your WordPress dashboard.
- Go to “Plugins” -> “Add New.”
- Search for a plugin called “Increase Maximum Upload File Size.” here is the link
- Install and activate the plugin.
- Once activated, go to “Settings” -> “Max Upload Size.”
- Configure the maximum file upload size as desired.
- Save the changes.
After applying any of these methods, the maximum upload file size in WordPress should increase according to the values you set. Remember to adjust the values (e.g., ’64M’) to your preferred file size limit.
