5 Ways To Increase the Maximum Upload File Size in WordPress
Hi, Friends today I am going to telling you about ‘5 Ways To Increase the Maximum Upload File Size in WordPress’ When you have a WordPress website, you have to upload files every now and then to keep your site active and pretty. So you need to know that there is more than one way to upload your picture, theme or any other content to your WordPress. Basically, There are three ways to upload files to WordPress.
- Upload your media, themes, or plugin files directly from the WordPress Dashboard.
- Log in to your hosting provider by accessing their online file manager in CPanel.
- Download and Install FileZilla and connect to your server via FTP account
If you want to upload anything other than media, themes or plugins, you can always upload them via a file manager. However, for all normal uploads, simply navigate to your dashboard location within the WordPress Dashboard and choose add/upload file.
For example, if you want to add a video, navigate to Media>Add New and either select the file from your computer or you can just drag and drop it in the box. Here’s a screenshot:
Did you notice something in the screenshot above? Yes, the maximum upload file limit of just 2MB. Isn’t this off-putting? And this limit also applies when you want to upload a theme or plugin directly from the WordPress Admin Dashboard. This threshold varies from hosting though.
Don’t worry though; we’re here to tell you exactly how to increase the maximum upload file limit.
Here are the steps you can take to increase the maximum upload file limit. Depending on your server, any one of them should work.
Note: Please make sure to create a backup file before making any changes.
1.Modify or Upload PHP.ini File
PHP.ini contains the PHP configuration for your server. You can find it in the root directly of your server. Go to your hosting root directly and search for PHP.ini file. Due to security reasons, it might be hidden, so don’t forget to check “Show hidden files”.
Open the PHP.ini file with any text editor and search for the three settings to modify them according to your requirements. we’ll use the following numbers for this example:
- upload_max_filesize = 100M
- post_max_size = 100M
- max_execution_time = 300
If you didn’t find the PHP.ini file, then don’t worry! You can manually upload in your hosting root directly. You just need to login to your hosting and open CPanel and upload PHP.ini file In CPanel>public_html.
If you don’t get PHP.ini file then download from here
sometimes your server’s php.ini file is named as php5.ini, hence, don’t get confused between the two.
2. Upload or Modify .htaccess
.htaccess is an important file and contains various configurations for your server. Most hosting providers keep it hidden though. to modify it, you need to check “show hidden files” once again and locate the .htaccess file within the root directly of your server.
Open it with any editor and paste these three lines at the end of the file where it says #END WordPress:
- php_value upload_max_filesize 25MB
- php_value post_max_size 27MB
- php_value memory_limit 30MB
If you don’t find the .htaccess file, you can upload manually in your hosting root directory. You just need to login to your hosting and open CPanel and upload PHP.ini file In CPanel>public_html.
If you don’t get .htaccess file then download from here
3. Edit of Modify WordPress File:
If the above two methods didn’t work for you, there is always an alternative. You can paste the following 3 lines with your WordPress files. These lines can be written in wp-config.php, themes functions.php file etc. However, this is not the recommended way to increase upload file size limit.
4. Increase Upload Size Using cPanel Linux Hosting:
Log in to your cPanel and navigate to Select PHP Version-> Switch to PHP Options. In Switch to PHP Options, you can edit your upload size limit.
If you don’t want to do it manually, there is always a plugin in the WordPress repository. You just need to find the right plugin that is compatible with your current WordPress versions. Try using Increase Upload Max Filesize which is compatible with the latest versions of WordPress.
From the left pane of your WordPress Dashboard, navigate to Plugins->Add New, search for the Increase Upload Max Filesize plugin from the top right corner, and install it, Once activated, if your upload_max_size is less than 32MB, it will automatically take it to 32MB. Same goes for Post_max_size. Once the plugin is activated and your post max size is less than 32MB, it will automatically be increased to 32MB.
However, you want to take these limits to above than 32MB, right? From the left pane, navigate to Tools->Increase Upload Maz Filesize and set your custom variables there. you’re done!