How To Fix “The Link You Followed Has Expired” Error in WordPress

Go Back to Main Knowledgebase

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.

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.

Smarter Internal Linking, Zero Effort

Link suggestions appear right inside your editor. One click, and it's done.

Try the Plugin

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 300

Save 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

 

  1. Refresh your browser page.
  2. Log in again if asked.
  3. Try the action that caused the error again.

 

2. Clear Browser Data

 

  1. Open browser settings.
  2. Find the option to clear browsing data.
  3. Select cache and cookies.
  4. Clear the data and restart your browser.
  5. Log in to WordPress again.

 

3. Increase WordPress Memory

 

  1. Open wp-config.php via FTP or file manager.
  2. Add: define('WP_MEMORY_LIMIT', '256M');
  3. Save and test.

 

4. Verify WordPress URLs

 

  1. Access your database through phpMyAdmin.
  2. Find the wp_options table.
  3. Check siteurl and home entries.
  4. Update URLs if incorrect.
  5. Save changes and test.

 

5. Reset WordPress Salts

 

  1. Go to https://api.wordpress.org/secret-key/1.1/salt/
  2. Copy the generated keys.
  3. Replace the existing keys in wp-config.php.
  4. Save and try logging in again.

 

6. Disable Security Plugins

 

  1. Access your site via FTP or hosting file manager.
  2. Go to /wp-content/plugins/.
  3. Rename security plugin folders (e.g., wordfence to wordfence_off).
  4. Try accessing the admin area.
  5. If successful, reactivate plugins one by one to identify the conflict.

 

7. Disable All Plugins

 

  1. Rename the /wp-content/plugins/ folder to /wp-content/plugins_old/.
  2. Try accessing the admin area.
  3. If successful, move plugins back one by one to find the culprit.

 

8. Switch to Default Theme

 

  1. Rename your current theme folder in /wp-content/themes/.
  2. WordPress will switch to a default theme.
  3. Test if the error persists.

 

9. Recreate .htaccess File

 

  1. Rename existing .htaccess to .htaccess_old.
  2. Go to Settings > Permalinks in WordPress.
  3. Click ‘Save Changes’ to generate a new .htaccess.

 

10. Check File Permissions

 

  1. Set directories to 755 (or 750).
  2. Set files to 644 (or 640).
  3. Use FTP client or hosting file manager to adjust permissions.

 

11. Repair Database

 

  1. Add define('WP_ALLOW_REPAIR', true); to wp-config.php.
  2. Visit yoursite.com/wp-admin/maint/repair.php.
  3. Run database repair.
  4. Remove the line from wp-config.php after repair.

 

12. Adjust Server Timeout Settings

 

  1. Create or edit .htaccess file in WordPress root.
  2. 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

 

  1. 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

 

  1. Use a security plugin or online scanner to check for malware.
  2. Remove any detected threats.
  3. Change all passwords after cleaning.

 

15. Check Server Logs

 

  1. Access error logs via hosting panel or FTP.
  2. Look for WordPress or PHP related errors.
  3. Address specific issues found.

 

16. Update PHP Version

 

  1. Check current PHP version with your host.
  2. Request an update to the latest stable version.
  3. Test WordPress admin access after update.

 

17. Reinstall WordPress Core

 

  1. Download fresh WordPress copy.
  2. Replace wp-admin and wp-includes folders.
  3. Replace root files except wp-config.php and wp-content.
0
1612