Resources     Blog  

  1. Home
  2. WordPress Tutorials
  3. How to Resolve “The Link You Followed Has Expired” Error in WordPress

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.

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.

Since the error is caused by an upload limit set by your web host, all you need to 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' );

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

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

Adjust these values as you see fit.

Save the changes, and your error will be resolved.

Did you know you can temporarily (and quickly) disable a plugin by renaming the plugin directory? That’s a standard troubleshooting tool, but there’s a lot more troubleshooting information available out there.

It’s Easy to Fix WordPress Errors

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 part 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?

Author: Robert Giaquinto

Robert has been writing tutorials about WordPress and other CMS for over 3 years since joining the GreenGeeks marketing team. Thanks to this, he has had the opportunity to research and master several areas of WordPress including plugin usage, SEO, website design, and social media integration. When he is not creating content for WordPress, Robert is digging up new content ideas for environmental pieces. These range from the pollution in our air to the danger’s wildlife face. And with a bachelor’s degree in electrical engineering, he is always eager to discuss the way our technologies are affecting the environment, especially when it comes to solar energy.

Was this article helpful?

Related Articles

Comments

  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!

Leave a Comment

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