You upload a theme or plugin ZIP under Appearance > Themes > Add New or Plugins > Add New, click Install Now, and WordPress shows a plain white page: “The link you followed has expired. Please try again.” Nothing gets installed.
The message sounds like a session problem, but in most cases it is a PHP size limit. The file is bigger than post_max_size, PHP throws the whole request body away, and WordPress no longer finds its security token. Below I show how to confirm that, raise the right limits for your server type, and handle the rarer case where the token really did expire.
Why a big upload ends with “the link you followed has expired”
Every admin form in WordPress carries a nonce, a short token that proves the request came from your own dashboard. On submit, WordPress checks it with check_admin_referer(). If the check fails, that function calls wp_nonce_ays(), which stops with “The link you followed has expired.” and an HTTP 403.
Now the PHP part. The PHP manual says it directly: “If the size of post data is greater than post_max_size, the $_POST and $_FILES superglobals are empty.” So a 90 MB theme ZIP on a server with the PHP default post_max_size = 8M arrives with no file and no nonce. WordPress sees a missing token and reports it as expired.
That is why the error shows up with large themes (premium themes bundled with demo content are the usual suspects), big plugin ZIPs and import files, and almost never with a small plugin.
Check your current upload limits
Go to Media > Add New. Under the upload box WordPress prints “Maximum upload file size”. If your ZIP is bigger than that number, you have found the cause.
For the exact values, open Tools > Site Health > Info and expand the Server section. Find the upload max filesize and PHP post max size rows. Both must be larger than your file.
From the shell you can ask PHP directly:
wp eval 'echo ini_get("upload_max_filesize") . " / " . ini_get("post_max_size") . PHP_EOL;'
You get the two values separated by a slash. WP-CLI runs PHP CLI, which often reads a different php.ini than your website, so trust Site Health if the numbers disagree.
Raise upload_max_filesize and post_max_size
Back up any file before you edit it, then use the method that matches how your server runs PHP.
You need three values. upload_max_filesize covers the file itself. post_max_size must be a bit larger, because the request also carries the other form fields. A longer max_input_time keeps slow uploads from being cut off.
Step 1. Use .user.ini on PHP-FPM hosting
Most hosts today run PHP-FPM or CGI. There, create or edit a .user.ini file in the WordPress root (the folder with wp-config.php):
upload_max_filesize = 128M
post_max_size = 136M
max_input_time = 300
max_execution_time = 300
memory_limit = 256M
PHP caches .user.ini files for user_ini.cache_ttl seconds (300 by default), so wait five minutes or restart PHP-FPM before you test again. Then reload Media > Add New and check that the maximum upload size changed.
Step 2. Use .htaccess only on Apache with mod_php
If Apache loads PHP as a module, the same values can go into .htaccess, above the # BEGIN WordPress block:
<IfModule mod_php.c>
php_value upload_max_filesize 128M
php_value post_max_size 136M
php_value max_input_time 300
php_value max_execution_time 300
</IfModule>
Without the IfModule wrapper, php_value lines on a PHP-FPM server cause a 500 Internal Server Error. If that happens, remove them and use .user.ini instead.
💡 PHP 7 builds name the Apache module mod_php7.c. If the block has no effect on such a server, use that name in the wrapper.
Step 3. Edit php.ini on a VPS or in your control panel
On your own server, edit the php.ini that the web PHP uses, not the CLI one. On Debian and Ubuntu that is usually /etc/php/<version>/fpm/php.ini. Set the same values there, then restart PHP-FPM:
sudo systemctl restart php8.3-fpm
Use your own PHP version in the service name. If the command returns nothing, the restart worked. On nginx, also make sure client_max_body_size is at least as large as post_max_size, otherwise nginx blocks the upload first and you get a different error, which I covered in 413 Request Entity Too Large when saving a page.
On hosting with a control panel you do not need to touch files at all. In cPanel the setting lives in the MultiPHP INI Editor. In OpenPanel it is under PHP > Options: select the PHP version, change upload_max_filesize, post_max_size and max_input_time, and click Save changes. OpenPanel writes this to the php.ini of that PHP version and restarts it, so the new limits apply to every domain on that version right away, with no .user.ini cache to wait out.
Why not wp-config.php? Because upload_max_filesize and post_max_size are per-directory settings. PHP reads the request body before WordPress starts, so an ini_set() call in wp-config.php or functions.php comes too late to change them.
Skip the browser upload with WP-CLI
Some shared hosts lock the PHP limits. In that case, upload the ZIP over SFTP to a folder outside the web root and install it from the command line. WP-CLI reads the file from disk, so post_max_size never comes into play:
wp theme install ~/uploads/my-theme.zip --activate
wp plugin install ~/uploads/my-plugin.zip --activate
Each command should end with a “Success:” line. If it complains that the destination folder already exists, see Destination folder already exists.
Unzipping the archive straight into wp-content/themes/ or wp-content/plugins/ over SFTP also works. Then activate it in the dashboard.
When the nonce really did expire
If you see the error when saving a small settings page, trashing a post or clicking an old link, the size limit is not the cause. The token was too old or did not belong to your current session.
WordPress nonces have a lifetime set by the nonce_life filter, 86,400 seconds (one day) by default. A tab left open since yesterday, or one opened before you logged out and back in, carries a token WordPress no longer accepts.
- Reload the admin page to get a fresh nonce, then repeat the action.
- If it happens on a front-end form (contact, membership or checkout pages), a page cache is probably serving an old copy with an old nonce. Exclude that page from caching or keep the cache lifetime well under a day.
- If it happens on every save right after you log in, look for a wrong
WP_HOMEorWP_SITEURLor a cookie problem, which I covered in admin login page refreshing and redirecting.
💡 You can raise the lifetime with the nonce_life filter, but I would not. It keeps every leaked admin link valid for longer, and fixing the cache is the cleaner answer.
As of 2026-12-06, current WordPress still prints this message from wp_nonce_ays() in wp-includes/functions.php, and the empty request on oversized uploads is standard PHP behavior, so the fixes above apply to any recent version.
TL;DR: “The link you followed has expired” during a theme or plugin upload almost always means the file is bigger than post_max_size, so PHP drops the form and the nonce with it. Raise upload_max_filesize and post_max_size in .user.ini, php.ini or your control panel (not wp-config.php), or install the ZIP with WP-CLI. If it happens on small forms, reload the page and check your page cache.

