How to Increase Maximum File Upload Size in WordPress?

Increasing the maximum file upload size in WordPress is a common need for many site owners. Whether you’re uploading large images, videos, themes, or plugins, running into upload limits can be frustrating. This guide will show you various methods to increase the maximum file upload size in WordPress, step by step.

These are the following methods:

Table of Content

  • Updating the php.ini File
  • Modifying the .htaccess File
  • Editing the wp-config.php File

Method 1: Updating the php.ini File

The php.ini file is the default PHP configuration file. Editing this file is one of the most effective ways to increase the upload limit.

Step 1: Access Your php.ini File

  • Log in to your web hosting account.
  • Navigate to your File Manager or connect via an FTP client.
  • Locate the php.ini file. It may be in your root directory, or you may need to create a new one if it doesn’t exist.

Step 2: Edit the php.ini File

  • Open the php.ini file for editing.
  • Add or update the following lines:
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
  • Save the changes and close the file.

Step 3: Restart Your Web Server

  • Restart your web server to apply the changes. This can usually be done from your hosting control panel.

Method 2: Modifying the .htaccess File

If you don’t have access to the php.ini file, you can use the .htaccess file to increase the upload size.

Step 1: Access Your .htaccess File

  • Log in to your web hosting account.
  • Navigate to your File Manager or connect via an FTP client.
  • Locate the .htaccess file in your root directory.

Step 2: Edit the .htaccess File

  • Open the .htaccess file for editing.
  • Add the following lines:
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
  • Save the changes and close the file.

Method 3: Editing the wp-config.php File

You can also adjust the upload limit via the wp-config.php file.

Step 1: Access Your wp-config.php File

  • Log in to your web hosting account.
  • Navigate to your File Manager or connect via an FTP client.
  • Locate the wp-config.php file in your root directory.

Step 2: Edit the wp-config.php File

  • Open the wp-config.php file for editing.
  • Add the following line near the bottom of the file, just before the line that says /* That's all, stop editing! Happy blogging. */:
@ini_set('upload_max_size' , '64M' );
@ini_set('post_max_size','64M');
@ini_set('max_execution_time','300');
  • Save the changes and close the file.