Having problems because of the limited upload size on your WordPress site?? Don’t worry, I’ll show you how you can increase the maximum upload file size in your WordPress site to anything you like.
Now before we dive into the solution, you should know why your upload limit is very low on your WordPress website.
The reason why the maximum upload file size is low for you is because you are probably using shared hosting, now the problem with shared hosting is that, shared hosting is trash… It’s slow, it will crash if you don’t have proper caching and if you overuse the resources they will just suspend your account.
And that’s the reason there’s a limit to the file upload, which is to prevent excessive use of resources that slows the shared hosting server.
Okay so now let’s start with the most popular method to increase upload size.
Increase Maximum Upload file Size in cPanel –
If you are using any sort of managed web hosting like shared hosting then you will get a cPanel dashboard from where you can control all the things of your website and host which means that you can change anything you like on your website.
To begin, first, go to your web hosting provider and search for cPanel or hPanel. Now log in to your cPanel and search for “MultiPHP ini Editor”
Click on the “MultiPHP ini Editor” and after that select your domain name from the drop-down menu.
After selecting your domain you’ll get a few PHP directives shown below. Here you will need to change the values of “post_max_size” and “upload_max_filesize”. Change the values to whatever you need. NOTE: Change only the number and keep the “M” at the end like “250M”.
After changing the values to your desired choice, click on the apply button at the bottom which will save the settings. Now if you go to your WordPress admin dashboard then you will see the changes
Increase Maximum Upload file Size in Apache server
Now, if your WordPress website is hosted on cloud hosting with an apache server then here are the steps that you can follow to increase the maximum upload file size.
To begin first open Filezilla, once opened log in to your apache server using your IP, username, and password. Use port 22 and click on Quick Connect.
Here we will have to find the php.ini file. Most of the time the file path for the “php.ini” file is “/etc/php/<php_version>/apache2/php.ini”.
Here “php_version” is the version of PHP that your WordPress site is currently using. You can see which version of PHP your website is using by going to WordPress admin > Tools > Site health, there go to the “Info” tab and scroll down, and select server. You’ll see the PHP version your website is using.
Now go back to Filezilla and go inside the PHP version folder that your website is using, where you will find the php.ini file.
Right-click the php.ini file and click on download. After the download finishes, open the php.ini file with notepad or any other file editor that you use.
Inside the php.ini you will need to search for “post_max_size” and “upload_max_filesize”. You can do that by using CTRL+F. Change the values to whatever you want and save the php.ini file.
After that go back to FileZilla and upload the php.ini file back to the path from where you downloaded it. A popup will appear saying “a file with that name already exists”, select the “Overwrite” option and click on “OK” to continue.
Once the file is uploaded, right-click and refresh.
Now for the changes to work, you’ll need to log in to your apache server using putty or directly from the cloud console of your hosting provider. Once logged in paste the command given below in the terminal and press enter –
service apache2 restart
This command will restart your apache server and all the changes that you made will show in the frontend. After restarting your server, close the cloud shell and go back to your WordPress dashboard. Refresh the WordPress admin to see the changes.
Increase Maximum Upload file Size in NGINX
Now if your WordPress website is hosted on cloud hosting and with an Nginx server then here are the steps to increase maximum upload file size in Nginx.
First, open FileZilla and login to your Nginx server, the file path for the php.ini in the Nginx server is “/etc/php/<php_version>/fpm/php.ini”. Go to this file path and download the php.ini file.
Open the downloaded php.ini with notepad and search for “post_max_size” and “upload_max_filesize”, change the values to whatever you want like change 8M to 200M and save the file.
Go back to FileZilla and upload the edited php.ini file to the path from where you downloaded it. Select “overwrite” in the popup to continue.
Once the file upload is finished, log in to your Nginx server using putty or directly from your cloud console.
After logging in enter the command given below in the shell-
sudo nano /etc/nginx/nginx.conf
This command will open the nginx.conf file in the nano editor. Now all you need to do here is to add this line below “http”-
After pasting the line in the nginx.conf file, save the file, and exit from the nano editor by using CTRL+X, it will ask you to save the file first which you can do by pressing “y”.
Once the file is saved, paste the two commands given below one by one in the shell to finish.
service php7.4-fpm reload service nginx reload
After this go back to your WordPress website and refresh it to see the changes.
Increase Maximum Upload file Size using Plugin
If you don’t want to do all that technical stuff to just increase the maximum upload file size in your WordPress website then what you can do is that you can use a plugin called “WP Increase Upload File Size | Increase Maximum Execution Time”.
It’s a free plugin that you can use that can get the job done easily. Download the plugin from here – https://wordpress.org/plugins/wp-maximum-upload-file-size/#installation
After downloading the plugin., log in to your WordPress admin dashboard and go to Plugins>Add new. Upload the plugin and activate it.
You can also search for this plugin directly from your wordpress admin by going to Plugins>Add new, search for “WP Increase Upload File Size | Increase Maximum Execution Time”, Install and activate.
After activating the plugin you can go to the plugin settings from the admin menu on the left.
Go to the plugin settings and from the dropdown select the Maximum Upload File Size and after that click on “save changes”, which will change the Maximum Upload File Size for your WordPress site.
NOTE: Now using a plugin to change something on your WordPress site is easy, but watch out, sometimes you might break your site. When using cloud hosting you have more risk of breaking your site by uploading new plugins, this has happened to me a lot of times. Before uploading or changing a critical part of your WordPress site be sure to backup your site to external storage.
And that is how you can increase the maximum upload file size of a WordPress website that is using Apache, Nginx, and shared hosting Cpanel. If you have any questions or you are getting stuck on any step then comment below, thank you.
Unable to locate php.ini in Apache and NGINX server.
If you are using Apache server than the php.ini file will be located at “/etc/php/<php_version>/apache2/php.ini” and if you are using nginx then the location will be “/etc/php/<php_version>/fpm/php.ini”, but if yours is not there then try to find it in the “/etc/php/” directory, it will take some time but if you search all the folders inside that directory then you will eventually get the php.ini file.
Is it safe to increase the maximum upload size limit on your WordPress website ?
Depends, if you are just increasing it a few mb or by a lot. There’s a reason the web hosting providers put a limit to the upload size. Increasing it by a lot can crash your wordpress website if it’s on shared or cheap hosting.
Now most of the people want to increase the upload size limit because they are unable to upload high quality images to their website, but if you are doing this to be able to upload videos then don’t, you’ll crash your website. If you want to host videos then buy vps servers or host it on youtube.
For an average website like mine, you just need a maximum upload size of 64MB. You don’t need more than that.