![increase upload file size in wordpress](https://metaaffinity.net/wp-content/uploads/2024/01/How-to-increase-max-file-upload-size-in-WordPress-jpg.webp)
Three Ways to Increase WordPress Maximum File Upload Size
To modify WordPress’ file upload size, you need to access your hosting control panel and WordPress administrator dashboard. Make sure you have access to both of them before diving into the tutorial below.
Here are three ways to increase WordPress’ maximum file upload size:
1. Modifying .htaccess File
Many hosting providers allow you to change the PHP settings via .htaccess file. You can take advantage of this ability to apply php_value upload_max_filesize rule in this file.
Here’s how this method works:
- Access the WordPress root directory (public_html) via an FTP client or File Manager. For Hostinger users, you can access the File Manager in your cPanel dashboard.
- Open the .htaccess file and add the following code to the bottom of the file. Once you’re done, save the changes.
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value max_input_time 300
2. Configuring php.ini File
This method is most suitable for WordPress sites with VPS hosting as shared hosting providers generally don’t allow editing the php.ini file. If you’re running on shared hosting, make sure to contact your hosting support team and clarify whether or not you can modify the php.ini file.
Here’s how to increase the maximum file upload size by configuring php.ini file:
- Access the WordPress root directory (public_html) via an FTP client, File Manager, or SSH (if it’s supported), then open the php.ini file. If you cannot find the file, create one under the same name and filetype in the root directory.
- Add the following code to the php.ini file and save the changes.
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
3. Editing functions.php file
Alternatively, you can increase WordPress’ maximum file upload size by modifying your theme’s functions.php file. Despite so, please note that the modification will revert to default if you change your site’s theme.
Here’s how to change the maximum file upload size by modifying functions.php file:
- From your WordPress dashboard, navigate to Appearance -> Theme Editor.
- Open the theme functions file (functions.php) and add the following code to the file. Once you’re done, save the changes.
@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );