Encountering the message “The link you followed has expired” on a WordPress website is a common problem, especially when uploading media files, plugins, or themes. While the error message might seem vague and confusing, it’s typically related to PHP configuration settings that impose limits on the size of files that can be uploaded or the amount of time allowed for a script to execute. This article will walk you through the common causes of this error and how to troubleshoot and fix it effectively.
Understanding the Error
The error commonly arises when a user tries to upload a file — usually a theme or a plugin — directly through the WordPress dashboard. Instead of a successful upload, the site responds with the message:
“The link you followed has expired.”
This error message is generated by WordPress and is most often due to restrictions set by the hosting environment’s PHP configuration. Specifically, it typically relates to low settings for the following PHP directives:
- upload_max_filesize
- post_max_size
- max_execution_time
When any of these values are too low, WordPress fails to process the upload correctly, resulting in the expired link message.
How to Troubleshoot the Error
1. Identify When the Error Occurs
Understanding when the error appears is key to troubleshooting. Ask the following questions:
- Does the error occur when uploading a theme or plugin?
- Are you trying to upload large media files via the WordPress media uploader?
- How large are the files you are attempting to upload?
In most cases, if you’re uploading files over 2MB and your server has the default PHP limits in place, you’re likely to see this error.
2. Check the Current PHP Limits
Before making any changes, it’s useful to determine the current PHP limits. You can do this by installing a plugin such as WP Server Info or checking via the command line or control panel (cPanel, Plesk, etc.).
Look for the following values:
- upload_max_filesize
- post_max_size
- max_execution_time
Once you find the current values, you can determine whether they need to be increased.

How to Fix the Error
Option 1: Increase Limits via .htaccess
For Apache servers, modifying the .htaccess
file is one of the easiest ways to increase PHP limits. Add the following lines to the file located in your WordPress root directory:
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
These changes instruct the server to allow larger file uploads and extend processing time. Save the file and attempt the upload again.
Option 2: Update PHP Settings in php.ini
In some hosting environments, you may need to access or create a php.ini
file to change settings:
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
Make sure to place this file in the root of your site — or the appropriate directory, depending on your host’s configuration. After saving the changes, restart the web server if necessary.
Option 3: Change Settings via cPanel
If your hosting provider uses cPanel, follow these steps:
- Log into cPanel.
- Go to Software » MultiPHP INI Editor.
- Choose your domain from the dropdown.
- Modify the values for:
- upload_max_filesize (e.g., 64M)
- post_max_size (e.g., 64M)
- max_execution_time (e.g., 300)
- Click Apply.
These changes should take effect almost immediately.

Option 4: Modify Theme Functions File
If you don’t have access to .htaccess or php.ini, a temporary workaround is adding code to the theme’s functions.php
file:
@ini_set('upload_max_size' , '64M');
@ini_set('post_max_size','64M');
@ini_set('max_execution_time','300');
While not always effective, this method can help in restricted environments. It’s best used cautiously, as editing the functions file incorrectly can crash your site.
Option 5: Contact Your Hosting Provider
If none of the above options work, it may be because the hosting company has restricted the ability to change PHP directives manually. Contact your hosting support team and request them to increase the PHP limits. Provide the necessary values to apply.
Preventing the Error in the Future
While increasing limits solves the problem, excessive values may lead to resource overusage, especially on shared hosting environments. Here are some best practices to avoid seeing this error again:
- Use an FTP Client: For large themes or plugins, uploading via FTP and installing from the dashboard is safer and bypasses PHP limits.
- Optimize Media Files: Resize or compress uploaded images or videos before uploading to WordPress.
- Keep WordPress, Themes, and Plugins Updated: Updates often include enhancements that reduce the need for large file uploads or long execution times.
If your project or business requires frequent large file uploads, consider upgrading to a VPS or dedicated hosting plan for better resource control.
Conclusion
The “The link you followed has expired” error can be inconvenient but is usually straightforward to fix by increasing relevant PHP limitations such as file upload size and script run time. Identifying the root cause and applying the appropriate fix — whether via .htaccess, php.ini, cPanel, or theme functions — ensures smoother site performance and a more efficient workflow.
Frequently Asked Questions (FAQ)
- What causes the “link you followed has expired” error in WordPress?
- This error usually occurs due to low limits set for file upload size, post size, or execution time in the server’s PHP configuration.
- Will changing .htaccess harm my website?
- When done correctly, modifying the .htaccess file is perfectly safe. Be sure to backup the file before making any changes.
- Is the error related to expired sessions or links?
- No. Despite the wording, the error is unrelated to session expiration. It’s tied to server limitations during the upload or processing phase.
- Can I fix the error without changing PHP settings?
- You can bypass the error by uploading large files directly via FTP and installing them from the WordPress dashboard. However, adjusting PHP limits offers a long-term fix.
- What are safe values to use for upload_max_filesize and post_max_size?
- Common settings include 64M or 128M, but they should reflect your actual use case. Avoid setting excessively high values on shared servers.
By addressing the configuration settings associated with this error and following the right procedures, users can ensure their WordPress site remains stable and functional during uploads and theme/plugin installations.