Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
25 Million+
Websites using our plugins
Years of WordPress experience
WordPress tutorials
by experts

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

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

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

‘The link you followed has expired’ error usually occurs when you are trying to upload a WordPress theme or a plugin that is bigger than the file size limits set by your WordPress hosting provider.

Here’s what the message looks like:

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

Web hosting companies control the size of files you can upload to WordPress to improve the overall performance of your web server. You see, large files can cause your website to become unstable or slow.

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

WordPress file upload limit

That being said, if these settings are too low, or you are trying to upload a larger file, then you may see errors like the memory exhausted error or the maximum execution time exceeded error.

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

With that in mind, 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 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 from your admin area 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' );

In this code, we’ve increased the limits to 120 megabytes for upload and post sizes and the execution time to 300 seconds.

Feel free to adjust the values in upload_max_size and post_max_size to be more than the file you are trying to upload. You can also increase the max_execution_time to the time you think it would take for the file to upload.

Finally, you will need to toggle on the code snippet to make it active on your website.

Activate and save snippet in WPCode

For more details, please see our guide on how to easily add custom code in WordPress.

Method 2: Increasing Limits in the .htaccess File

Another way to increase your PHP resource limits is to edit .htaccess, which is a core WordPress file. You can do so with an FTP client or the File Manager app in cPanel.

Simply connect to your website using FTP and locate the .htaccess file in the root or public_html folder. Then, open it to edit it using a code editor.

Editing the .htaccess file using FTP

Now, you need to add the following lines of 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

Like the previous method, you can adjust the values to be more than the file you are trying to upload.

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 directory.

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, go ahead and try the next method.

Method 4: Update Your PHP Version

Besides the previous methods, updating the PHP version can potentially fix the ‘The link you followed has expired’ error in WordPress. This is because an outdated PHP version can cause compatibility issues, which might lead to this error.

To safely do this for your website, check out our guide on how to update your PHP version in WordPress.

If all of the methods above do not work, then you may need to contact your WordPress hosting provider to see if the problem is on their end. If this is your first time asking for WordPress assistance, read our guide on how to get WordPress support the right way.

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.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

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

65 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

    • WPBeginner Support says

      If none of the methods from our guide were able to assist then we would recommend reaching out to your hosting provider to ensure they don’t have a setting on their end that is overriding your attempts.


  2. Kevin says

    What worked for me was to create a .user.ini file in the public_html folder and put the code mentioned above for php.ini

    • WPBeginner Support says

      It would depend on how your server is set up as not all servers allow user.ini but that is good to know for servers that do :)


  3. Jiří Vaněk says

    Editing limits using the .user.ini file also works on Linux. The directives are very similar. Some providers also prefer the user.ini file to the .htacess file. Thanks for the great video. In the end, it helped me to raise the limits only through the mentioned .user.ini.

  4. Steve says

    Doesn’t work. I’ve run into this before and got it to work but it was awhile back. searched Google and found these instructions but they don’t work for my site.

    • WPBeginner Support says

      If none of the methods in our guide were able to help you, please reach out to your hosting provider and they should be able to assist.


  5. Shane O'Sullivan says

    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

  6. Himesh says

    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”

    • WPBeginner Support says

      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.


  7. Gabriel says

    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.

  8. Gary says

    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.

    • WPBeginner Support says

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


    • WPBeginner Support says

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


  9. Art Bejarano says

    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.

  10. Ann says

    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.

  11. Anurodh Keshari says

    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…

    • WPBeginner Support says

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


  12. Cesar Puente says

    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.

  13. Andri says

    Thanks very much Method 3 worked.

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

    • WPBeginner Support says

      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.


  14. Nathan says

    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

  15. Ravi says

    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

  16. James Voufo Safor says

    Thank you so much. This really worked!

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

    Keep doing what you do.

    • WPBeginner Support says

      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.


  17. Steve says

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

    • WPBeginner Support says

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


  18. Mark Ferguson says

    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?

    • WPBeginner Support says

      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.