Encountering the upload_max_filesize error in WordPress can be frustrating, especially when you’re trying to upload larger files like high-resolution images, videos, or plugins. This error occurs due to a server-side PHP configuration that restricts the maximum file size you can upload. Whether you’re a blogger, developer, or site owner, understanding how to fix the upload_max_filesize error is essential to keep your WordPress website running smoothly. In this guide, we’ll walk you through simple and effective solutions to increase the file upload size limit in WordPress, so you can resolve this issue quickly and efficiently.

You generally encounter this type of issue with poorly coded themes, and most chances are you won’t face the upload_max_filesize error if you’ve created your WordPress theme with a reputed WordPress Theme Builder, crafted the theme yourself by following guides on how to create a WordPress theme, or downloaded a free WordPress theme from a trusted and reputable author. Ensuring your themes come from reliable sources not only helps avoid such errors but also enhances your site’s overall performance and security.

Steps to resolve upload_max_filesize issue in WordPress

Why upload_max_filesize Error Occur in WordPress?

The upload_max_filesize is a directive in the PHP configuration that determines the maximum size of files that can be uploaded to a server. It is particularly important for WordPress websites since it directly affects your ability to upload media files, themes, and plugins. If this limit is set too low, you might encounter errors when trying to upload larger files, such as high-resolution images, videos, or theme installation packages.

In WordPress, the upload_max_filesize limit is part of the broader PHP settings managed by your web hosting provider. By default, this value can vary depending on your host, but it is often set to 2MB or 8MB, which may be insufficient for modern website needs.

Ways to fix upload_max_filesize Error in WordPress

Solution 1: Update Your php.ini File

Update Your php .ini File

This is one of the widely used solutions to fix ‘upload_max_filesize’ error in WordPress. All you have to do is make some changes to your php.ini file. Generally, you will find this file under the wp-admin folder of your website. However, sometimes it may be located at some other location, depending upon your hosting provider.

So, once you have access to your php.ini file, search for this particular line of code in the file – upload_max_filesize. Once you have found the code, you are now required to increase the value of max upload size in order to fix the error. Here for example I have increased it to 256MB

upload_max_filesize = 256M

Once you have made the changes and refreshed your website you will see that the ‘upload_max_filesize’ error in your WordPress website has now resolved. Now, you can quickly upload the files upto 256MB.

Quite easy! Right? Well, you can easily do that yourself and make your WordPress website error-free.

Solution 2: Edit the .htaccess file

This is another quick fix to get rid of the ‘upload_max_filesize’ error in WordPress. Whichever hosting provider you are using, it will allow you to make edits in your .htaccess file. So, you can make use of that and remove the error. And once it is done correctly you will be able to upload files with higher sizes as well.

Generally you can find this .htaccess file in your WordPress root directory. Locate it and open it and then add the following line of code at the bottom of this file.

php_value upload_max_filesize 256M

And now save the changes to confirm your choice. After adding this line of code you shall be able to upload maximum file size.

Solution 3: Modify the wp-config.php File

This is another super simple and useful method to fix this ‘upload_max_filesize’ error in WordPress.

Step 1: Go to the public_html folder using cPanel.

Step 2: Look for the wp-config.php file. Simply right-click on the file and choose the edit option.

Step 3: Search for the comment line in the file. However, it is possible that it will be available at the end of the file. The comment line is;

“That’s all, stop editing! Happy blogging.”

Step 3: Now add the following line of code right above the comment line.

@ini_set('upload_max_size' , '256M' );

Step 4: Quickly save the changes in the file and exit. Refresh the website and try to upload the file again.
That’s it!

Solution 4: Modify Other PHP Configuration Settings

At times making changes in some other php files can save you a lot of time and effort. They are;

  • post_max_size (the maximum size for each POST data);
  • memory_limit (this is the maximum amount of memory a script can hold);
  • max_input_time (this is the maximum time in seconds that a script is allowed to parse input data such as GET and POST);
  • max_execution_time (this is the maximum time in seconds that is permitted to a script to take to run before it is terminated by the parser );

Solution 5: Contact Your Web Host Provider for Support

If you have tried everything but nothing worked at all. Then contacting your web host provider is the only solution you are left with. Because it is very common that web host providers put some restrictions or limitations on the settings customers can modify themselves. However, it entirely depends on your web host provider company what type of imitation they have employed on your WordPress website.

In some cases, where users have tried everything, they need to contact their web server providers for better as well as effortless results.

So, these were some of the methods to fix ‘upload_max_filesize directives in php.ini’ error in WordPress. You can try whichever method you find easy or best for your website. However, all of them are tried and tested methods. So, you can try any one of them to fix this WordPress error. Of course, if nothing is working then you surely have host server provider customer support with you. Try that.

How to Check the Current upload_max_filesize Value

Before fixing the upload_max_filesize error, it’s important to know your current file upload limit. There are several ways to check this value in WordPress:

1. Through the WordPress Dashboard

The easiest way to check the current upload limit is directly from the WordPress dashboard:
+ Go to Media > Add New.
+ At the bottom of the upload box, you’ll see a message like: Maximum upload file size: 2 MB.

2. Using the Site Health Tool

WordPress has a built-in Site Health feature that provides information about your server’s configuration:
+ Navigate to Tools > Site Health in your WordPress admin.
+ Switch to the Info tab and expand the Server section.
+ Look for the Upload max size field, which displays the current limit.

3. Checking the phpinfo() File

+ If you have access to your hosting control panel or FTP:
+ Create a PHP file (e.g., phpinfo.php) with the following content:phpCopy code
+ Upload the file to your server and access it via a web browser (e.g., yourwebsite.com/phpinfo.php).

Alternatively you can use the phpinfo wp wordpress plugin to do it quickly. Now search for upload_max_filesize to see the configured value.

4. Using a Plugin

Alternatively, you can install a plugin like big file uploads to view and increase your server’s upload size limit and other PHP settings directly within WordPress.

FAQs:

What happens if I increase the upload_max_filesize value too much?
While increasing the upload limit can be helpful, setting it too high could negatively impact your server’s performance, especially if you’re hosting large files or media. It’s essential to balance the upload limit with the server’s capacity and your website’s needs to avoid excessive resource consumption.

Will increasing upload_max_filesize affect the security of my website?
Increasing the upload_max_filesize limit itself does not affect security directly. However, it’s important to ensure that you are only allowing trusted users to upload files. Larger file upload limits can potentially lead to the upload of malicious files if proper security measures (such as file type restrictions and virus scanning) are not in place.

How do I check if the changes I made to upload_max_filesize took effect?
Once you’ve updated the upload limit, you can verify that the changes were successful by going to your WordPress dashboard, navigating to Media > Add New, and checking the Maximum upload file size message at the bottom of the file upload box. If the updated limit is shown, the changes have taken effect.

Can I increase the upload_max_filesize value on a shared hosting server?
Yes, you can often increase the upload_max_filesize limit on shared hosting servers, but it depends on the hosting provider’s configuration. Some hosts allow you to change this setting via the cPanel or a custom configuration file, while others may require you to contact their support team for assistance. Always check with your hosting provider if you’re unsure.

Uploaded File Exceeds upload_max_filesize Error in WordPress – In Conclusion

Now you know how to fix the ‘Uploaded file exceeds upload_max_filesize directive in php.ini’ error in WordPress. I tried to cover very easy methods that can help you get through this error without any difficulties. No matter which method you choose, simply by following the given instructions you can solve this error and get started with your WordPress website. However, if you still have some problems dealing with your files. You can anytime switch to FTP upload. FTP does not have any limits and it will enable you to upload files seamlessly. I hope I was able to help you with your WordPress error problem. Please feel free to share your experience with me in the comments below.