Increase WordPress Upload Limit
January 23, 2025 · AI Conversations
—
### 1. **Update the `php.ini` File**
If you have access to your server's `php.ini` file, update it with the following values:
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
– **Steps:**
1. Locate the `php.ini` file in your server (commonly found in `/etc/php/8.x/apache2/` or `/etc/php/8.x/cli/`).
2. Edit the file and save changes.
3. Restart your web server for changes to take effect:
sudo service apache2 restart
—
### 2. **Modify `.htaccess`**
If you don’t have access to `php.ini`, add the following to your `.htaccess` file in the WordPress root directory:
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value max_input_time 300
– **Note**: This method works only if `mod_php` is enabled on your server.
—
### 3. **Add Code to `wp-config.php`**
Add the following code snippet to your `wp-config.php` file, just before the line `/* That's all, stop editing! Happy blogging. */`:
@ini_set('upload_max_filesize', '128M');
@ini_set('post_max_size', '128M');
@ini_set('max_execution_time', '300');
—
### 4. **Use a Plugin**
If you're not comfortable editing server files, you can use a plugin like **WP Increase Upload Filesize** or **Increase Max Upload File Size**. These plugins allow you to adjust the limits from the WordPress admin panel.
—
### 5. **Check with Your Hosting Provider**
If you’re on shared hosting and none of the above methods work, your hosting provider might have strict limits. Contact them to increase the upload limit for your WordPress site.
—
Once you’ve made the changes, verify the updated upload limit:
1. Go to **Media** > **Add New** in the WordPress admin dashboard.
2. Check the **Maximum upload file size** mentioned below the upload area.
Let me know if you need further assistance!
# Die Anweisungen (Zeilen) zwischen `BEGIN WordPress` und `END WordPress` sind
# dynamisch generiert und sollten nur über WordPress-Filter geändert werden.
# Alle Änderungen an den Anweisungen zwischen diesen Markierungen werden überschrieben.
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
adjust in above
Here’s how your updated `.htaccess` file should look:
# Increase upload size limit
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value max_input_time 300
# BEGIN WordPress
# Die Anweisungen (Zeilen) zwischen `BEGIN WordPress` und `END WordPress` sind
# dynamisch generiert und sollten nur über WordPress-Filter geändert werden.
# Alle Änderungen an den Anweisungen zwischen diesen Markierungen werden überschrieben.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
### Key Notes:
1. Place the `php_value` directives **outside** of the `BEGIN` and `END WordPress` markers to avoid them being overwritten.
2. Make sure your hosting environment supports `.htaccess` directives and `mod_php`. If you're using PHP-FPM or certain hosting configurations, these changes might not take