How to Increase the Maximum File Upload Size in WordPress: A Comprehensive Guide

If you’ve ever tried to upload a large file to WordPress—whether it’s a high-resolution image, a video, a plugin, or a theme—you’ve likely encountered the frustrating error: “The uploaded file exceeds the upload_max_filesize directive in php.ini” or “This file is too big. Please upload a file smaller than X MB.”

By default, most WordPress installations and hosting providers set a relatively low maximum file upload size (often 2MB, 8MB, or 16MB) to conserve server resources. However, this limit can quickly become a bottleneck, especially if you run a media-heavy site (e.g., photography, video tutorials, or e-learning platforms) or need to upload large plugins/themes.

In this guide, we’ll walk you through every method to increase the maximum file upload size in WordPress, from simple dashboard tweaks to advanced server configurations. Whether you’re a beginner or a seasoned developer, you’ll find a solution that works for your hosting environment. We’ll also cover troubleshooting tips, best practices, and alternatives for extremely large files.

Table of Contents#

  1. Understanding the Current Maximum Upload Size
  2. Why Increase the Upload Size?
  3. Methods to Increase Maximum File Upload Size
  4. How to Verify the New Upload Limit
  5. Troubleshooting Common Issues
  6. Best Practices
  7. Alternatives to Increasing Upload Size
  8. Conclusion
  9. References

1. Understanding the Current Maximum Upload Size#

Before you try to increase the upload limit, you first need to know what your current limit is. This helps you set a realistic target and verify if your changes work later.

How to Check Your Current Upload Limit:#

  • Via WordPress Media Uploader: Go to Media > Add New in your WordPress dashboard. You’ll see a message like: “Maximum upload file size: 8 MB” (or your current limit) below the file selection area.
    WordPress Media Upload Limit (Note: Replace with a real screenshot link if publishing.)

  • Using a Plugin: Plugins like Site Health (built into WordPress 5.2+) or WP Info can display PHP settings, including upload_max_filesize.

  • Via phpinfo(): Create a temporary PHP file to check server settings:

    1. Open a text editor and paste: <?php phpinfo(); ?>
    2. Save the file as phpinfo.php and upload it to your site’s root directory (e.g., via FTP or cPanel File Manager).
    3. Visit yourdomain.com/phpinfo.php in a browser. Search for upload_max_filesize to see the current limit.

2. Why Increase the Upload Size?#

Common scenarios where you might need a larger upload limit:

  • High-Resolution Media: Photographers or designers uploading 4K images (often 10–50MB each).
  • Video Content: Adding training videos, product demos, or vlogs (e.g., 100MB–1GB files).
  • Large Plugins/Themes: Some premium themes/plugins come in zip files larger than 20MB.
  • Backup Files: Uploading large backup files (e.g., via plugins like UpdraftPlus).

3. Methods to Increase Maximum File Upload Size#

The method you use depends on your hosting environment (shared, VPS, dedicated), server type (Apache vs. Nginx), and access level (e.g., cPanel, FTP). We’ll start with the easiest methods and move to more technical ones.

Method 1: Use Your Hosting Dashboard (Easiest)#

Many hosting providers let you adjust PHP settings (including upload limits) directly from their dashboard. This is the simplest method for beginners.

Step-by-Step (cPanel Example):#

  1. Log in to your hosting account and open cPanel.
  2. Under the “Software” section, find MultiPHP INI Editor (or similar, e.g., “PHP Settings”).
  3. Select your domain from the dropdown.
  4. Locate the following directives and set new values (see notes below for recommended sizes):
    • upload_max_filesize: The maximum size of a single uploaded file (e.g., 64M for 64 megabytes).
    • post_max_size: The maximum size of an entire POST request (including all files and form data). This must be larger than upload_max_filesize (e.g., 70M).
    • memory_limit: The maximum memory PHP can use. This should be larger than post_max_size (e.g., 256M).
  5. Click Apply or Save to update the settings.

Hosting-Specific Guides:#

  • Bluehost: Use the “PHP Config” tool in the Bluehost dashboard.
  • SiteGround: Go to “Site Tools > Devs > PHP Manager.”
  • Kinsta: Adjust via “MyKinsta > Sites > [Your Site] > Tools > PHP Settings.”
  • WP Engine: Contact support (they manage PHP settings for security).

Method 2: Edit the .htaccess File#

The .htaccess file is an Apache server configuration file that controls how your site behaves. It’s located in your WordPress root directory (where wp-config.php lives).

Prerequisites:#

  • Access to your site’s files (via FTP, cPanel File Manager, or SSH).
  • A backup of .htaccess (critical—editing this file can break your site if done incorrectly).

Step-by-Step:#

  1. Connect to your site via FTP (e.g., using FileZilla) or open cPanel > File Manager.
  2. Navigate to the root directory (usually public_html).
  3. Find .htaccess (it may be hidden; enable “Show Hidden Files” in File Manager settings).
  4. Right-click .htaccess and select Download to back it up to your computer.
  5. Edit the file (right-click > “Edit” in File Manager, or open in a text editor via FTP).
  6. Add the following lines at the end of the file (adjust values as needed):
    php_value upload_max_filesize 64M
    php_value post_max_size 70M
    php_value memory_limit 256M
    php_value max_execution_time 300  # Optional: Increases time to process large uploads (300 seconds = 5 minutes)
  7. Save the file and upload it back to your server (overwriting the old one).

Notes:#

  • If you see a “500 Internal Server Error” after editing, restore the backup .htaccess—this means your server doesn’t allow PHP directives in .htaccess (common on some shared hosts).

Method 3: Modify the php.ini File#

The php.ini file is the main PHP configuration file. If your host allows editing it, this is the most reliable way to adjust upload limits (since it directly controls PHP settings).

Where to Find php.ini:#

  • Shared Hosting: Often in public_html (check via FTP) or editable via cPanel’s “MultiPHP INI Editor” (Method 1).
  • VPS/Dedicated Servers: Typically in /etc/php/[version]/apache2/php.ini (e.g., /etc/php/8.1/apache2/php.ini for PHP 8.1).

Step-by-Step:#

  1. Locate php.ini (use FTP/File Manager or SSH).
  2. Back up the file (e.g., php.ini.bak).
  3. Open php.ini in a text editor and search for these directives:
    upload_max_filesize = 8M   # Default limit (change to 64M)
    post_max_size = 8M         # Change to 70M (must be > upload_max_filesize)
    memory_limit = 128M        # Change to 256M (must be > post_max_size)
    max_execution_time = 30    # Optional: Increase to 300 for large uploads
  4. Save changes and restart your web server (critical for VPS/dedicated servers):
    • Apache: sudo systemctl restart apache2 (Linux)
    • Nginx: sudo systemctl restart nginx (Linux)
    • Shared hosting: No restart needed—changes take effect immediately.

Method 4: Edit wp-config.php#

The wp-config.php file defines WordPress core settings, including memory limits. While it doesn’t directly control upload_max_filesize, increasing WordPress memory can help process large uploads.

Step-by-Step:#

  1. Locate wp-config.php in your root directory (back it up first!).
  2. Open it in a text editor and add this line before /* That's all, stop editing! Happy publishing. */:
    define('WP_MEMORY_LIMIT', '256M');  # Sets WordPress memory limit to 256MB
  3. Save and upload the file.

Note:#

WP_MEMORY_LIMIT affects how much memory WordPress can use, but it won’t override PHP’s upload_max_filesize or post_max_size. Use this with Method 2 or 3 for best results.

Method 5: Add Code to functions.php#

You can try overriding the upload limit by adding code to your theme’s functions.php file. This is a last-resort method, as many hosts block PHP directives in themes.

Step-by-Step:#

  1. Go to Appearance > Theme File Editor in your WordPress dashboard (or edit via FTP: wp-content/themes/[your-theme]/functions.php).
  2. Use a child theme (to avoid losing changes when your theme updates). If you don’t have one, create it first (see WordPress Child Themes Guide).
  3. Add this code at the end of functions.php:
    @ini_set( 'upload_max_filesize' , '64M' );
    @ini_set( 'post_max_size', '70M' );
    @ini_set( 'memory_limit', '256M' );
  4. Click Update File.

Warning:#

This may not work on hosts with strict security policies (e.g., WP Engine, Kinsta). If your site breaks, remove the code and try another method.

Method 6: Configure Nginx Servers (Advanced)#

If your site uses Nginx (common on high-performance hosts like Kinsta or DigitalOcean), you’ll need to adjust the client_max_body_size directive in Nginx’s config file.

Step-by-Step (VPS/Dedicated Servers):#

  1. Access your server via SSH (e.g., ssh [email protected]).
  2. Edit the Nginx config file (location varies):
    • Global: /etc/nginx/nginx.conf
    • Site-specific: /etc/nginx/sites-available/[your-site]
  3. Add client_max_body_size 64M; inside the http, server, or location block:
    http {
        ...
        client_max_body_size 64M;  # Allows 64MB uploads
    }
  4. Test the config: sudo nginx -t (fix errors if any).
  5. Restart Nginx: sudo systemctl restart nginx.

Note:#

Shared hosting users on Nginx (e.g., Kinsta) can’t edit Nginx configs—contact support instead.

Method 7: Contact Your Hosting Provider#

If all else fails, contact your hosting support. Many shared hosts restrict PHP settings to prevent abuse, but they may increase the limit for you (e.g., from 8MB to 100MB).

Sample Support Message:#

“Hi, I need to upload large media files to my WordPress site. Could you please increase the PHP upload_max_filesize to 100MB, post_max_size to 120MB, and memory_limit to 256MB for [yourdomain.com]? Thank you!”

4. How to Verify the New Upload Limit#

After making changes, confirm the upload limit increased:

  • Via WordPress Media Uploader: Go to Media > Add New—the message should now show your new limit (e.g., “64 MB”).
  • Via phpinfo(): Refresh yourdomain.com/phpinfo.php and search for upload_max_filesize to confirm the new value.

5. Troubleshooting Common Issues#

Changes Not Taking Effect?#

  • Cache: Clear your browser cache and WordPress cache (e.g., via WP Rocket or LiteSpeed Cache).
  • Incorrect File Path: Ensure you edited the .htaccess or php.ini in your root directory (not a subfolder like /wp-admin).
  • Host Restrictions: Shared hosts often cap limits (e.g., 100MB). Check their docs or contact support.
  • Syntax Errors: A missing ; or typo in .htaccess/php.ini can break settings. Restore your backup and re-edit carefully.

“500 Internal Server Error”?#

  • Restore your .htaccess backup—your server likely blocks PHP directives in .htaccess. Try Method 3 (php.ini) or contact support.

Upload Stalls or Fails?#

  • Increase max_execution_time (e.g., 300 seconds) to give PHP more time to process the upload.
  • Use a wired internet connection (unstable Wi-Fi can interrupt large transfers).

6. Best Practices#

  • Set Realistic Limits: Don’t set upload_max_filesize to 1GB unless you need it—larger limits increase server load and security risks (e.g., malicious file uploads).
  • Backup Files: Always back up .htaccess, php.ini, and wp-config.php before editing.
  • Use Child Themes: For functions.php edits, use a child theme to avoid losing changes when your parent theme updates.
  • Secure Large Uploads: Restrict file types (via plugins like Wordfence) to prevent uploading malicious .exe or .php files.

7. Alternatives to Increasing Upload Size#

If you can’t increase the upload limit (e.g., due to host restrictions), try these workarounds:

  • Compress Files: Use tools like ShortPixel (images) or HandBrake (videos) to reduce file size.
  • Upload via FTP: Upload large files directly to /wp-content/uploads/ via FTP, then use a plugin like Add From Server to import them into WordPress.
  • Cloud Storage: Use services like Google Drive, Dropbox, or Amazon S3 to host large files, then embed them in WordPress.
  • Split Large Files: Split plugin/theme zip files into smaller parts using 7-Zip, upload them, then recombine via FTP.

8. Conclusion#

Increasing the maximum file upload size in WordPress is critical for handling large media, plugins, or backups. The easiest methods are using your hosting dashboard or editing .htaccess/php.ini, while more technical users can adjust Nginx configs or functions.php. Always back up files, test changes, and prioritize security by setting reasonable limits.

If you hit a wall, contact your host—they’re often happy to help. With the right approach, you’ll be uploading large files to WordPress in no time!

9. References#