Increasing the WordPress Upload Limit

Increasing the WordPress Upload Limit


WordPress comes with its own media installer. It makes uploading files to your blog - no need to bother with FTP clients or File Managers. You can easily upload all the media files you want on your blog with just a few clicks.


However, it should be noted that the media uploader uses PHP to upload files to the server and unfortunately there is an upload limit for the maximum file size. You can quickly check your WordPress upload limit in the WordPress Admin Panel> Media> Add New.


wordpress-upload-file-size-1.png

This limit may differ depending on hosting providers or your WordPress configuration. In most cases, the maximum file upload limit is too high for the regular WordPress user. But what if you want to upload a high quality video file or a large PDF document that exceeds this limit? When you try to upload larger files, you will get an error that the file exceeds the maximum file size defined for this site.


wordpress-upload-file-size-2.png

There are many different ways to increase upload size in WordPress, and we'll talk about them in this article.


How to Increase the WordPress Maximum Upload File Size


What will you need?


Method 1 - Increasing the maximum WordPress upload limit with .htaccess


Method 2 - editing the php.ini file


Method 3 - editing the wp-config.php file


Before you start this article, you need the following:


- Access to hosting control panel


Access to the WordPress admin panel


Method 1 - Increasing the maximum WordPress upload limit with .htaccess


Most hosting providers allow to change various PHP settings via .htaccess file. In this case, you can increase the PHP maximum file size upload limit by applying the php_value upload_max_filesize rule in the .htaccess file.


wordpress-upload-file-size-3.png

We will use File Manager to edit the .htaccess file, but the same can be done using the FTP client. You should be able to find the .htaccess file in the same directory as your WordPress files. For example, if you can access your blog with yourdomain.com address, WordPress and .htaccess must be in the public_html folder.


Once you find the .htaccess file, select it and click the Edit button.


wordpress-upload-file-size-4.png

You must add the following codes at the bottom of the file:


php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value max_input_time 300

When finished, save the changes by clicking the Save icon in the upper left corner.


wordpress-upload-file-size-5.png

Method 2 - editing the php.ini file


IMPORTANT: This method is best if you are hosting WordPress on VPS. Many shared hosting providers do not allow editing of the php.ini file. If you are using shared hosting, it is recommended that you contact your hosting support team to make sure you can make changes to the php.ini file.


If the .htaccess method doesn't work for you, you can try to increase the WordPress upload limit by editing the php.ini file. Access your files using File Manager, FTP client or even (if supported) SSH and find the php.ini file in your root directory. If you can't see such a file, create it and enter the following rules:


upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300

When you're done, save the changes and check again in the WordPress Admin Panel> Media> Add New section to verify your change.


Method 3 - editing the wp-config.php file


If the above methods don't work for you, don't worry. Another way to increase the upload limit in WordPress is to add the following line to the wp-config.php file:


define('WP_MEMORY_LIMIT', '128M');

Access WordPress files using File Manager or FTP client, find wp-config.php file and add the above line to the end of the file. When you're done, wp-config.php should look like this:


wordpress-upload-file-size-6.png

By completing this tutorial, you learned how to increase the maximum file upload limit in WordPress. You can then upload larger files.


tag : wordpress exceeds the maximum file size defined for this site, how to increase wordpress maximum upload file size, exceeds the maximum upload size for this site