How to Fix the “Link You Followed Has Expired” Error in WordPress

When you manage a site, you will come across different issues that you need to fix. One of the most common ones is that the link you’re following has expired. That’s why in this article, we will show you how to fix the “Link you followed has expired” error in WordPress.

Why does the “Link you followed has expired” error occur in WordPress?

The link you followed has expired is a standard WordPress error that occurs when:

  • Uploading custom themes and plugins to the site via admin panel
  • Your theme is incompatible with the PHP version

This usually happens when the maximum file size or maximum memory in your server isn’t configured properly. Let’s have a closer look.

File Limit Restriction

Most WordPress hosting companies limit the server’s PHP limits for security and performance-optimization purposes. For example, if hosting has configured 10MB as the max upload size for your server, when you try to upload a theme, plugin, or file larger than 1 MB, you will get the link expired error.

The link you followed has expired

On top of that, hosting services also define a specific time for each PHP execution. If the upload process takes more time than what they have configured, you will see the “Link you followed has expired” error in the admin section.

Incompatible PHP

If the PHP version of your WordPress site isn’t compatible with your theme, you will get this error. This doesn’t happen very often because theme and plugin developers usually make sure that their products are compatible with the most popular PHP versions. However, if you are trying to upload an outdated theme or plugin, you may have PHP incompatibility issues.

To fix these issues, simply raise the PHP limits configured by your web hosting company or update the PHP version.

How to Fix the “Link You Followed Has Expired Error” in WordPress

The good news is there are several ways to solve this issue. In this section, we’ll show you different ways to fix the “Link you followed has expired” error in WordPress:

  1. Editing the theme’s functions.php file
  2. Via the .htaccess file
  3. Editing the php.ini file
  4. PHP version
  5. Hosting company

Let’s have a look at each method so you can pick the best one for you.

NOTE: Before starting, we recommend you create a full backup of your site and use a child theme. You can either create one or use a child theme plugin

1) Editing the functions.PHP file

By adding some extra code to your theme’s functions.php file, you will be able to increase the execution limits and avoid this error. Let’s see how you can edit your functions.php file to increase the upload_max_size, post_max_size, and max_execution_time.

  • upload_max_size: The maximum file size you’re allowed to upload
  • post_max_size: Defines the maximum size for all the data that a post contains including text, images, and so on
  • max_execution_time: It’s the maximum time a script is allowed to run before it’s aborted even if it’s not completed

To do this, there are two options:

  • Through the WordPress theme editor
  • Using a plugin

Let’s have a closer look at each method.

1.1) Edit functions.php file via Theme Editor

First, open your WordPress admin dashboard and go to Appearance > Theme Editor.

wordpress theme editor

On the right-hand side, you will see the theme name and the files you can edit.

theme files

By default, WordPress will load the style.css. Simply look for the functions.php file and select it.

fix the link you followed has expired error in wordpress - functions.php file

After that, copy the code from below to increase the upload_max_size, post_max_size, and max_execution_time.

@ini_set( 'upload_max_size' , '100M' );
@ini_set( 'post_max_size', '100M');
@ini_set( 'max_execution_time', '300' );

Then, paste it at the end of your functions.php file and update it.

fix the link you followed has expired error in wordpress - update functions.php

That’s it! By increasing the limits you fix the main causes of the “Link you followed has expired” error in WordPress.

1.2) Edit functions.php using a plugin

If you’re not comfortable directly editing core files, you can use a plugin. In our experience, Code Snippets is the best tool to add code and it’s free.

First, you need to install and activate the plugin on your site.

fix the link you followed has expired error in wordpress - install code snippets

After that, you will see the plugin’s settings on the left-hand side. Under Snippets, click Add New

add a new snippet

Name your snippet and paste the following code:

@ini_set( 'upload_max_size' , '100M' );
@ini_set( 'post_max_size', '100M');
@ini_set( 'max_execution_time', '300' );

Please note that these are reference values, you may need to adjust for your site.

raise limits

Finally, save it so the code runs server-wide.

That’s how you can run custom PHP snippets on your WordPress site and avoid the “Link you followed has expired” error.

2) Edit the .htaccess File

You can edit the .htaccess file from the Theme Editor, so you will need an FTP client or a dedicated file manager plugin. For this demonstration, we’ll use an FTP client.

First, you need to locate the .htacess file. Go to the public_html folder and you will see it there.

htaccess file

Now it’s time to modify it to fix the “Link you followed has expired error” on your WordPress site.

2.1) Increase Limit

The first thing you need to do is increase some PHP limits, so copy the following 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

Keep in mind that you may need different values on your site, so adjust them accordingly.

2.2) Edit the File

Now let’s paste these values in the .htaccess file. To edit the file, right-click on it and press View/Edit.

edit file

FileZilla will open the file on the text editor you have installed. Then, paste the code we’ve just copied in the footer and save it.

htaccess file updated

After that, upload the file back to the server and press Yes in the pop-up.

upload file back to the server

That’s it! By increasing the limits for data transfer and file uploading, you have fixed the “Link you followed has expired” issue.

3) PHP.Ini File

If you don’t want to edit your functions.php or .htaccess file, you can solve this error by increasing the limits via the php.ini file. You can either edit the existing one or create a brand new php.ini file.

First, check your root folder to see if the php.ini file exists. If you already have it on your server, you can edit it, otherwise, open up any text editor and paste the code from below.

upload_max_filesize = 100M
post_max_size = 100M
max_execution_time = 300

fix the link you followed has expired error in wordpress - php.ini file pasted

After that, save the file and call it php.ini.

Now that you have created a php.ini file, you need to upload it to your website’s root. To do this, you can use an FTP Client, via the cPanel’s file manager, or using a dedicated file manager plugin. For this demonstration, we’ll use an FTP Client.

Once you have established a connection between your server and the FTP client, open the public_html folder and upload the php.ini file you have just created.

upload php.ini file

That’s it! You have successfully changed your server’s default upload_max_size, post_max_size, and max_execution_time.

Please make sure that the file name is correct and that you upload it to the right destination, otherwise, it won’t work.

4) Update the PHP Version

When you use an outdated PHP version, you can expect the “Link you followed expired” error on your site. If WordPress is not compatible with your PHP version, you’ll have a hard time running your website smoothly. WordPress recommends using PHP 7.4 or greater as well as MySQL 5.6 or MariaDB 10.1 for good performance.

fix the link you followed has expired error in wordpress - wordpress minimum server requirements

If you are running an older PHP version, you should consider updating it. The good news is that most cPanel hosting providers and managed WordPress hosting providers include this feature. So to update your PHP version, log in to your control panel and click PHP Configuration under Software.

fix the link you followed has expired error in wordpress - php configuration

There you will see the version you’re currently using and you can simply select the PHP version you want from the dropdown. Then, press Update to apply it server-wide.

fix the link you followed has expired error in wordpress - update php

Within some seconds, your server will be running on the selected PHP version.

As you can see, changing the PHP version is straightforward but if you need help, you can always contact your hosting’s support specialists.

Some hosting companies such as Kinsta and WP Engine include this feature in their account dashboards, so you can change your PHP version right from there.

NOTE: Keep in mind that some of your installed themes/plugins may not be compatible with the PHP version you plan to use, so before updating the PHP version, run some compatibility tests using PHP Compatibility Checker to avoid other issues.

5) Contact Your Hosting Company

If none of the above solutions help you fix the “Link you followed has expired” error on your WordPress site, you should contact your web hosting provider. Their support team will help you solve the issue and adjust the server restrictions. 

Final Recommendations

Keep The Values Low As Possible

Only change the values if you need to. For example, if you have to upload a file that’s larger than the limit, you will have to increase it. However, you may want to change it back to the previous levels after that.

WordPress is the most popular CMS and more than 30,000 sites get hacked every day. Keeping these values high is risky because hackers can easily upload files of any size, execute them, and take control of your website. On top of that, the long execution time may affect your site’s performance and bandwidth usage. So to protect your website from hackers and keep it performance-optimized, you should keep a low PHP execution time.

Modify the Child Theme, Not the Parent

As mentioned above, we don’t recommend modifying your parent theme. Instead, you should customize the child theme. This is because if you edit the parent theme, every time you update it, your existing files will be overridden so you will lose all the customizations. When you use a child theme, however, the updates on the parent theme don’t affect your modifications.

If you don’t know how to create a child theme, have a look at this step-by-step guide.

Make Sure You Have a Backup

Fixing the “Link you followed has expired” error involves editing your theme files, WordPress core files, or making changes to your PHP versions. To keep your data safe, you should create a full backup of your site and store it in a safer location (not on your server), so if anything goes wrong, you can restore your site.

Conclusion

All in all, if you upload large files via the admin panel and your theme is incompatible with the PHP version, you may encounter issues. 

In this guide, we’ve shown several ways to fix the “Link you followed has expired” error in WordPress:

  • Through the functions.php file
  • Via .htaccess file
  • Editing the PHP.ini file
  • Updating the PHP version
  • Contacting your hosting company

All these methods are simple and easy to follow even if you are a beginner. If you don’t want to use any third-party tools, you can edit the functions.php file either from the Theme Editor or with Code Snippets. Alternatively, if you don’t want to add extra code to your site, follow the .htaccess method.

Alternatively, the php.ini method is also user-friendly and quick, whereas if you’re experiencing compatibility issues with PHP, you should update to the latest PHP version for the best performance.

Finally, if you don’t feel comfortable with any of those methods, contact your hosting company and ask them to fix it for you.

If you liked this post, you may be interested in the following guides:

Which method did you use to fix the expired link issue? Do you know of any other way? Let us know in the comments section below.