How to Fix “The Link You Followed Has Expired” Error

The error message “the link you followed has expired” is a common error that occurs when browsing websites.

Some errors that come from the plugins or themes are easy to notice and fix in time, but the “link you followed has expired” error originates in the root folders. The things that happen on the WordPress server are usually undetectable to non-technical users.

In fact, this error can be handled with a small intervention in the coding. Since it’s a minor error related to uploading files, you don’t have to worry much if you’re looking for solutions outside of the WordPress settings. Even if you are a beginner, in this article we will give you a step-by-step guide to help you fix this issue, as well as wonderful tips for your file protection.

Why do you see the error “The link you followed has expired”?

When you upload a WordPress theme or plugin via your WordPress dashboard, you may see the error message “The link you followed has expired”. This message only appears if your files are larger than the default limits, which are usually dependent on the WordPress hosting company you’re using.

If the maximum number is too low, other relevant errors may also be displayed when uploading large files, such as “maximum execution time exceeded” or “memory exhausted”. Hosting companies impose these restrictions to maintain the performance of your WP hosting server, as they want to make sure your website loads fast enough to improve the customer experience.

Fortunately, you can avoid this mistake by increasing the limit to a safer number by following the three ways below.

Increase the maximum size in the functions.php file

The problem lies in the size of your files. Therefore, simply increase the PHP memory and execution time for your website.

In your admin dashboard, navigate to Appearance → Theme Editor. Open the function.php file in the right-hand sidebar and add the following code to the functions.php file of the WordPress theme:

@ini_set( 'upload_max_filesize' , '150M' );

@ini_set( 'post_max_size', '150M');

@ini_set( 'max_execution_time', '500' );

Set the value as you wish, but make sure that it is still within a safe range. Also, the number of max_execution_time should also reflect the file size. The only problem with this method is its instability.

Whenever you switch to a new theme, the settings are reset to the default values or the old limits. So, don’t forget to consider carefully whether you want to change the theme or adjust the settings.

Adjusting the file upload limits in the .htaccess file

To edit this file, you must have access to the .htaccess file on your WordPress server. You can use either an FTP client or CPanel to do this.

Editing the .htaccess file with an FTP client

Use FTP client software such as FileZilla to connect your website and edit the .htaccess file.

Simply add some php_value attributes to the files, e.g. size or time.

php_value upload_max_filesize 150M

php_value post_max_size 150M

php_value max_execution_time 500

php_value max_input_time 500

Edit the .htaccess file with the CPanel client

To access the server, add “cpanel” to the end of the domain of your website. Log in to the server with the CPanel user name and password. In CPanel, open the File Manager application and open the public.html folder.

As with an FTP client, search for the .htaccess file and edit it by adding the corresponding codes.

3. Maximize limits in the php.ini file

Unlike the other methods here, you cannot add or edit the values directly in the root folders. Instead, create an empty php.ini file locally on your computer and add the following lines of code using Notepad, TextEdit or a similar application.

upload_max_filesize = 150M

post_max_size = 150M

max_execution_time = 400

Save the file as php.ini and change the storage type to “All files”. Then upload the php.ini file to your WordPress server using an FTP client.

Hide your website when you fix the error “The Link You Followed Has Expired”

When you fix errors, you obviously don’t want to interrupt visitor or customer activity on your website. The best way to do this is to make your website private so that only you and your users such as administrators, editors and authors, can log in and change the settings.

Password Protect WordPress (PPWP) Pro is considered the best WordPress security plugin that allows you to password protect posts, pages, custom post types and even the entire website.

To prevent visitors from accessing your website while you’re fixing the bug or switching to a new theme, you may need the plugin’s site-wide protection feature.

Once you have installed and activated the plugin, navigate to Password Protect WordPress and open the Sitewide section.

Simply enable the Password Protect feature for the entire site and add as many passwords as you like.

To make your website more interactive, you can create a “Coming Soon” or a “Splash” page to inform visitors about the new look of your website and exempt them from the site-wide protection.

Then send the desired user role a password to enter the private page. Once you have made all the necessary settings on your website, simply disable the site-wide protection feature and your website will immediately return to normal.

Conclusion

Whether you’re using FTP or a CPanel client, you can fix the “link you followed has expired” error pretty quickly by increasing the file size limits in the root folders. And if you don’t want to disrupt the user experience while troubleshooting, enable Password Protect WordPress Pro to password protect the entire site.