Link You Followed Expired

How to Resolve “The Link You Followed Has Expired” Error in WordPress

Are you experiencing “The Link You Followed Has Expired” error in WordPress? This is one of the many common WordPress errors you may encounter when using WordPress. But like the majority of WordPress errors, it is straightforward to fix.

The main problem with this error message is its lack of description. The error message does not, in any way, tell you what is wrong. This makes it challenging to resolve for beginners. That’s not an uncommon issue where many errors are involved.

Today, I will demonstrate how to resolve “The Link You Followed Has Expired” error in WordPress.

There are several different methods available, and we’ll cover a few of them. We’ll also touch on some troubleshooting methods that you can use when you run into other WordPress errors.

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

It is always important to understand the cause of an error message because this gives you the knowledge to avoid it in the future. I know that’s easier said than done in a lot of cases. We’ll talk about that more in a minute.

As for “The Link You Followed Has Expired,” typically, you will experience this error when you are in the process of uploading a theme or plugin from the admin panel.

The issue is caused by the file upload limit defined by your web host. In most cases, the limit is high enough to avoid these kinds of errors. However, if the file is larger than usual, or your host has set a low file upload limit, the error can occur.

If you were trying to upload a large file or directory other than a plugin or theme, you would most likely run into the “Maximum Execution Time Exceeded” error. Two different errors, but the root cause is the same in both cases.

However, this error isn’t too hard to fix.

Let’s Fix “The Link You Followed Has Expired” in WordPress

Since the error is caused by an upload limit set by your web host, all you need to do is increase that limit.

Nothing to it, right?

There are multiple ways to do this, and all of them require adding a few lines of code. Don’t let that discourage you. You do not need to be a coding expert to fix this error. As long as you can copy and paste, you will be fine.

Method 1: functions.php File

The functions.php file is the most edited file for the majority of websites. However, keep in mind that this is tied to your current WordPress theme.

Thus if you decide to change your theme later, your upload limit will be set back to the default value. But if you do not change your theme often, then this is the easiest file to edit.

This is one of the reasons why it’s always a good idea to use a child theme when running a WordPress website.

If you do plan on changing themes and don’t want to use a child theme, you might prefer to try the next method. That one involves an edit to the .htaccess file, which is not part of WordPress, so a WordPress update won’t overwrite it.

But to stop the error via the functions.php file, here’s what to do. Locate your theme’s function.php file and paste the following code into it:

@ini_set( 'upload_max_size' , '100M' );
@ini_set( 'post_max_size', '100M');
@ini_set( 'max_execution_time', '300' );
Add code to the functions.php file to fix the link followed expired error

Make sure to change the upload_max_size and post_max_size values to the necessary sizes you need. You must also make sure the max-execution-time is long enough for the file to be uploaded.

Save the changes to the file, and your error should be resolved.

Some Things to Note About This Method

I would recommend that you keep the above values as low as possible, while still increasing them enough to fix the error.

There are a couple of reasons for that approach. First, you don’t necessarily want to allow long execution times, as that can have a negative effect on your website performance during large uploads. If you upload a lot of large files, that can be an issue.

Second, shorter execution times and a smaller upload size can prevent a hacker from easily uploading large files. Granted, that’s a less likely scenario. But considering that 90,000 WordPress sites are hacked every day (more than one every second!), it’s something that could happen to any of us.

Method 2: .htaccess File

If you change your theme often or are planning to do so soon, altering the .htaccess file is the best option.

The .htaccess file lives in the root (often public_html) directory of your website and allows you to configure certain types of web server behavior. That configuration is done by either adding or removing directives from the file.

Simply locate the .htaccess file (again, it’s usually in the root directory of your site, not the WordPress directory) and paste the following lines of code:

php_value upload_max_filesize 100M
php_value post_max_size 100M
php_value max_execution_time 300
php_value max_input_time 300
Add code to the .htaccess file to fix the link followed expired error

Remember to adjust these values to meet your specific needs. But the same recommendations I made for method #1 apply here. You don’t want to add necessarily high values.

Save the changes to the file you should no longer see “The Link You Followed Has Expired Error” message.

Method 3: php.ini File

Sometimes finding the .htaccess file can prove challenging. If you want to avoid that entirely, and also not use the functions.php method, there is still another option—the php.ini file.

However, it is important to know that if you are on a shared hosting package, the php.ini file may not exist, or it may not be user-editable. In that case, you might try to create a blank php.ini file in your website’s root directory.

Once you have located or created the php.ini file, paste the following lines of code in it:

upload_max_filesize = 100M
post_max_size = 100M
max_execution_time = 300
Add code to the php.ini file to fix the link followed expired error

Adjust these values as you see fit.

Save the changes, and your error will be resolved.

Method 4: Update Your PHP Version

Outside of increasing the upload limit, another cause of this error is an out-of-date PHP version. As you can probably imagine, the solution is just to update your PHP version, which you should be doing anyway.

The good news is that this is extremely easy to do, so let’s begin.

Step 1: Locate the Choose PHP Version Tool

WordPress is built using the PHP coding language and it is constantly being updated. It is technically possible to use older PHP versions and not have any errors, but this is usually only for websites that are purposely using older tools.

If your website is modern, you should be using the latest PHP version available. You can easily select what version of PHP your site is using directly from the cPanel.

Start by logging into your hosting account and accessing the cPanel.

Once inside, look for the Software section and select the Select PHP Version option.

Select PHP Version

Step 2: Choose PHP Version

The recommended PHP version in WordPress is 7.4. There are newer versions of PHP available, but the WordPress team still recognizes this as the best in 2022. Thus, you should have this version.

At the top, you will see a drop-down box to select your current PHP version. Choose 7.4.

Update your PHP version to fix the link followed expired error

Once you change it your site will be updated, there is no “Save” button, so you can leave the page after making your selection. If your PHP version was the issue, it should resolve the error now.

It’s Easy to Fix the “The Link You Followed Has Expired” Error in WordPress

One of the biggest mistakes that new developers make is panicking over an error message. While WordPress could do a better job of listing the exact cause of an error, there are plenty of other places to find the information.

As a web developer, you will run into errors at some point. It’s unavoidable, but it’s also completely normal. Even the best developers sometimes make changes that can break some parts of their websites. None of us are immune.

The good news is that it’s easy to fix WordPress errors. The majority of these problems can be resolved within a few minutes.

You can also consider using a backup to restore your website before the error appeared. However, I recommend doing this as a last resort. Mainly because of how easy it is to repair most WordPress issues.

But also because if you restore from a backup, you’ll never know the cause of the error. (Unless it appears again, at which point you’ll be back to square one and have to determine what’s causing the error.)

Were you trying to upload a theme or plugin from the admin area when you ran into this error? Which file did you choose to edit?

4 thoughts on “How to Resolve “The Link You Followed Has Expired” Error in WordPress”

  1. Hello sir. I don’t know if it is a bit late to message you but I experience “the link has expired” in all aspect. Every time I publish a post it will pop up, I deactivate plug ins it also appears. What should I do? I’m hoping youcan help me. Thank you and God bless!

  2. Like the gentleman above, I also get this message every time I publish a post. And I have all limits maxed. Any ideas?

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.