Skip to main content

How to Fix a WordPress File Upload Size Error

You can resolve a WordPress file upload size error by increasing the maximum upload limit in your server configuration. This allows you to upload larger files, such as themes, plugins, or media, that are currently being blocked by your server's limits.

You can resolve a WordPress file upload size error by increasing the maximum upload limit in your server configuration. This allows you to upload larger files, such as themes, plugins, or media, that are currently being blocked by your server's limits.

Before you begin

You will need:

  • Site Administrator access to your WordPress dashboard.

  • Access to your hosting control panel (such as cPanel or Windows Control Panel) or your site's configuration files.

Increase the upload limit via .htaccess

The .htaccess file is used by many servers to define configuration rules. Adding a specific line can override the default upload limit.

  1. Log in to your hosting control panel.

  2. Open the File Manager for your WordPress installation.

  3. Navigate to the root directory of your WordPress site (usually public_html or www).

  4. Locate the .htaccess file.

  5. Edit the file and add the following code at the bottom:

php_value upload_max_filesize 64M
php_value post_max_size 64M

  1. Save the changes.

Increase the upload limit via php.ini or .user.ini

If your server uses a dedicated PHP configuration file, you can update the limits there.

  1. Log in to your hosting control panel.

  2. Open the File Manager for your WordPress site.

  3. Locate the php.ini or .user.ini file in your root directory.

  4. Edit the file and locate the following lines:

    • upload_max_filesize

    • post_max_size

  5. Change the values to your desired limit (e.g., 64M or 128M).

  6. Save the changes.

Increase the upload limit via WordPress configuration

Some hosting environments allow you to set these values directly within the WordPress configuration file.

  1. Log in to your hosting control panel.

  2. Open the File Manager for your WordPress site.

  3. Locate the wp-config.php file in the root directory.

  4. Edit the file and add the following code before the line that says /* That's all, stop editing! Happy publishing. */:

@ini_set( 'upload_max_filesize' , '64M' );
@ini_set( 'post_max_size' , '64M' );

  1. Save the changes.

Confirm the result

  1. Log in to your WordPress dashboard.

  2. Navigate to Media > Add New.

  3. Look for the "Maximum upload size" notice. It should now reflect the value you entered (e.g., 64 MB).

  4. Attempt to upload a file that was previously too large to confirm the process is successful.

If the limit does not change

If the upload limit remains the same after editing your files, your hosting provider may have a hard limit set at the server level.

Contact Hostek Support to confirm if your specific hosting plan allows for a higher upload limit and to request a manual increase if necessary.

Did this answer your question?