Increasing the upload_max_filesize in WordPress
  • November 28

Increasing the upload_max_filesize in WordPress

The default upload file size for WordPress is 2 MB, which is a problem if you want to upload a large files. You may increase max file size in few ways.

Directive upload_max_filesize in php.ini

Locate the php.ini file inside the wp-admin directory. Find this line in the php.ini file “upload_max_filesize = 2M” and replace it with a higher value,e.g. upload_max_filesize = 64M Keep in mind, there is also max post size limit and it should be larger or equal than upload file size: post_max_size = 64M Save the changes to the file inside your wp-admin directory. Depending on server configuration new settings could work once after changing or you may need to reboot server and PHP interpreter. Try the upload again If you still have issues, look for this file in your root directory and make the same changes.

PHP directives via .htaccess

If you don't have access to PHP configuration file, you can try to set necessary values using .htaccess file of Apache web-server. If you work with Apache, then .htaccess file is already created in your WordPress site root directory and you can add following code: php_value upload_max_filesize 20M php_value post_max_size 20M As a rule changes in .htaccess come into force once after saving.

Using ini_set() function

Upload_max_filesize and post_max_size directives could be changed using PHP functions ini_set() in wp-config.php file or use plugin if it's allowed in interpreter settings: ini_set( 'upload_max_size' , '20M' ); ini_set( 'post_max_size', '20M'); If you have used all these methods without success, we recommend to contact with your hosting provider for help.

Did you know ?

One standard license is valid only for 1 project. Running multiple projects on a single license is a copyright violation.

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.