How to Increase the File Size Upload Limit in WordPress

Troubleshooting  Last Updated: Time to Read: 2 minutes

When uploading HD videos or images to your WordPress Media Library, you may notice them fail or receive an error that the file size exceeds your max upload limit. This is almost always determined by your web host and can be as low as 2MB, which is not enough for media files such as audio or video.

max-upload

In most cases it is best to consult your web host documentation or contact their support for help changing this limit. The following instructions may also help if you know your way around your server and are comfortable editing WordPress files.

If you run WordPress in Multi-site mode and have Network Admin privileges, you can usually adjust the file size limit easily from My Sites  → Network AdminSettings

max-upload-mu

If you are limiting overall site file space, ensure the number in the MB field is sufficient for the file types you want your sites to be able to upload. the default 100Mb can fill up extremely fast if the site needs to upload an HD video, for example. You can adjust this on a per-site basis from the Site’s Edit panel.

Enter an appropriate number in the KB to set the max upload file size. You can type “100MB to KB” into Google if you are unsure how to convert megabytes to KB. For GB it is “1GB to KB” etc.

Note that this may still be ignored if your host is forcing a lower file upload limit via htaccess or your PHP configuration, explained next.

 .htaccess

This is the easiest of the solutions as it is a file you (normally) can control on your web space. When viewing your site root in your host control panel or FTP client, the .htaccess should be visible just below the wp-includes folder.

htaccesswp

Download the file to your desktop and open it in a plain text or HTML editor. Some WordPress plugins such as WP htaccess Control allow you to edit this file from your WordPress admin and can be found under Plugins > Add New by searching for the plugin name.

Add the following code to the end of the file:

If editing locally, save the file, then upload it back to your site root and overwrite the existing.

PHP.INI

Unfortunately most hosts do not allow you to edit the PHP.ini yourself unless you have a dedicated/VPS server or managed WordPress hosting. If you do not see a php.ini when browsing your webspace via FTP, first contact your host to ask if they can increase your file size upload. If they won’t, you can try creating the file yourself.

Download the file to your desktop and open it in a plain text or HTML editor and look for the following and modify the numerical values:

If you are creating your own file, copy the above into the file and ensure it is saved as php.ini , then upload to your site root where the WordPress files are. If you are on PHP 5, you may also need to try naming it php5.ini .

As a last resort, you can edit the functions.php  under Appearance > Editor on single WordPress installs and add the following to the very bottom:

Note that this is only a temporary solution, as this edit will be overwritten when your theme is next updated.