The link you followed has expired when uploading a theme or plugin
· The AYT team · 5 min read

"The link you followed has expired" usually appears when you upload a theme, plugin or media file to WordPress that is larger than the server's PHP allows. The fix is to raise the post_max_size and upload_max_filesize limits (sometimes the maximum execution time too) or to upload the file another way, through the File Manager or FTP.
Why "The link you followed has expired" appears
The message is misleading. When the upload form sends more data than post_max_size allows, PHP throws away the whole request body: the file and the form fields. Among the lost fields is the security code (nonce) that WordPress checks on every form. WordPress can't find the code and shows its generic message for a missing or expired code.
More rarely, the message means exactly what it says: you left the upload page open for a very long time (a WordPress security code is valid for 24 hours at most). Reload the page and try again.
Check the current limits
wp-admin shows them in two places:
- Media → Add Media File: below the upload area you see the maximum size of a single file;
- Tools → Site Health → Info → Server: here you see
Upload max filesize,PHP post max size,PHP time limitandMax input time.
Compare them with the size of the .zip file you want to upload. If the theme archive is 40 MB and the limit is 32 MB, you have found the cause.
The fix: raise the PHP limits
The values that matter:
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
max_input_time = 300
post_max_size must be at least as large as upload_max_filesize, because the file travels in the same request as the rest of the form. Time matters on a slow connection: a large file that uploads slowly can exceed the time limit even when the size is fine. The difference between the two size limits is covered in detail in the guide to upload_max_filesize and post_max_size.
Where to change them, in the order that works most reliably:
- In your hosting panel, in the domain's PHP settings (php.ini) editor. This is the safest route, because the panel writes the values where the server reads them.
- In a
.user.inifile in the site's main folder, with the lines above. This works on servers running PHP-FPM. PHP rereads the file periodically (every 5 minutes by default), so the change doesn't show up immediately. - In
.htaccess, withphp_value upload_max_filesize 128M, only on Apache with PHP running as a module. On servers with PHP-FPM this line causes a 500 error, and nginx doesn't read it at all.
Don't try to set them from functions.php with ini_set(). upload_max_filesize and post_max_size can't be changed from code once the script has started, so the line has no effect.
After the change, check in Site Health that the new values show up, then reload the upload page (to get a fresh security code) and try again.

The alternative: upload the theme or plugin without the wp-admin form
If you can't or don't want to change the limits, go around the form:
- Unzip the
.zipon your computer. You should get a single folder named after the theme or plugin. - Upload it over FTP or through the File Manager to
wp-content/themes/(themes) orwp-content/plugins/(plugins). Many File Managers let you upload the archive and extract it on the server, which is faster than thousands of small files. - In wp-admin, under Appearance → Themes or Plugins, activate the theme or plugin.
Watch out for "full package" archives bought from theme marketplaces: they often contain documentation and other archives, and the actual theme is a .zip inside. That is the one you upload.
When the limits are high and the message still appears
- You changed the values somewhere other than where the server reads them (for example a
php.iniin a subfolder). Site Health shows you the real values. - A security plugin or a server firewall is blocking the upload. Try again with the security plugin temporarily deactivated.
- You get a different error,
413 Request Entity Too Large: the limit is in the web server (for exampleclient_max_body_sizein nginx), not in PHP. On shared hosting your host changes it.
Frequently asked questions
What values should I use?
A little above the size of the largest file you upload. Huge values don't help and let anyone with access to your forms send very large requests.
Is it related to memory_limit?
Rarely. memory_limit matters when PHP processes the file after the upload (for example when resizing a large image). If you get "Allowed memory size exhausted", see how to increase the WordPress memory limit.
On AYT hosting
In the AYT panel, the PHP settings (php.ini) page shows upload_max_filesize, post_max_size, max_execution_time and memory_limit for each domain with their current values, and you change them there. If you'd rather upload the theme directly, use the panel's File Manager or an FTPS account. The web server is nginx, so php_value lines in .htaccess don't apply. The plans are on the WordPress hosting page.
