How to fix Error ‘The Link you followed has expired’ in WordPress Plugin / Theme Installation.

How to fix Error ‘The Link you followed has expired' in WordPress Plugin / Theme Installation.

Hosting companies have a setting which controls the size of files you can upload from inside the WordPress admin area. They also have a setting which stops scripts from running too long.

You can see the file size upload limit by visiting Media ยป Add New page.

These restrictions make your website safer and improves the overall performance of your WordPress hosting server.

If these settings are too low, or you are trying to upload a larger file, then you would see errors like memory exhausted error or maximum execution time exceeded error.

However, if you are trying to upload a WordPress theme or plugin, then you would see โ€˜The link you followed has expiredโ€™ error.

That being said, letโ€™s take a look at how to easily fix this problem.


Fixing โ€˜The Link You Have Followed Has Expiredโ€™ Error

The quickest way to fix โ€˜The link you followed has expiredโ€™ error is by increasing the file upload size, PHP memory, and execution time limits for your website.

There are multiple ways to do that. We will show you all of them, and you can choose the one that looks easier or the one that works on your hosting environment.

Method 1. Increasing limits in functions.php file

This method is easier, but it has a downside. Your site will return back to the old limits if you change WordPress theme. If you are planning on changing your theme, then try one of the other two methods described below.

Simply 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โ€™ );

You can increase the values in upload_max_size and post_max_size to be more than the file you are trying to upload.

You will also need to increase the max_execution_time to the time you think it would take for the file to upload. If you are unsure, then you can try doubling this value.

Method 2. Fix by increasing limits in .htaccess file

If you donโ€™t want to add code to your themeโ€™s functions file, then you can try the .htaccess method.

For this method, you will need to edit the .htaccess file by using an FTP client or the File Manager app in cPanel.

Simply connect to your website using FTP and edit the .htaccess file.

Editing the .htaccess file using FTP

Now, you need to 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

Donโ€™t forget to save your 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 configuration file used by PHP and WordPress. Youโ€™ need to connect to your WordPress site using an FTP client and look for php.ini file in your siteโ€™s root folder.

Most users are on a shared hosting account, so they may not find it in their siteโ€™s root folder. In that case, you need to create a blank php.ini file using a plain text editor like Notepad and upload it to your website.

Now edit the php.ini file and add the following code inside it.

upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300

Donโ€™t forget to save your changes and upload the file back to your website.

You can now visit your website and try to upload the theme or plugin file. The error should disappear, and you should be able to upload the file.