Beginner's Guide for WordPress / Start your WordPress Blog in minutes

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

Are you seeing ‘The link you followed has expired’ in WordPress?

This error does not give many clues about what’s wrong, which is why beginners find it difficult to resolve.

In this article, we will show you how to easily fix ‘the link you followed has expired’ in WordPress. We will also talk about what causes this error and how to avoid it in the future.

Fixing 'The link you have followed has expired' error

What Causes ‘The Link You Have Followed Has Expired’ Error?

This error usually occurs when you are trying to upload a WordPress theme or a plugin to your website from the WordPress admin area.

You will see a message saying, ‘The link you followed has expired. Please try again’.

The link you followed has expired error displayed on a WordPress website

WordPress hosting companies have a setting that controls the size of files you can upload inside the WordPress admin area. They also have a setting that stops scripts from running too long.

You can see the file size upload limit by visiting the Media » Add New page.

WordPress file upload limit

These restrictions make your website safer and improve the overall performance of your WordPress hosting server.

If these settings are too low, or you are trying to upload a larger file, then you will see errors like the memory exhausted error or the maximum execution time exceeded error.

However, if you are trying to upload a WordPress theme or plugin, then you will see ‘The link you followed has expired’.

That being said, let’s take a look at how to easily fix this problem.

Fixing ‘The Link You Have Followed Has Expired’ Error

The quickest way to fix ‘The link you followed has expired’ is by increasing the file upload size, PHP memory, and execution time limits for your WordPress website.

There are multiple ways to do that. We will show you all of them, and you can choose the one that looks easier and works in your hosting environment.

You can use the quick links below to jump to the method you want to use.

Method 1: Increasing Limits Using WPCode (Recommended)

Increasing limits in the functions.php file can be easy, but this method has a downside. Your site will return back to the old limits if you change or update your WordPress theme.

That’s why we recommend using WPCode instead.

WPCode is the best code manager plugin for WordPress that allows you to add code snippets anywhere on your website without editing theme files like functions.php. That way, any customizations you make won’t be lost when you update or change your theme.

First, you will need to install and activate WPCode. For more details, please see our beginner’s guide on how to install a WordPress plugin.

Once the plugin has been activated, simply go to Code Snippets » Add Snippet and click on ‘Add Your Custom Code.

Add new snippet

Make sure to select ‘PHP snippet’ from the ‘Code Type’ dropdown menu, and then enter this code into the ‘Code Preview’ box.

@ini_set( 'upload_max_size' , '120M' );
@ini_set( 'post_max_size', '120M');
@ini_set( 'max_execution_time', '300' );
Increase file upload size with WPCode snippet

You can increase the values in upload_max_size and post_max_size to be more than the file you are trying to upload.

You will also need to increase the max_execution_time to the time you think it would take for the file to upload. If you are unsure, then you can try doubling this value.

Finally, you will need to toggle on the code snippet to make it active on your website. For more details, please see our guide on how to easily add custom code in WordPress.

Method 2: Increasing Limits in the .htaccess File

You can also try the .htaccess method. For this method, you will need to edit the .htaccess file by using an FTP client or the File Manager app in cPanel.

Simply connect to your website using FTP and edit the .htaccess file.

Editing the .htaccess file using FTP

Now, you need to add the following code at the bottom of your .htaccess file.

php_value post_max_size 128M
php_value max_execution_time 300
php_value max_input_time 300

Finally, don’t forget to save your changes and upload the file back to your website.

Method 3: Increasing Limits in the php.ini File

The php.ini file is a configuration file used by PHP and WordPress. You will need to connect to your WordPress site using an FTP client and look for the php.ini file in your site’s root folder.

Most users are on a shared hosting account, so they may not find this file in their site’s root folder. In that case, you will need to create a blank php.ini file using a plain text editor like Notepad and upload it to your website.

Now, edit the php.ini file and add the following code inside it.

upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300

Don’t forget to save your changes and upload the file back to your website.

You can now visit your website and try to upload the theme or plugin file again. The error should disappear, and you should be able to upload the file.

If it doesn’t, then try to increase file limits to match the file size you are trying to upload. Otherwise, you may need to contact your WordPress hosting provider to see if the problem is on their end.

We hope this article helped you easily fix ‘The link you followed has expired’ in WordPress. You may also want to bookmark our guide on how to fix the most common WordPress errors and check out our expert picks for the best WordPress plugins to grow your site.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

56 CommentsLeave a Reply

  1. I am running WordPress on my iMac at localhost:8888 but changing the sizes in wpcode made no difference. After editing the htaccess file, I was able to upload the theme, so cheers

  2. I followed every single step as mentioned to work around the problem of uploading a theme to wordpress when upload limit was too low. Used the WP Code Snippet to increase the limits and still the same message: “link expired”

    • If our recommendations do not work for you, please reach out to your hosting provider and they should be able to assist with this issue.


  3. I am using GCP.
    It works only after modifying php.ini under fpm, and restart php-fpm
    Modifying .htaccess would lead to internal server error.

  4. I tried 3 methods all. But the limit value was not changed.
    On the ‘Add New’ page from ‘Media’, the Maximum upload file size is still 2MB.
    Do I need to restart service or something?
    Please help me.

    • Your hosting provider may be overriding the max file size, if you check with your host they should be able to assist!


    • Everyone can make a typo like that but we’re glad you were able to find and solve the issue for you :)


  5. I’m having an issue: I’ve added the htaccess text at the end and it did not work. I removed any formating on the text and it still did not work. I need help.

  6. I tried all the steps but I still have the issue. I have the issue every time I click on save/submit. For example, update WordPress version. Enable debug mode in Elementor. Disable all plugins.
    Please help to let me know how can I fix it, please.

  7. In my dashboard Maximum upload file size is 512 MB. but still, I’m facing this issue but I’m facing this issue while deactivating the plugin… can you help me…

    • You would want to check with your hosting provider to ensure they are not overriding any of your changes.


  8. This guide helped me a lot. I had this problem with local WordPress. I couldn’t upload my customize theme to test it.

    Thank you so much.

  9. Thanks very much Method 3 worked.

    But, Server error when I edit the .htaccess file and Adding to functions.php doesnt work.

    • Glad our guide was helpful, if any of the methods don’t work then we would recommend checking with your host as those are settings that may be getting ignored due to server settings.


  10. I get a 500 Internal Server error when I edit the .htaccess file. How do I add the code without getting this error. Adding to functions.php doesnt work for me

  11. Many thanks, your method 2 worked for me on 04-JULY-2020. I have added following code before the tag:

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

  12. Thank you so much. This really worked!

    I followed the second method and now I have the theme installed.

    Keep doing what you do.

    • You may want to reach out to your hosting provider to ensure they’re not overriding the changed you’re making and that they don’t see any errors from their end.


  13. Sadly this explanation does not indicate in which folder the php.ini should be located/placed

    • Apologies if our explanation was not clear, the php.ini should be in your site’s root folder.


  14. I have a client having this issue but only on the woocommerce login form. If you click link to try again it works. Any ideas?

    • If the methods in this article and resaving your permalinks does not fix the issue, you would want to reach out to WooCommerce for assistance.


Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.