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

Did you just try to add a new plugin to your WordPress website and were hit with the “The Link You Followed Has Expired” error? It’s definitely frustrating. But why did it happen? What are the possible causes? And how can I fix and, possibly, prevent it?

Well, that’s what we aim to cover with this blog. I’ll tell you the causes of “The Link You Followed Has Expired” error and what the WordPress experts do to fix it. So without further, let’s get straight into it.

This error usually occurs when you are trying to install a WordPress theme or plugin, or uploading a media file in the library. It may look like this.

expired

But why? Well, WordPress hosting providers usually offer a preset limit on the upload file size that is enough to avoid these types of errors. But what if you try to upload a theme or plugin file that is much bigger? Well, that’s where this error occurs.

So how do you ensure to prevent this error? Well, you can check the maximum upload file size limit by visiting the WordPress admin dashboard and navigating to Media → Add New. Under the media box, you’ll see the “Maximum upload file size”.

maximum limit

Here, for example, the maximum upload file size is 2MB. Smaller sizes are preferable in case of smaller, well-optimized media files. But for more elaborate, high-quality WordPress websites, it would be better to have a larger upload file size.

Unfortunately, WordPress doesn’t have a particular protocol for this type of issue, so it falls back on this default error text.

Let’s create an error-free WordPress website.

Well, it’s quite easy to take care of this error. All you need to do is increase the upload file size limit, which can be done through three different WordPress files. Let’s see how you can fix this error.

Increase the Limits in the functions.php File

The functions.php file acts like a central command center for your WordPress theme. It allows you to add custom functions and modify default behaviors without altering the core theme files. Since updating the theme overwrites any direct changes, you’ll need to use functions.php to ensure all customizations remain intact.

Here’s how you increase the upload file size limit by editing functions.php.

Step 1: Log in to your WordPress dashboard.

Step 2: In the left-hand menu, navigate to Appearance → Theme Editor.

edit themes

Step 3: On the right-hand side of the Theme Editor, you’ll see a list of files related to your active theme. Locate and click on functions.php to open it in the editor.

Step 4: Carefully paste the following code snippet at the very end of the functions.php file:

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

Let’s see what each line does:

  • @ini_set( ‘upload_max_size’ , ‘128M’ ); This line increases the maximum allowed size for uploaded files to 128 megabytes.
  • @ini_set( ‘post_max_size’, ‘128M’); This line increases the maximum size of a post, which can be relevant when uploading large files through media uploads or forms.
  • @ini_set( ‘max_execution_time’, ‘300’ ); This line extends the maximum execution time for PHP scripts to 300 seconds. This gives WordPress more time to process large uploads.

Feel free to modify the values (‘128M’ and ‘300’) to suit your specific needs. And before updating the theme, create a child theme and take a backup to be secure.

Increase the Limits in the .htaccess File

The .htaccess file is located in the root directory of your WordPress installation. With this hidden file (the dot in the front shows it’s hidden), you can tweak server settings, optimize performance, and enhance security.

view-edit

Here’s how you can use WordPress .htaccess to boost the upload file size limits:

Step 1: Access the .htaccess file via FTP client or file manager.

Step 2: Open the .htaccess file in a text editor. Be cautious when editing this file, as incorrect entries can lead to website errors.

Step 3: Add the following code excerpts at the very end of your .htaccess file:

php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value   
max_input_time 300

Here’s what these code lines mean.

  • php_value upload_max_filesize 128M: Sets the maximum allowed file upload size to 128 megabytes.
  • php_value post_max_size 128M: Sets the maximum size of a post (including file uploads) to 128 megabytes.
  • php_value max_execution_time 300: Sets the maximum time (in seconds) a script is allowed to run before timing out to 300 seconds.
  • php_value max_input_time 300: Sets the maximum time (in seconds) allowed for parsing input data (like file uploads) to 300 seconds.

Step 4: After adding the code, save the .htaccess file. The changes should take effect immediately.

Increase the Limits in the php.ini File

The php.ini file dictates how PHP behaves, including those crucial resource limits that can sometimes lead to this error. By making a few adjustments in this file, you can give your WordPress site more breathing room for those larger uploads.

You can find this file within the WordPress directory structure, accessible using cPanel.

new file php ini

Here’s how you increase limits in your php.ini file.

Step 1: Locate your php.ini file through the website’s root directory or config directory of your server.

Step 2: Once you’ve found it, open the php.ini file with a text editor. Look for the following lines (they might not be grouped together):

upload_max_filesize = 
post_max_size = 
max_execution_time = 
max_input_time =

Step 3: Change the values after the equals sign to your desired limits.

For example:

upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
max_input_time = 300

This sets the maximum upload size and post size to 128MB, and the maximum execution and input time to 300 seconds.

Step 4: Save the php.ini file. In some cases, you might need to restart your web server (or even the entire server) for the changes to take effect.

Update the PHP Version

An outdated PHP version can lead to compatibility issues with WordPress core, themes, and plugins, and it might even make your WordPress site vulnerable to security threats. In some cases, it can be the culprit behind this error.

In your WordPress dashboard, go to Tools → Site Health → Info → Server. You’ll find your current PHP version listed there.

  • Before making any changes to your server environment, always create a complete backup of your website. This allows you to easily restore your site if anything goes wrong during the update process.
  • Ensure that your WordPress core, plugins, and themes are updated to their latest versions. This helps minimize potential compatibility issues with the newer PHP version.
  • How you update PHP depends on your hosting provider. You might find an option like “PHP Configuration” or “Select PHP Version” or have to contact the hosting service.

After updating PHP, thoroughly test your website to ensure everything is functioning correctly.

Check for the Plugin Conflicts

Last, but not least, you can check for plugin conflicts to see if they are the cause behind “The Link You Followed Has Expired” error. These conflicts occur when two or more plugins have incompatible code or compete for the same resources.

Here’s how you go about it:

Step 1: Go to Plugins → Installed Plugins in your WordPress dashboard

Step 2: Deactivate all WordPress plugins using the bulk action option.

Step 3: Reactivate your plugins one at a time, checking for the error after each activation. If the error reappears after activating a specific plugin, that’s likely the culprit.

Step 4: Once you’ve pinpointed the problematic plugin, try the following:

  • Update the plugin: Ensure the plugin is updated to its latest version.
  • Check for plugin compatibility: Visit the plugin’s website or support forum to see if there are known compatibility issues with other plugins or your current WordPress version.
  • Contact the plugin developer: If you can’t find a solution, reach out to the plugin developer for assistance.

You can also create a WordPress staging site and test plugin activations and deactivations there without affecting your live site.

You can also hire our WordPress website maintenance services to get an idea what’s causing the error and have it maintained effectively.

What if I've tried these methods and still get the error?
If you're still encountering the error after trying these solutions, it's best to contact your hosting provider. They can help you troubleshoot further and ensure your server settings are properly configured.
Will increasing these limits affect my website's performance?
While increasing limits can help resolve the error, excessively high limits could potentially impact your server's performance, especially on shared hosting. It's recommended to start with moderate increases and monitor your site's performance.
Is it safe to edit these files (functions.php, .htaccess, php.ini)?
Modifying these files can be risky if you're not familiar with code. Always backup your website before making any changes. If you're unsure, it's best to seek assistance from a developer or your hosting provider.

To Summarize

The frustrating “The Link You Followed Has Expired” may occur when you try to upload a theme or plugin to your WordPress site, and the upload exceeds the limits set by the hosting.

Whether you choose to increase limits in your functions.php, .htaccess, or php.ini file, remember to prioritize backups and proceed with caution. Ultimately, by addressing this error proactively, you can ensure a smoother WordPress experience and continue building a thriving online presence.

If you need further help with it or other errors, consult with our WordPress professionals today!

Want expert assistance with your WordPress project?

author
Mehul Patel is a seasoned IT Engineer with expertise as a WordPress Developer. With a strong background in Core PHP and WordPress, he has excelled in website development, theme customization, and plugin development.

Leave a comment