How To Fix “The Link You Followed Has Expired” Error in WordPress
Are you encountering the error message “The link you followed has expired” in WordPress? This error is commonly seen when trying to upload a theme or plugin and can be frustrating for users, especially because the message doesn’t provide much information about the cause. Fortunately, there are effective methods to resolve this issue.
What Causes “The Link You Followed Has Expired” Error?

The error usually occurs when you’re attempting to upload a WordPress theme or plugin from the admin area. It’s triggered by server configurations that restrict file upload size, PHP memory, and script execution time. These limitations are in place to enhance website security and performance.
You might see similar errors, such as “memory exhausted error” or “maximum execution time exceeded error,” if these restrictions are set too low or if you’re uploading a large file.
How To Fix “The Link You Followed Has Expired” Error (Common Issues)
Let’s look at three methods to fix this error by increasing file upload size, PHP memory, and execution time limits. You can choose the one that best suits your hosting environment.
Method 1: Increasing Limits in functions.php File
This method is straightforward but has a caveat: if you change your WordPress theme, the limits will revert to their previous values. If you plan to change your theme, consider one of the other two methods.
Add the following code to your WordPress theme’s functions.php file:
@ini_set( 'upload_max_size' , '120M' );
@ini_set( 'post_max_size', '120M');
@ini_set( 'max_execution_time', '300' );Adjust the values to match your file size and upload time requirements.
Method 2: Fix by Increasing Limits in .htaccess File
As an alternative, you can use the .htaccess file to adjust the limits. Edit the .htaccess file using an FTP client or cPanel’s File Manager.

Add the following code at the bottom of your .htaccess file:
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value max_input_time 300Save the changes and upload the file back to your website.
Method 3: Fix by Increasing Limits in php.ini File
The php.ini file is a PHP configuration file used by WordPress. Look for the php.ini file in your site’s root folder. If you’re on shared hosting and can’t find it, create a blank php.ini file using a plain text editor and upload it.
Edit the php.ini file and add the following code:
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
Save the changes and upload the file back to your website.
Solutions (From Easiest to Most Complex)
1. Refresh and Re-login
- Refresh your browser page.
- Log in again if asked.
- Try the action that caused the error again.
2. Clear Browser Data
- Open browser settings.
- Find the option to clear browsing data.
- Select cache and cookies.
- Clear the data and restart your browser.
- Log in to WordPress again.
3. Increase WordPress Memory
- Open
wp-config.phpvia FTP or file manager. - Add:
define('WP_MEMORY_LIMIT', '256M'); - Save and test.
4. Verify WordPress URLs
- Access your database through phpMyAdmin.
- Find the
wp_optionstable. - Check
siteurlandhomeentries. - Update URLs if incorrect.
- Save changes and test.
5. Reset WordPress Salts
- Go to https://api.wordpress.org/secret-key/1.1/salt/
- Copy the generated keys.
- Replace the existing keys in
wp-config.php. - Save and try logging in again.
6. Disable Security Plugins
- Access your site via FTP or hosting file manager.
- Go to
/wp-content/plugins/. - Rename security plugin folders (e.g.,
wordfencetowordfence_off). - Try accessing the admin area.
- If successful, reactivate plugins one by one to identify the conflict.
7. Disable All Plugins
- Rename the
/wp-content/plugins/folder to/wp-content/plugins_old/. - Try accessing the admin area.
- If successful, move plugins back one by one to find the culprit.
8. Switch to Default Theme
- Rename your current theme folder in
/wp-content/themes/. - WordPress will switch to a default theme.
- Test if the error persists.
9. Recreate .htaccess File
- Rename existing
.htaccessto.htaccess_old. - Go to Settings > Permalinks in WordPress.
- Click ‘Save Changes’ to generate a new
.htaccess.
10. Check File Permissions
- Set directories to 755 (or 750).
- Set files to 644 (or 640).
- Use FTP client or hosting file manager to adjust permissions.
11. Repair Database
- Add
define('WP_ALLOW_REPAIR', true);towp-config.php. - Visit
yoursite.com/wp-admin/maint/repair.php. - Run database repair.
- Remove the line from
wp-config.phpafter repair.
12. Adjust Server Timeout Settings
- Create or edit
.htaccessfile in WordPress root. - Add:
php_value max_execution_time 300
php_value max_input_time 300
php_value max_input_vars 3000
php_value memory_limit 256M
php_value post_max_size 64M
php_value upload_max_filesize 64M
- Save and test.
13. Increase PHP Limits
In php.ini or through hosting panel, increase:
- max_execution_time
- max_input_time
- memory_limit
- post_max_size
- upload_max_filesize
14. Check for Malware
- Use a security plugin or online scanner to check for malware.
- Remove any detected threats.
- Change all passwords after cleaning.
15. Check Server Logs
- Access error logs via hosting panel or FTP.
- Look for WordPress or PHP related errors.
- Address specific issues found.
16. Update PHP Version
- Check current PHP version with your host.
- Request an update to the latest stable version.
- Test WordPress admin access after update.
17. Reinstall WordPress Core
- Download fresh WordPress copy.
- Replace
wp-adminandwp-includesfolders. - Replace root files except
wp-config.phpandwp-content.
Improve your WordPress site with Linkilo, the best internal linking tool. Stop wasting time on tedious internal linking. Linkilo's WordPress plugin does the heavy lifting, so you can focus on creating great content while improving your site's navigation and user experience.
More Info
Compare Us
General Info
🎉 Linkilo Sale! Get the ultimate WordPress plugin at a discount – price increases soon!
Get the Discount Now!


