The Error
You go to Plugins โ Add New โ Upload Plugin (or Appearance โ Themes โ Add New โ Upload Theme), pick your .zip file, hit Install Now โ and WordPress slaps you with this:
The link you followed has expired. Please try again.
Nothing installed. Clicking Please try again just dumps you back at the upload form.
Why This Happens
WordPress protects its upload form with a nonce. The real problem, though, is PHP โ not WordPress. When a file exceeds PHP's size limits, PHP silently drops the entire request before WordPress ever sees it. The form data never arrives. The nonce check fails. WordPress assumes the session link expired and shows that message.
The culprit is almost always one of these three PHP limits being set too low:
upload_max_filesizeโ maximum size of a single uploaded filepost_max_sizeโ maximum size of the entire POST request (must be larger thanupload_max_filesize)memory_limitโ PHP memory cap (can trigger the same symptom on large themes)
Many shared hosts default to 2M or 8M. Popular themes like Avada or Divi ship as 15โ40 MB zips. Premium plugins with bundled assets routinely hit 50 MB. The math doesn't work out.
Step 1 โ Check Your Current PHP Limits
Don't guess โ confirm what values are actually active on your server. Create a temporary file in your WordPress root:
<?php phpinfo(); ?>
Save it as info.php, open https://yoursite.com/info.php in a browser, then search for:
upload_max_filesizepost_max_sizememory_limit
Delete info.php as soon as you're done. It exposes your full server configuration to anyone with the URL.
Step 2 โ Increase the Limits
Three methods work here, depending on your hosting setup. Start with .htaccess โ it requires no server access and takes effect immediately. Fall back to the next method if it doesn't work.
Method A: Edit .htaccess (Apache, most shared hosts)
Open .htaccess in your WordPress root and add:
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value memory_limit 256M
php_value max_execution_time 300
Heads up: if your host runs PHP as FastCGI or CGI, these directives will trigger a 500 error. Remove them and jump to Method B instead.
Method B: Edit wp-config.php
Add these lines before the /* That's all, stop editing! */ comment:
@ini_set('upload_max_filesize', '128M');
@ini_set('post_max_size', '128M');
@ini_set('memory_limit', '256M');
One catch: ini_set() cannot override values already locked at the server level. If nothing changes after saving, move on to Method C.
Method C: Edit php.ini (VPS / dedicated server)
The phpinfo() output lists the active config file path under Loaded Configuration File. Open that file and update these values:
upload_max_filesize = 128M
post_max_size = 128M
memory_limit = 256M
max_execution_time = 300
max_input_time = 300
Save the file, then restart PHP to apply the changes:
# PHP-FPM
sudo systemctl restart php8.2-fpm
# Apache with mod_php
sudo systemctl restart apache2
Method D: Contact Your Host
Managed WordPress platforms โ WP Engine, Kinsta, Flywheel โ lock PHP settings by design. You can't touch them directly. Open a support ticket and ask them to raise upload_max_filesize and post_max_size to at least 128M. Most hosts handle this in under an hour.
Step 3 โ Verify the Fix
- Clear your browser cache and any active caching plugins (W3 Total Cache, WP Rocket, LiteSpeed Cache).
- Go back to Plugins โ Add New โ Upload Plugin.
- Select the same
.zipfile and click Install Now. - You should see the normal installation progress screen this time.
Want to confirm the new limits are live without creating another info.php? Head to Tools โ Site Health โ Info โ Server. WordPress lists both PHP post max size and PHP max upload size right there.
Alternative: Install via FTP or WP-CLI
Can't change PHP settings at all? Skip the upload form entirely. Two workarounds get the job done.
FTP upload
- Unzip the plugin or theme on your local machine.
- Connect via FTP/SFTP to your server.
- Upload the folder to
/wp-content/plugins/(plugins) or/wp-content/themes/(themes). - Activate it from the WordPress dashboard as usual.
WP-CLI (if available on your server)
# Install a plugin from WordPress.org
wp plugin install woocommerce --activate
# Install from a local zip
wp plugin install /path/to/plugin.zip --activate
# Install a theme
wp theme install /path/to/theme.zip --activate
Quick Checklist
post_max_sizemust be equal to or larger thanupload_max_filesizeโ setting only one is the most common mistake- After editing
php.ini, always restart PHP-FPM or Apache - Clear all caches after any PHP config change
- Check the actual zip size before uploading โ if it's 150 MB, set limits to at least
200M - Delete
info.phpimmediately after checking

