How to Increase Maximum Upload File Size in WordPress

How to Increase Maximum Upload File Size in WordPress

Did you encounter ‘filename exceeds the maximum upload size for this site’ error? To solve this error, all you’ve to do is increase maximum upload file size in WordPress.

When you are working with WordPress, you’ll have to upload the files every now and then. However, WordPress has a very low limit on upload size so you might face some errors. If you need to upload large image files or videos on your site then you’re likely to be unable to upload media files larger than 25MB.  Luckily, it’s very easy to solve this problem.

There are many ways to increase WordPress maximum upload limit of file size. In this tutorial, you’ll learn how to increase the WordPress maximum upload file size.

Why Should you Increase the Maximum File Upload Size in WordPress?

Usually, in a new WordPress website, the pre-set maximum file upload size is only 2 MB initially. So, whenever you try to upload a file size greater than 2 MB, you’ll see your ‘filename exceeds the maximum upload size for this site’ error. The only way to solve this error is to increase the file upload size.

Check the WordPress Maximum Upload Size Limit

The maximum upload size limit might be different for every single WordPress website, depending on the settings of your WordPress hosting provider. Hence, you’ll need to check the maximum upload size limit first. In order to do so, log in to the WordPress dashboard. Then navigate to Media>> Add New. You can see the maximum upload file size limit there as shown below.

Check-upload-limit

In case, the curent maximum upload file size meets your demand then you don’t need to change anything.   

Increase Maximum Upload File Size in WordPress

As I’ve said earlier, there are many ways to increase the maximum upload file size. Today we’ll discuss five methods in detail. For that, you’ll need to have access to the WordPress dashboard or cPanel provided by your hosting provider.

Note: Before we start, please backup your site  to be on a safe side as the methods mentioned here require you to modify some code on your site.

Let’s get started.

Modify PHP.ini file

PHP.ini is a very important file that contains settings for maximum upload file size, maximum execution time, upload directory, and others.  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.

Then, locate the php.ini file in your root folder. In case you can’t find the file, just create a file called php.ini and upload it in the root folder. Next, open the php.ini file in edit mode and add the given code at the end of it.

upload_max_filesize = 256M

post_max_size = 256M

max_execution_time = 400

Modify .htaccess

Modifying .htaccess is another way to increase WordPress maximum upload file size. To do so, locate the .htaccess file. Then, open it in edit mode. Copy-paste the following code and save it. Then check whether WordPress upload limit has been increased or not form above mentioned method.

php_value upload_max_filesize 8M

php_value post_max_size 8M

php_value max_execution_time 240

php_value max_input_time 240

Modify Your WordPress Files

You can try this technique If none of the above methods worked for you. This is the alternative method to increase maximum upload file size in WordPress. Go to WordPress dashboard>> Appearance>> Theme Editor.

Then locate function.php. You can simply copy and paste the following three lines of code in the files. However, it is not safe to make changes in the WordPress core files. So, keep it as a last option.

@ini_set( ‘upload_max_size’ , '25MB' );

@ini_set( ‘post_max_size’, '27MB');

@ini_set( ‘memory_limit’, '30MB' );

Note: Editing function.php means, you’re making changes in theme core file. So, if you change or update the theme, the max upload size will return to its original values.

Upload File Size with Plugin

If you are a beginner, using a plugin is the best method to maximize upload file size. All you have to do is install a plugin and activate it. I recommend you to try Increase Maximum Upload File Size. It will automatically maximize the file upload size limit.

However, installing multiple plugins has negative impact on performance or speed of your WordPress site. Hence, uninstall

Choose-Maximum-Upload-size

Ask your Hosting

If you are on shared WordPress hosting then the above-mentioned method might not work for you. In that case, you can simply request your hosting provider to increase the maximum upload size in WordPress for you. Hosting operators have a default option to alter the upload size.

That’s it! Now go to the media section in order to check whether the upload limit has been maximized or not.

Summary

That’s how you can increase the maximum upload file size in WordPress. Hopefully, our guide helped you to modify the WordPress upload file size limit.

If you liked this article then follow us on Facebook and Twitter.

Which of the above-mentioned methods worked best for you? Let us know in the comment box below.

Other Related Articles:

6 thoughts on “How to Increase Maximum Upload File Size in WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *