Voxfor - All rights reserved - 2013-2025
We Accepted





When working with WordPress, you may encounter upload_max_filesize Error in WordPress when trying to upload a file:
This error occurs because the file you are trying to upload is over the size limitation set by your web servers PHP settings. This parameter is also written into the php.ini file and is called upload_max_filesize to show the maximum size of the uploaded files. Allowing anybody to upload a file larger than the limit will not be possible as WordPress will stop the upload and instead display the error message.
In fact, Web servers use access control and threshold of established security and performance restrictions must not be overused. One of these limitations is the file size that can be uploaded to the system and this is set by the PHP settings. By default, the upload_max_filesize is usually set to a small value such as 2MB and this is not preferable when uploading files such as themes, plugins or even images and videos.
To resolve this issue, you’ll need to increase the upload_max_filesize setting. Here are a few methods you can try:
If you have full permissions to your serverโs php.ini file you can tweak directly the upload_max_filesize value. Follow these steps:
Edit the php.ini File
Open the php.ini file in a text editor and search for the following directives:
upload_max_filesize = 2M
post_max_size = 8M
Upload Max filesize and post max size should be increased to a particular value, for example, 64M or 128M. Always see to it that post_max_size is greater than upload_max_filesize for file uploads to run smoothly.
Example:
upload_max_filesize = 64M
post_max_size = 128M
If you donโt have access to the php.ini file, you can try modifying the .htaccess file in your WordPress root directory. Hereโs how:
Add the Following Lines
Add these codes to the .htaccess file:
php_value upload_max_filesize 64M
php_value post_max_size 128M
php_value memory_limit 128M
php_value max_execution_time 300
php_value max_input_time 300
For users who do not have access to the server configuration files, you can also try adding the following lines to your WordPress wp-config.php file:
Add the Following Code
Add these lines just above the โ/* That’s all, stop editing! Happy blogging. */โ line:
@ini_set( 'upload_max_filesize' , '64M' );
@ini_set( 'post_max_size', '128M');
@ini_set( 'memory_limit', '128M' );
@ini_set( 'max_execution_time', '300' );
@ini_set( 'max_input_time', '300' );
If the previous methods do not work (especially on shared hosting), it’s possible that your host has restricted the file upload size. Reach out to your hosting provider chat support or open a ticket and ask them to increase the upload_max_filesize limit for you.
If you’re not comfortable with code or file editing, you can use a plugin to modify the upload limits. Plugins like WP Maximum Upload File Size can make it easier to change upload limits directly from the WordPress dashboard.
The upload_max_filesize error in WordPress is a common issue that can be resolved by increasing the upload limits in your serverโs PHP settings. You can try modifying the php.ini file, .htaccess file, or wp-config.php file, or use a plugin to make the changes. If none of these solutions work, contacting your hosting provider is the next best step.
By following these steps, you should be able to upload bigger files to your WordPress site without encountering the error.
Vinayak Baranwal wroteย this article.ย Use the provided link to connect with Vinayak on LinkedIn for more insightful content or collaboration opportunities.