Website Development Services

Webdot

Dealing with The Notorious “The Link You Followed Has Expired” Error

Dealing with The Notorious

When you work with WordPress, you’ve probably encountered the infamous “the link you followed has expired” error. Unfortunately, most beginners get confused because the message itself doesn’t say much about what went wrong.

In this post, I’ll tell you all about why this error occurs and how you can deal with it. Thus, by the end of this article, you’ll know what not to do to avoid getting this message in the future.

What Is the “The Link You Followed Has Expired” Error?

You’ll usually get this message when you try to upload a new theme to WordPress. You see, WordPress hosting companies may have some size limit by default. So when you try to upload a theme that’s bigger than the size limit, you get the error message.

Sometimes the error may occur if the PHP version is incompatible with your theme. Fortunately, the themes and plugins from developers are supported by the most popular PHP versions. Therefore, PHP incompatibility will only happen in case of uploading an outdated theme.

What is the Default Size for Themes?

The default size varies on the hosting plan you bought. Your web host is likely to set a file upload limit. But the good news is, most hosting companies give you a limit high enough to avoid this error. But situations do occur. It’s best if you know your given limit.

To find out the maximum allowed file size, go to Media> Add New on the WordPress dashboard. Notice that there’s a note under the ‘Drop files here’ area that says the default size limit for the upload.

Resolving “The Link You Followed Has Expired” Error

As a bigger upload size causes the error, the solution is simple, right? You either increase your size limit, or you compromise your theme, size-wise. So let’s see how you can fix this without compromising anything.

Method 1: Edit Functions.php File

You can increase the execution limits by adding some extra code to the functions.php file of your theme. To do that, open your WordPress admin dashboard. Then go to Appearance> Theme Editor. This will open a list of files that you can edit.

From this list, find the functions.php file. Now copy the following code to increase the maximum size and execution time:

@ini_set( ‘upload_max_size’ , ‘100M’ );

@ini_set( ‘post_max_size’, ‘100M’);

@ini_set( ‘max_execution_time’, ‘300’ );

Now update your functions.php file by pasting this at the bottom. This will increase the size and execution time limits. That’s it. “The link you followed has expired” error will be gone.

The only downside of this method is that it’ll go back to the old limits when you change the WordPress theme again. But you can change this again in the same way.

Method 2: Edit .htaccess File

If you don’t want to modify your functions file, there’s another method. To make this work, you need to edit the .htaccess file. For that, you need to use an FTP client or the file manager app in cPanel. Here’s a step-by-step guide to doing that using the cPanel.

Step 1: Log in to cPanel

Open your cPanel and log in using your username and password. If you’re unsure, check the welcome email that you got from your hosting provider. That email usually contains the login information.

Step 2: File Manager

Look around the cPanel until you find the File Manager app. Open file manager and find and open the public.html folder.

Step 3: Add This Code

Inside the public_html folder you’ll see the .htaccess file. Right click on it and click on edit. Now copy the lines of code given below:

php_value upload_max_filesize 64M

php_value post_max_size 64M

php_value max_execution_time 300

php_value max_input_time 300

Paste these lines at the end of the .htaccess file and hit save. That’s it. You should now be free from ‘the link you followed has expired.’

Method 3: Create a PHP.ini File

If the previous methods didn’t save you, worry not. Here is the third method. You can create or edit a php.ini file to solve the issue. Before doing anything, check if you already have a php.ini file in your site’s public_html folder.

If there’s a php.ini there, just edit that and add the following lines at the end of the file:

max_execution_time = 300

upload_max_filesize = 128M

post_max_size = 256M

memory_limit = 128M

max_input_vars = 5000

If there’s no php.ini file in the public_html folder, you need to create a new one. To do that, open a blank page on notepad (windows) or TextEdit (mac). Now enter the PHP values that you need to change. In this case, paste the lines of code given above.

Save the text file as PHP.ini on your computer. Now transfer the file you just created to your server, or in other words, your public_html folder. This should give you enough headroom and resolve the ‘the link you followed has expired’ error.

Method 4: Update PHP Version

If you’re by any chance using an outdated PHP version, then you’re likely to get the ‘The link you followed has expired’ message. Because WordPress is not compatible with your outdated PHP version.

WordPress recommends PHP version 7.4 or greater. Also, MySQL version 5.6 or greater OR MariaDB version 10.1 or greater. Consider the update for a smooth website running experience. Most hosting services include this. So, update your PHP and forget unwanted issues.

Final Thoughts

Please keep in mind that you should only change the values when you absolutely have to. After uploading a file, change back to the previous values. Keeping the values high increases the risk of getting hacked because it leaves room for hackers to upload malicious things.

Hopefully, any one of the methods will be sufficient to solve your problem. But if you still face trouble getting rid of the ‘link you followed has expired’ error, I suggest you contact your hosting company. Their support will help to adjust the restrictions that you’re having.