Technology

How to increase the maximum upload file size in WordPress

2025-03-26 10:38:23


Why do we need to increase the maximum upload file size in WordPress?

When you install WordPress through a hosting provider, the maximum upload file size is preset, usually between 2MB and 500MB, which is sufficient for most users. However, in some cases, you may need to increase this limit, such as:

  • I want to upload large images for the photography website.
  • Use a large theme or plugin.
  • Selling digital products such as eBooks, videos, or audio files.
  • Update the content frequently and upload large files.

However, uploading large files may slow down the website. Therefore, consider using a CDN or hosting the files externally instead.




How to check the maximum upload file size in WordPress

You can check the current maximum upload file size by going to Media » Add New in the WordPress dashboard. The system will display the maximum size allowed for uploads.



How to increase the maximum upload file size

1. Contact the hosting service provider

The easiest way is to ask your hosting provider to increase the file upload limit, which can be done through Live Chat or the support system of the provider, such as Bluehost, SiteGround, or Kinsta.


2. Edit the php.ini file

The php.ini file is a file that controls various server settings.  If your hosting has cPanel, you can edit this file by:

  • Go to cPanel and select MultiPHP INI Editor.
  • Search for the variable upload_max_filesize and set a new value, such as 256M.
  • Click Apply to save the changes.

If you don't have cPanel, you can create a php.ini file in the root directory of the website and add this code:


upload_max_filesize = 256M

post_max_size = 256M

max_execution_time = 300


3. Add code to the theme's functions.php file

Another method is to add code to the theme's functions.php file using the WPCode plugin to prevent errors that could cause the website to crash.

  • Install and activate the WPCode plugin
  • Go to Code Snippets »  เพิ่ม Snippet
  • Select the PHP Snippet and add this code:


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

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

@ini_set( 'max_execution_time', '300' );


  • Enable the code and click Save Snippet.


4. Edit the .htaccess file

The .htaccess file is used to configure the operation of the Apache server.  You can add this code to increase the upload size:


php_value upload_max_filesize 256M

php_value post_max_size 256M

php_value max_execution_time 300

php_value max_input_time 300


5. Use a plugin to increase the upload file size.

If you don't want to edit the code yourself, you can use a plugin like WP Increase Upload Filesize by:

  • Install and activate the plugin
  • Go to Media » Increase Upload Limit
  • Select the maximum file size you want, then click Save Changes.

If the maximum size you need does not appear in the options, you need to contact the hosting provider to request an increase in this limit.




Increasing the maximum upload file size in WordPress can be done in several ways, whether by contacting the hosting provider, modifying server files, or using a plugin.  The easiest way is to ask your hosting provider to adjust the settings for you, but if you want to do it yourself, you can use the method that suits your hosting.


I hope this article helps you easily increase the file upload limit in WordPress.

Leave a comment :