Severity: Minor · Fix time: Under 5 min · Skill level: Beginner
The link you followed has expired is a WordPress error message that appears after attempting a large file upload, plugin installation from a zip file, or theme upload when the file’s size exceeds the server’s post_max_size PHP directive. Unlike the Upload Exceeds Maximum File Size error — which blocks the upload immediately with a clear size complaint — this error appears after the upload appears to complete. The file is silently discarded by PHP before WordPress ever sees it, and WordPress interprets the empty request as an expired action token.
The error message is genuinely misleading. It sounds like a timeout or a stale link, not a file size problem. Most site owners spend several minutes wondering what link expired before discovering the real cause is post_max_size.
Need a quick map of every WordPress error? See our 70+ WordPress Errors Guide → for a categorized reference of every common WordPress issue.
[Image: WordPress dashboard showing “The link you followed has expired. Please try again.” on a blank admin page after a failed plugin or theme upload]
How the “Link Expired” Error Works
When you upload a file through WordPress’s browser interface — via Media → Add New, Plugins → Add New → Upload Plugin, or Appearance → Themes → Add New — the file is sent as an HTTP POST request. PHP’s post_max_size directive caps the total size of any POST request, including all form fields, file data, and headers combined.
The critical behavior: when the incoming POST request exceeds post_max_size, PHP does not reject it with an error — it silently discards the POST body entirely. WordPress receives a POST request with no data and no file. WordPress interprets the missing data as a request with an invalid nonce (the action token that prevents CSRF attacks). When the nonce is absent, WordPress shows “The link you followed has expired.”
This silent discard is why the error message is so confusing. There is no mention of file size anywhere in it.
The three upload-related errors and how they differ:
- Image Upload Failed / Corrupt File — The file uploads but fails during processing (library missing, permissions, corrupt file).
- Upload Exceeds Maximum File Size —
upload_max_filesizeblocks the upload immediately with a clear message. - The Link You Followed Has Expired (this page) —
post_max_sizeis smaller than the file; PHP discards the request silently; WordPress shows a nonce error.
All three share the same fix direction — raise PHP limits — but each traces to a different value in the PHP configuration chain.
Check This First — 2-Minute Diagnostic
- Identify what you were doing — Did this happen during a plugin zip upload, theme upload, or media upload? If yes, file size is the likely cause.
- Check the file size against post_max_size — Go to Tools → Site Health → Info → Server and look at “PHP post max size.” Compare it to the file you were trying to upload.
- Try a smaller file — Upload a small plugin zip under 1MB. If it succeeds and the large file fails,
post_max_sizeis confirmed as the constraint. - Check if the error also appears outside uploads — If “link expired” appears on forms, settings saves, or non-upload actions, the cause may be an expired nonce from a caching issue rather than file size.
- Check
upload_max_filesizetoo — If you raisepost_max_sizewithout checkingupload_max_filesize, you may fix this error but reveal the Upload Exceeds Maximum File Size error ifupload_max_filesizeis also too small.
Purpose & Benefits
1. Understanding post_max_size Prevents Recurring Mystery Errors
This error recurs every time someone uploads a file larger than post_max_size — which defaults to 8MB on many shared hosts. Without understanding the cause, site managers may repeatedly try the same upload or suspect a server problem. A single five-minute fix resolves it permanently for all users.
2. This Error Affects More Than Just Media Uploads
Plugin and theme zip files, WooCommerce product import CSVs, and WordPress core updates all travel as POST requests. A low post_max_size silently breaks all of these. If you’ve had a plugin update fail with no clear reason, post_max_size may have been the cause.
3. Getting PHP Limits Right Once Has Compound Benefits
Raising post_max_size and upload_max_filesize to sensible values prevents multiple error classes simultaneously — including memory exhausted errors, image upload failures, and HTTP errors when uploading images. Fixing them together in one session is more efficient than addressing each error individually.
Examples
1. Raising post_max_size via .htaccess
The fastest fix on Apache shared hosting is adding PHP directives to .htaccess:
# Raise PHP POST and upload limits via .htaccess
# Place in your WordPress root .htaccess file
php_value post_max_size 128M
php_value upload_max_filesize 64M
php_value memory_limit 256M
php_value max_execution_time 300
php_value max_input_time 300After saving, check Tools → Site Health → Info → Server to confirm the new values appear. Then retry the upload.
2. Raising post_max_size via php.ini
On hosts that support a custom php.ini in the web root:
; PHP configuration — raise upload and POST limits
post_max_size = 128M
upload_max_filesize = 64M
memory_limit = 256M
max_execution_time = 300
max_input_time = 300The key rule: post_max_size must be larger than upload_max_filesize. Setting them equal means very large files will still exceed post_max_size once headers and form fields are added to the request size.
3. Diagnosing via phpinfo()
If you’re unsure which PHP configuration file is active, a temporary phpinfo() check reveals the current values and which file set them. Create a temporary file in your WordPress root:
<?php
// Temporary diagnostic file — REMOVE IMMEDIATELY after use
// Never leave phpinfo() files on a production server
phpinfo();
?>Visit https://yourdomain.com/phpinfo.php, search for post_max_size and upload_max_filesize, then delete the file immediately. The “Local Value” column shows what’s currently active.
Common Mistakes to Avoid
- Not recognizing this as a file size error — If this error only appears during large uploads, file size is the cause. Check
post_max_sizeimmediately rather than investigating nonces or caching. - Raising
upload_max_filesizewithout raisingpost_max_size— These two settings must be coordinated. Raising onlyupload_max_filesizeto 64M while leavingpost_max_sizeat 8M shifts the error from “exceeds max file size” to “link expired.” - Leaving the phpinfo.php diagnostic file on the server — A live
phpinfo()output exposes your PHP version, server paths, and configuration details to anyone who visits the URL. Create it, use it, delete it immediately. - Expecting this error to resolve itself — Unlike nonce expiration from session timeout, this error recurs every time you try to upload the same large file. It requires a PHP configuration change, not a session refresh.
- Confusing this with a caching-related nonce issue — If “link expired” appears on non-upload actions (form submissions, settings saves), the cause may be a stale nonce from a caching plugin. See REST API Cookie Check Failed for that scenario.
Best Practices
1. Set Both post_max_size and upload_max_filesize Together
Never raise one without reviewing the other. A practical standard for most WordPress sites:
upload_max_filesize = 64M
post_max_size = 128M
memory_limit = 256MSet these at the same time — during initial site configuration or the maintenance session where you’re addressing this error.
2. Use Your Hosting Control Panel First
Most cPanel-based shared hosting environments offer a PHP Settings panel that raises these values without requiring file editing. Look for “PHP Configuration,” “Select PHP Version,” or “MultiPHP INI Editor” in cPanel. These tools modify the correct configuration file for your hosting environment.
3. Verify the Change Took Effect Before Retrying
After making a configuration change, always confirm the new values are active in Tools → Site Health → Info → Server before reattempting the upload. If the old values still appear, your edit may not have targeted the active configuration file.
4. Keep Large Files Off the WordPress Media Library
Video files, large PDFs, and photography archives are better hosted on dedicated services — YouTube, Vimeo, AWS S3 — rather than uploaded directly to WordPress. This keeps your disk space manageable and removes upload size as a constraint.
Frequently Asked Questions
What causes “The link you followed has expired” most often?
In the context of file uploads, post_max_size being smaller than the file you’re uploading. PHP silently discards the POST body when it exceeds this limit, and WordPress interprets the missing data as an expired nonce. The error message doesn’t mention file size, which is what makes this error confusing.
How do I fix this when locked out of wp-admin?
This error appears during wp-admin upload attempts, not at the login screen — you should still be able to log in. If you can reach wp-admin but can’t access Site Health, connect via SFTP to add directives to .htaccess or create a custom php.ini in your WordPress root.
Can this error hurt my SEO?
Only indirectly. The error is confined to wp-admin and doesn’t affect your front-end pages or search visibility. However, if it consistently blocks plugin updates or content uploads, it slows down site maintenance and content production over time.
Why does this error say “link expired” if the problem is file size?
PHP accepts the connection but silently discards the POST body when it exceeds post_max_size. WordPress receives an empty request, finds no nonce, and reports the action token as expired. The error reflects WordPress’s interpretation of an empty request, not the PHP-level cause.
After I raise the limits, do I need to do anything else?
Confirm the new limits are active in Tools → Site Health → Info → Server, then retry the upload. If the upload still fails, check whether upload_max_filesize is also below your file size, or whether a memory exhausted error is preventing processing after the upload succeeds.
Related Glossary Terms
- Upload Exceeds Maximum File Size
- Image Upload Failed
- HTTP Error Uploading Images
- Memory Exhausted Error
- PHP
- .htaccess
- wp-config
- REST API Cookie Check Failed
How CyberOptik Can Help
Still broken? Our team fixes WordPress errors like this in under 30 minutes for maintenance clients. The “link expired” error is one of WordPress’s most confusing because the message doesn’t point to the real cause. Getting PHP limits configured correctly — and keeping them correct through hosting migrations and server changes — is part of what our WordPress maintenance plans cover. Contact us to get your upload environment working reliably or learn about our managed hosting options.

