Many times, when you are working with WordPress, you need to upload a larger file than usual, such as an image, a document or a video. The question is, how to increase maximum file upload size in WordPress?
Depending on your WordPress installation, it is most likely that your file upload size is not too large (maximum upload size in WordPress ranges from 2MB to 150MB depending on the settings of your web hosting provider), this will throw an error.
You can check the maximum file size limit that you can upload to your WordPress if you go to Media → Add New
1. Edit Your Theme Functions File
In this first step, it may be the case that only by adding this code, the increase in the load size limit is solved.
You can easily increase the size limits by adding the following lines of code in the functions.php file of your theme.
You can edit this file in two ways, from an FTP client, such as Filezilla, or through the file editor of your WordPress Apparence → Theme Editor
Create Or Edit An Existing Php.ini File
To be able to edit this file, you’ll need to access your WordPress site’s root folder by using an FTP or File Manager app in your hosting account’s cPanel dashboard.
If you are using a shared host, this file may not exist. If you don’t see it in your root directory, create a file called php.ini and upload it in the root folder. In that file add the following code:
Update .htaccess File
If we want to increase the maximum upload limit using this method, we must go to the root folder, as we did previously with the php.ini.
You just need to open your site’s root folder and find the .htaccess file. Then, open the file to edit it, and add the following code:
As we said before, if you are using shared hosting, these techniques may not work.
Leave a Reply