Many WordPress users face the challenge of the maximum file upload size limit, particularly when managing media-heavy websites. Thankfully, it is possible to increase max file upload size by following a few simple steps. Below, we’ll outline the process in clear, easy-to-follow points for your convenience.
IMPORTANT: Before making any changes to your site’s code, it is highly recommended that you backup your website. This is especially important if you are a beginner and unfamiliar with editing code.
Let’s dive into it!
Method 1: Modifying PHP.ini
The second method involves modifying the php.ini file, which is a configuration file for PHP. Here’s how you can increase the max file upload size using this method:
- Access your WordPress site’s files using an FTP client or through your hosting provider’s file manager.
- Locate the php.ini file in the root directory of your WordPress installation. If you can’t find it, contact your hosting provider for assistance.
- Open the file using a text editor and find the following lines:
upload_max_filesize = 50M
post_max_size = 25M
Change both values to your desired maximum file upload size. Save the changes and upload the modified php.ini file back to your server.
Method 2: Update the .htaccess File
One effective method to increase the max file upload size is editing your site’s .htaccess file. To do this:
- Access your website via an FTP client.
- Now, locate the .htaccess file in the root directory.
- Then, add the following lines:
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
Replace 64M with your desired maximum file upload size. Save the changes and upload the modified .htaccess file back to your server.
Step 3: Modify wp-config.php
If the previous step does not yield results, you may need to edit the wp-config.php file. Follow these steps:
- Again, access your site via an FTP client.
- Locate and open the wp-config.php file.
- Add the line:
define('WP_MEMORY_LIMIT', '256M');
Method 4: Contacting Your Hosting Provider
If the above methods don’t work or if you’re uncomfortable modifying files on your own, you can always reach out to your hosting provider for assistance. They will be able to guide you on how to increase max file upload size specifically for your hosting environment.
Checking Max File Upload Size Using phpinfo()
If you’re unsure about the current maximum file upload size on your WordPress site, you can use the phpinfo() function to check it:
- Create a new PHP file called phpinfo.php on your local machine.
- Add the following line of code to the file:
<?php phpinfo(); ?>
Save the file and upload it to your WordPress site’s root directory using an FTP client or through your hosting provider’s file manager.
Access the file in your web browser by visiting http://www.yourdomain.com/phpinfo.php (replace yourdomain.com with your actual domain name). You will see a detailed PHP information page, and you can find the maximum file upload size under the upload_max_filesize directive.
IMPORTANT: Remember to remove the phpinfo.php file from your server after checking the max file upload size to ensure the security of your website.
Conclusion
By following the steps outlined above, you can easily increase the max file upload size on your WordPress site. This will allow you to manage larger files seamlessly, without facing frustrating limitations.
If you need any help, feel free to contact me.