How to fix file size limit on a WordPress website

If you’re encountering a file size limit when uploading files to your WordPress site, you can increase the maximum file upload size by following these steps:

1. Edit the .htaccess File

  • Access your WordPress site via FTP or your hosting provider’s file manager.
  • Locate the .htaccess file in the root directory of your WordPress installation.
  • Add the following lines to the end of the file:
plaintext

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 file and check if the upload limit has increased.

2. Edit the wp-config.php File

  • Access your site’s wp-config.php file in the root directory.
  • Add the following code above the line that says /* That's all, stop editing! Happy publishing. */:
php

@ini_set('upload_max_filesize', '64M');
@ini_set('post_max_size', '64M');
@ini_set('max_execution_time', '300');
  • Save the file and check if the limit has increased.

3. Edit the php.ini File

  • This method is ideal if you have access to the server’s PHP settings.
  • Create or edit the php.ini file in your WordPress root directory.
  • Add or modify the following lines:
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
  • Save the file and restart your web server if needed.

4. Contact Your Hosting Provider

  • If the above methods do not work, it might be due to restrictions set by your hosting provider.
  • Contact your hosting provider’s support team and request them to increase the upload file size limit.

5. Use a Plugin

  • If you prefer not to edit files directly, you can use a plugin like “Increase Maximum Upload File Size” to change the upload limit easily.

After applying any of these changes, check your WordPress Media Library or try uploading a file again to see if the file size limit has increased.

We use a small amount of analytics and storage to improve this site. Review settings in the cookie policy.