The link you followed has expired: how to fix it in WordPress
By Michael Broadbridge. Last checked 16 November 2026 on WordPress 7.1.
Short answer
WordPress shows "The link you followed has expired." when a form’s security check fails. The usual cause is uploading a theme, plugin or file bigger than the PHP upload limits, so the form arrives empty. Check the limit on the Add Media File screen, then raise it in your host’s PHP settings or upload the plugin or theme by SFTP.
Symptoms
You may see one of these messages:
The link you followed has expired.
The uploaded file exceeds the upload_max_filesize directive in php.ini.
- After clicking Install Now on the Upload Plugin or Upload Theme form, WordPress shows "The link you followed has expired." with a "Please try again." link.
- The browser tab title says "An error occurred."
- It happens with one large zip file, while smaller uploads work.
- It also happens when you save a form or click an admin link on a page that was left open for many hours.
Causes, most likely first
The upload is bigger than post_max_size
Every WordPress admin form carries a hidden security token called a nonce. When the whole upload is bigger than PHP’s post_max_size setting, PHP throws the form data away, the token goes with it, and WordPress stops with this message.
The file is bigger than upload_max_filesize
If only this limit is too low, WordPress usually shows "The uploaded file exceeds the upload_max_filesize directive in php.ini." instead. The fix is the same.
The page was open too long
By default a nonce lasts between 12 and 24 hours, and it is tied to your login. A form left open overnight, or opened before you logged out and back in, fails the same check.
A plugin’s own form or link
Plugins use the same check on their settings screens. If one of them sends an out of date or missing token, WordPress shows the same message.
How to fix it
Check the upload limit
- Open the upload screen. The line under the upload box reads "Maximum upload file size:" followed by the limit.Menu:
Media > Add Media File - Compare it with the size of the zip or file you tried to upload. If the file is bigger, the limit is the cause.
- For more detail, open the Info tab and the Media Handling section. It lists "Max size of post data allowed" and "Max size of an uploaded file" separately.Menu:
Tools > Site Health
The limit WordPress shows is the smaller of PHP’s upload_max_filesize and post_max_size settings. Both need to be bigger than the file.
Raise the PHP upload limits
These are PHP settings, not WordPress settings, and each host handles them differently. Most hosting control panels have a PHP settings or PHP options page. If yours does not, ask your host to raise them.
- Open the PHP settings page in your hosting control panel.
- Raise upload_max_filesize to more than the size of the file.
- Set post_max_size higher than upload_max_filesize. PHP’s documentation says it must be larger.
- PHP’s documentation also says memory_limit should generally be larger than post_max_size. Check it while you are there.
- Save, then reload the Add Media File screen and check the new limit is shown.
- Go back to the upload form from the menu rather than the browser’s back button, so the form has a fresh token, and upload the file again.Menu:
Plugins > Add Plugin
Some hosts let you set these limits in a .user.ini file in the site’s main folder. PHP only reads that file when it runs as CGI or FastCGI, and by default picks up changes within 5 minutes. Neither setting can be changed from wp-config.php or a plugin while a page runs.
Upload the plugin or theme by SFTP instead
Files uploaded by SFTP go straight onto the server without passing through PHP, so PHP’s upload limits do not apply.
- Unzip the plugin or theme on your computer. You should have one folder named after it.
- Connect to the site by SFTP.
- Upload a plugin folder to wp-content/plugins, or a theme folder to wp-content/themes.
- If an older copy of the same folder is already there, rename the old one first, upload the new one, and delete the old one once the site works.
- Activate the plugin from the plugins list. For a theme, go to Appearance, then Themes, and click Activate.Menu:
Plugins > Installed Plugins
If no upload was involved
- Copy anything you typed into the form somewhere safe, as it may be lost.
- Reload the page, or click "Please try again." to go back to it. The reloaded page has a new token.
- Submit the form again.
- If you were logged out in between, log in again first, then reload the page.
If that didn’t work
The limit has not changed
The setting was saved in a place PHP does not read, or PHP has not picked it up yet. Check the Media Handling section of Site Health again after a few minutes, and ask your host if it still shows the old value.
It happens on one plugin’s settings screen
If no upload is involved and reloading does not help, the check is failing inside that plugin. Update it, and report it to its developer if it continues.
The upload works but the site breaks
If the plugin or theme installs but the site then shows an error, the problem is the plugin or theme itself. The critical error guide covers how to switch it off.
When to get help
Stop if your host will not raise the limits and you are not comfortable using SFTP, if the limits are raised but uploads still fail, or if the message appears on everyday admin screens with no upload involved.
What a developer would check
- The PHP upload_max_filesize, post_max_size and memory_limit values PHP actually loads, compared with the file size.
- Where the host expects PHP settings to be changed, and whether a .user.ini or php.ini file is being read.
- The server error log at the time of the failed upload.
- Which plugin or form sends the request that fails the security check, if no upload is involved.
Describe the problem in your own words and WebFixed gives you an instant fixed quote. Nothing is charged until you accept it.
Related questions
- Does this message mean my site has been hacked?
- No. It means WordPress refused a request because its security token was missing or out of date. That is WordPress protecting the site, and on uploads it nearly always means the file was too big.
- What should I set the limits to?
- Higher than the largest file you need to upload, with post_max_size higher than upload_max_filesize. Your host may cap how high you can go, in which case uploading large plugins and themes by SFTP is the simpler route.
- Can I raise the limits in wp-config.php?
- No. PHP’s documentation lists upload_max_filesize and post_max_size as settings that can be set in php.ini, .htaccess, httpd.conf or .user.ini, not by code while a page runs. WP_MEMORY_LIMIT in wp-config.php only affects memory.
Written by Michael Broadbridge, Founder of Webgro. First published 22 November 2026. Last checked 16 November 2026 on WordPress 7.1.