WP upload max size is the maximum allowed size for a file to upload to your WordPress website. A file can be a theme, plugin, image, video, audio, document or any other kind of file. The default upload max size for WordPress is 2MB which is very low for any website. If you want to upload a file that exceeds 2MB, then it will be prudent for you to increase your maximum file upload size.
How to increase WP upload max size
The recommended WordPress maximum file upload size is 64MB.
a. functions.php
- Open your theme files and locate the functions.php file. You can contact your theme developer for assistance if required.
- Locate the line that has; @ini_set(‘upload_max_size’ , ‘2M’);. If you can’t find that line, you can simply add it.
- Change the upload max size from 2M to 64M.
- Save the functions.php file then refresh your website.
b. php.ini
- Locate the php.ini file. If you can not find it, then simply create your own php.ini file and place it in the root directory of your WordPress installation. Using cPanel or FTP/SFTP, go to File Manager > public_html.
- Locate the .php.ini file under the public_html folder, right click on it and select the “Edit” option.
- Locate the line that has; upload_max_filesize = 2M. If you created your own php.ini file, ensure you add the line.
- Change the upload max size from 2M to 64M.
- Save the php.ini file then refresh your website.
Some shared hosting providers restrict you from accessing the php.ini file. This method is only applicable in case you have direct access to your php.ini file or if you are running your WordPress on a local host.
c. .htaccess
- Locate the .htaccess file in the root directory of your WordPress installation. If you can’t find it then it might be hidden. Make sure to check your hidden files when locating it. Using cPanel or FTP/SFTP, go to File Manager > public_html.
- Locate the .htaccess file under the public_html folder, right click on it and select the ‘Edit’ option.
- Locate the line that has; php_value upload_max_filesize 2M. If you can’t find that line, you can simply add it before the # END WordPress line.
- Change the upload max size from 2M to 64M.
- Save the .htaccess file then refresh your website.