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.

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

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.

Troubleshooting

If the error persists, try these steps:

  • Double-check the values in the code snippets to ensure they match your requirements.
  • Consider using a plugin to manage file upload limits.
  • Contact your hosting provider for assistance with server configurations.

0
355