Troubleshooting · Troubleshooting
How to Fix "The Link You Followed Has Expired" in WordPress
Short answer
This message usually means a theme or plugin file was larger than your PHP upload limits, so WordPress received an empty request. Check the maximum upload size in Media, then Add New, and compare it with the file size. If the file is larger, raise upload_max_filesize and post_max_size in your hosting panel or upload the files by SFTP instead.
Key takeaways
- The message rarely means a link expired; it usually means an upload exceeded a PHP size limit.
- WordPress nonces last one day by default, and a stale admin page can send an expired token.
- PHP defaults allow only a 2M file and an 8M request, so large theme and plugin files fail fast.
- When a request exceeds post_max_size, PHP empties the whole request, including the security token.
- Media, then Add New shows your current maximum upload file size in plain view.
- SFTP upload of the unzipped theme or plugin folder skips the browser upload limits entirely.
What does “The link you followed has expired” mean?
The message means WordPress rejected an admin request because its security token was missing, expired, or never arrived.
WordPress protects admin actions with a security token called a nonce, and the Nonces handbook explains that a nonce has a limited lifetime after which it expires.
The message rarely means a web link went stale. Most of the time it appears right after an upload, when the file was larger than the server allows.
The same screen can also appear when you submit a form or save settings after a long pause, since the token on that page has aged out.
Why does an oversized upload show this message?
An upload larger than your PHP limits empties the whole request, so WordPress sees no security token at all.
PHP documents that when post data exceeds post_max_size, the $_POST and $_FILES arrays arrive empty, so the nonce field is gone before WordPress checks it, as the PHP manual states.
PHP defaults allow only a 2M file and an 8M request, so a 12M theme file fails on most fresh server setups, as listed in the PHP manual.
| Setting | What it limits | PHP default | What to set |
|---|---|---|---|
| upload_max_filesize | One uploaded file | 2M | At least the file size |
| post_max_size | The whole request | 8M | Equal to or larger than upload_max_filesize |
| memory_limit | Script memory | 128M | 256M for large uploads |
| max_execution_time | Script run time | 30 seconds | 300 seconds for slow uploads |
Large uploads also need memory, so if the upload fails with a memory message, see our guide to the allowed memory size exhausted error.
WordPress.org lists the “Maximum execution time of 30 seconds exceeded” message among common errors, so a slow upload can also time out, as shown in Common WordPress Errors.
A theme file can also fail when it holds large demo images or video, since those push the request past post_max_size even when the theme code itself is small.
How do you check your current upload limits?
Open Media, then Add New, and read the maximum upload file size shown on that screen.
Then open Tools, then Site Health, then Info, then Server to see the exact values for upload max filesize and PHP post max size.
Compare both numbers with your file size. If the file is larger than either number, you found the cause.
A theme or plugin ZIP from a marketplace often holds a larger documentation folder inside, so check the size of the installable file, not the whole download.
If uploads fail with a different message, see our guide to the HTTP error when uploading images.
The Media screen number is the limit WordPress sees, but the host may enforce a lower account limit, so ask support if the numbers disagree.
How do you raise the upload limits in your hosting panel?
Most hosts let you change PHP limits in the hosting panel without editing files.
- Open your hosting panel and find the PHP settings or MultiPHP INI Editor.
- Set upload_max_filesize to 64M or higher, matching your largest file.
- Set post_max_size to the same value or higher.
- Save the settings and wait a few minutes for them to apply.
The PHP manual states that post_max_size must be larger than upload_max_filesize, so keep the two values in that order.
If your host locks these settings, ask support to raise them and give them the exact file size.
Write down the old values before you change them, so you can restore them if a higher limit causes trouble.
If your host runs an old PHP version, our guide to updating the PHP version explains the change.
How do you raise the limits with a .user.ini or php.ini file?
If your host supports it, a .user.ini file in the site root sets the same limits.
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
Place the file in the site root folder, next to wp-config.php, and wait a few minutes for the change to apply.
If the values do not change, your host may ignore .user.ini files, so use the hosting panel or ask support instead.
How do you install the theme or plugin by SFTP instead?
SFTP upload skips the browser limits entirely, so it works when the limits cannot be raised.
- Unzip the theme or plugin file on your computer.
- Connect by SFTP and open wp-content/themes or wp-content/plugins.
- Upload the unzipped folder, then activate it in the dashboard.
Upload the installable folder only, not the whole marketplace package with docs and demos, or the dashboard may reject it.
If the dashboard still shows the theme as broken, the upload may be incomplete, so delete the folder and upload it again.
After SFTP upload, open Appearance, then Themes, or Plugins, then Installed Plugins, and activate the item from the list.
What if the error appears without an upload?
If no upload was involved, the cause is a stale page, a changed login, or a plugin conflict.
A nonce lasts one day by default, and its real lifetime runs between 12 and 24 hours, because WordPress checks the current 12-hour tick and the last one, as the Nonces handbook explains.
Logging out and back in also makes old nonces invalid, since they are tied to your login session.
- Reload the admin page to get a fresh token, then try the action again.
- Log out and log back in if the page sat open for hours.
- Clear the browser cache and disable the caching plugin briefly to rule out a stale page.
- Deactivate plugins one at a time if the error follows a specific action.
If the server answers with 413 Content Too Large, the web server refused the request before PHP saw it, as MDN Web Docs explains.
If the server itself fails during uploads, the 500 Internal Server Error guide covers the next steps.
If login problems keep appearing, see our guide to the login page refreshing and redirecting.
Security plugins and server firewalls can also strip the token from a request, so check their logs if the error follows one action only.
How do you confirm the fix worked?
The fix worked when the upload completes and the theme or plugin activates without the expired-link screen.
- Media, then Add New shows a maximum upload size larger than your file.
- The theme or plugin installs and activates in one try.
- A second upload of a similar size also works.
- No expired-link message appears on later admin actions.
If the error returns on the next upload, recheck Site Health, since some hosts reset PHP limits after a server change.
Keep the new limits in place after the install, since the next theme update may be just as large.
What mistakes should you avoid?
Avoid four mistakes that waste time or hide the real cause.
- Do not raise only upload_max_filesize and leave post_max_size smaller, since the whole request still fails.
- Do not edit php.ini on a host that ignores it; check Site Health after every change.
- Do not upload the whole marketplace package, since WordPress expects the installable ZIP only.
- Do not skip the backup before editing server files, since a bad line can break the site.
- Do not change several settings at once, or you will not know which change fixed the error.
Fix one cause at a time and test the upload after each change, so you know exactly what solved it.
Frequently asked questions
Why does the error say the link expired when I only uploaded a file?
WordPress checks a security token with every admin request. When the file exceeds post_max_size, PHP empties the request, so the token never arrives. WordPress then reports the link as expired, even though nothing expired.
How large can my upload be after I raise the limits?
As large as the smaller of upload_max_filesize and post_max_size, since both must fit the file. Set both to at least the size of your largest theme or plugin file, and check Media, then Add New to confirm the new limit.
Do I need to restart anything after changing php.ini?
On most shared hosts, no restart is needed, and .user.ini changes apply within a few minutes. If Site Health still shows the old values after ten minutes, ask your host to reload PHP or apply the change for you.
Is it safe to set upload_max_filesize to 512M?
It is safe for most sites, but a very high limit lets one upload use a lot of disk and memory. Set the limit to the size of your largest file plus a little room, and keep post_max_size at the same level or higher.
What if the file uploads but the theme looks broken?
The ZIP may hold the wrong folder, such as a documentation package instead of the installable theme. Unzip it on your computer, find the folder with style.css inside, and upload that folder by SFTP.
When should I call my host?
Call your host when the limits are locked, when Site Health shows old values after your change, or when uploads fail with a 413 error. Give them the file size and the four PHP values you need changed.
Sources
- Nonces Developer.WordPress.org
- wp_nonce_tick() Developer.WordPress.org
- Description of core php.ini directives PHP Manual
- 413 Content Too Large MDN Web Docs
- Common WordPress Errors WordPress.org
- Debugging in WordPress WordPress Developer Resources
- FAQ Troubleshooting WordPress.org
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
