banner_bg

How to Increase Maximum Upload Limit in WordPress

By admin > No Comments
21
Oct
increase maximum upload limit

Uploading media is a vital part of managing a WordPress website, whether you’re adding high-resolution images, videos, PDFs, or importing theme files. However, you might face an issue where WordPress restricts uploads beyond a certain size. This limitation is typically governed by a PHP setting on your server known as post_max_size.

The post_max_size PHP directive determines the maximum amount of data that can be sent to the server in a single form submission. When this value is set too low, uploads may fail or forms might break without clear error messages. To ensure smooth performance especially when working with large media files or Professional WordPress Themes it’s essential to understand how this setting works and how to increase it properly.

In this guide, we’ll walk you through different methods to increase the maximum upload file size in WordPress by adjusting the post_max_size value, whether you’re on shared hosting, using a VPS, or managing your own server. Let’s get started so you can upload files seamlessly and without limitations!

What is Post Max Size in WordPress?

The post_max_size directive in WordPress determines the maximum amount of data your server can handle in a single POST request. This setting plays a crucial role when uploading files through WordPress since all uploads and form data are transmitted via POST requests.

Whenever you upload a file through the Media Library or a plugin, WordPress relies on this directive to process the request. If the total size of your upload exceeds the post_max_size limit, the upload or submission will fail sometimes without displaying an explicit error. For smooth uploads, especially when using must have wp plugins that involve media or file handling, ensuring this limit is properly configured is essential.

The Importance of Raising the File Upload Size in WordPress 

Increasing the maximum file upload size in WordPress is important for websites that handle larger files or rely on more complex content. By default, many hosting providers set a low upload limit (like 2MB or 8MB), which can restrict what you can do on your site. Let’s look at the reasons to consider raising it:

  • Uploading high-resolution media: Photographers, designers, and media-heavy websites frequently need to upload large, high-resolution images, videos, and audio files. Default limits are often insufficient for such content.
  • Installing Large Themes and Plugins: Many modern WordPress themes and plugins are feature-rich and often come with large file sizes. If your upload limit is too low, you may struggle to install them directly through the WordPress dashboard, requiring more complicated manual methods like FTP uploads. This can be inconvenient, especially when working with the best free wp themes which often include advanced design elements and functionality that demand higher upload limits for smooth installation and setup.
  • Selling Digital Products: If your WordPress site is used for e-commerce and you sell digital products like eBooks, online courses, software, or high-quality digital assets, these files can often exceed standard upload limits. Increasing the size allows you to host and manage these products directly on your site. Frequent Content Updates: Websites that regularly update with new resources, downloadable files or rich media content will frequently bump into low upload limits, hindering effeciency and content creation workflows.
  • Streamlining Workflows: Having a sufficient upload limit simplifies the content management process. Users dont have to resize images manuallly outside of WordPress or use external file- sharing services, which can be time consuming or cumbersome.
  • Ensuring Proper Functionality: Some WordPress functionalities or integartions might require uploading larger files for specific features to to work correctly.

Checking Your Current Upload Size Limit in WordPress

Method 1: Contact the WordPress Hosting provider 

The simplest and most reliable way to increase your WordPress upload size limit is to contact your hosting provider’s support team.

When reaching out, explain that you need to raise the “maximum file upload size for your WordPress website,” especially if you’re facing difficulties uploading large media files, themes, or plugins. You can request a specific limit, such as 64MB, 128MB, or 256MB, and your host will typically adjust the necessary PHP settings (upload_max_filesize, post_max_size, and memory_limit) accordingly.

Understanding and managing these configurations is part of the essential features of wordpress ensuring smoother uploads and better site performance overall.

Create or Edit an Existing php.ini file

The php.ini file controls your server’s PHP configuration, including file upload limits. If your hosting provider allows it, this is one of the most effective ways to increase the upload size. 

Access your server by launching an FTP client like Cyberduck or FileZilla. You'll need your FTP credentials. 

Locate the main directory of your WordPress installation. This is usually where you see folders like wp-admin, wp-content, and wp-includes.

Look for a file named php.ini.

If you find it, download a copy to your local computer as a backup, then open it for editing.

If you don't find it, create a new file named php.ini in this directory.

Look in the root directory of your WordPress installation (public_html/ or /yourdomain/).

If you don’t see a php.ini file, go ahead and create one with that name. Next, add the code snippet below into the file:

upload_max_filesize = 64M

post_max_size = 64M

memory_limit = 128M

max_execution_time = 300

max_input_time = 300

After this, Save the File and Restart the Server. 

Step 3: Add Code to your WordPress Theme functions.php file 

Add Code to your WordPress Theme functions.php file

It’s an easy method that often works, especially in hosting environments where php.ini or .htaccess access is restricted.

Go to Your WordPress Admin Dashboard

Navigate to Appearance > Theme File Editor.

Access the folder of the active theme and update the functions.php file.

Add the Following Code at the Bottom: 

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

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

@ini_set( 'memory_limit', '128M' );

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

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

Click "Update File" to save your changes. Go to WordPress Dashboard > Media > Add New and check if the new maximum upload size is reflected.

Step 4: Add Code to the .htaccess file

If you're looking to increase the maximum file upload size in WordPress by editing the .htaccess file, this method is primarily applicable for Apache servers and aims to override PHP settings. 

Located in the root folder of your WordPress site, the .htaccess file is used to manage server-level configurations.

  • Access Your WordPress Site Files. Use cPanel > File Manager or an FTP client.
  • Go to your website’s main directory and look for the .htaccess file.
  • Make a Backup First. Always download a copy of .htaccess before editing it in case something goes wrong.

Add This Code to the Bottom of the File: 

php_value upload_max_filesize 64M

php_value post_max_size 64M

php_value memory_limit 128M

php_value max_execution_time 300

php_value max_input_time 300

If you're using cPanel, just click “Save Changes.” If using FTP, re-upload the edited file.

Step 5: Use a WordPress Plugin to increase file upload size 

Use a WordPress Plugin to increase file upload size

Here’s how you can increase the maximum file upload size in WordPress using a plugin that is perfect for beginners or those without server access:

This is often the easiest and most user-friendly way to attempt to increase the maximum file upload size in WordPress, especially for those who are less comfortable with editing server files. 

Plugins like "MaxUploader" or "Big File Uploads" (among others) work by trying to adjust the PHP settings (upload_max_filesize, post_max_size, memory_limit, max_execution_time) from within your WordPress environment.

  1. Log in to your WordPress Dashboard.
  2. Go to Plugins > Add New.
  3. Search for the plugin MaxUploader – Increase Media Upload File Size 
  4. Press the ‘Install Now’ button for the plugin you’d like to add.
  5. Once installed, click "Activate."
  6. After activation, most plugins will add a new menu item under "Media" (e.g., "MaxUploader" or "Increase Upload Limit") or sometimes under "Tools" or "Settings."
  7. Navigate to the plugin's settings page.
  8. You'll typically find a simple dropdown menu or an input field where you can select or enter your desired maximum upload file size.
  9. Choose a value that is higher than your current limit.
  10. Look for options to increase max_execution_time and post_max_size as well, as these are also critical for larger uploads.
  11. Save your changes.
  12. Once you have saved the changes, you can verify them as well. 
  13. Access the admin panel, go to the ‘Media’ menu, and click ‘Add New’ to add media files.
  14. Check the "Maximum upload file size" displayed below the "Select Files" button to see if it has increased.

For more detailed information, go to Tools > Site Health, click on the "Info" tab, and then expand the "Media Handling" and "Server" sections.

Conclusion 

Increasing the maximum upload file size in WordPress, especially by adjusting the post_max_size directive, is a common task for many website owners. This PHP directive determines the maximum amount of data that can be sent in a POST request a key factor since file uploads typically use this method. For smooth uploads, post_max_size must be equal to or greater than upload_max_filesize, and memory_limit should ideally be set higher to ensure sufficient memory for script execution.

Although WordPress includes some internal upload settings, the ultimate limit is usually determined by your hosting provider’s server-level PHP configuration. For a dependable and lasting fix, reaching out to your hosting provider is often the best solution, as they can adjust these parameters for your account. Whether you’re uploading high-quality media files or installing a WordPress bundle having the correct configuration ensures seamless performance and prevents upload-related issues.

Back to blog