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

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

‘The link you followed has expired’ error usually appears when you’re trying to upload a large theme or plugin file to your WordPress site. This error doesn’t give many clues about what’s wrong, which is why WordPress beginners often find it difficult to resolve.

But thankfully, we’ve experienced various common WordPress errors before, and we know how to troubleshoot and fix them effectively. We’ve compiled the most reliable solutions in this guide.

In this article, we will show you how to easily fix ‘the link you followed has expired’ in WordPress.

Fixing '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.

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: Increase 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: Increase PHP Memory Limit in wp-config.php

This method provides an alternative approach to increasing resource limits compared to the WPCode plugin.

While the WPCode plugin offers a user-friendly interface to manage code snippets without modifying core theme files, editing the wp-config.php file directly affects your WordPress core configuration.

You will need to use an FTP client or the File Manager app in cPanel to access your website files and locate the wp-config.php file.

For detailed instructions on finding and editing this file, check out our guide on how to find and edit the wp-config.php file.

Once you’ve accessed the wp-config.php file, open it for editing and paste the following line just before the line that says That's all, stop editing! Happy blogging.:

define( 'WP_MEMORY_LIMIT', '256M' );

This code tells WordPress to allocate 256MB of memory for your website. You can adjust the value in the ‘WP_MEMORY_LIMIT’ line to a higher amount if needed, but we recommend starting with this value first.

For more information about increasing PHP memory limits, check out our guide on how to fix WordPress memory exhausted error.

Method 3: Increase Limits in the .htaccess File

Another way to increase your PHP resource limits is to edit .htaccess, which is a core WordPress file.

Simply connect to your website using FTP or open your File Manager app 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 4: Increase 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 5: 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.

Method 6: Check for Plugin Conflicts

In rare cases, the ‘The link you followed has expired’ error might be caused by conflicts between WordPress plugins. Plugins can sometimes interact with each other in unexpected ways, potentially leading to issues with resource usage or how WordPress handles file uploads.

To see if a plugin conflict is causing the error, you can try deactivating all your plugins and then reactivating them one by one.

Navigate to the Plugins section in your WordPress dashboard. Select all plugins using the checkbox at the top, choose ‘Deactivate’ from the bulk actions dropdown menu, and click ‘Apply.’

Bulk deactivate all WordPress plugins

Try uploading the file again. If the error disappears, you know the conflict lies with the deactivated plugins. Now, reactivate each plugin one by one, testing the upload functionality after each activation.

Once the error reappears, you’ve likely identified the problematic plugin. From here, you can reach out to the plugin developer’s support for troubleshooting assistance.

If the error prevents you from accessing the WordPress admin area, don’t worry. You can refer to our guide on how to deactivate WordPress plugins when you cannot access the admin area.

Also, do note that outdated plugins can sometimes contribute to conflicts. Keeping your plugins updated to the latest versions can help minimize compatibility issues.

Method 7: Contact Your Hosting Provider

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.

Alternatively, you can hire WPBeginner Pro Services’ premium WordPress support solution. Our experts will thoroughly look into your website and address the problem.

Emergency WordPress Support

We also have WordPress maintenance services if you want all of your security and speed optimization tasks taken care of.

Book an appointment with our experts today and see how we can help you out.

Learn More Ways to Troubleshoot WordPress

Experiencing other errors on your website? Check out these guides to troubleshoot WordPress:

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 list of the most common block editor problems.

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

66 CommentsLeave a Reply

  1. Mohammed Sathik

    For me Method 3 worked… Thank you mate

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  2. Syed Shan Shah

    Nothing worked for me.

    • WPBeginner Support

      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.

      Admin

  3. Kevin

    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

      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 :)

      Admin

  4. Jiří Vaněk

    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.

    • WPBeginner Support

      You’re welcome :)

      Admin

  5. Steve

    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

      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.

      Admin

  6. Shane O'Sullivan

    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

    • WPBeginner Support

      Glad to hear you were able to solve the issue!

      Admin

  7. Himesh

    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

      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.

      Admin

  8. Gabriel

    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.

    • WPBeginner Support

      Thank you for sharing what worked for you!

      Admin

  9. Gary

    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

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

      Admin

  10. Michael Douglas

    Thanks for the help. This took care of the issue for me.

    • WPBeginner Support

      Glad our guide was helpful!

      Admin

  11. Bernard

    Very helpful thank you.

    • WPBeginner Support

      You’re welcome!

      Admin

  12. Ry

    Thank you!

    Used .htaccess method.

    • WPBeginner Support

      You’re welcome, glad that our recommendations were able to assist!

      Admin

  13. Syed Nauman Sajid

    Brilliant and perfectly worked for me.

    • WPBeginner Support

      Glad our guide could help!

      Admin

  14. Bob

    People should check their settings. I left the M off from 128M. Really stupid but that was my issue.

    • WPBeginner Support

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

      Admin

  15. Art Bejarano

    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.

  16. Ann

    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.

  17. Anurodh Keshari

    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

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

      Admin

  18. Cesar Puente

    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.

    • WPBeginner Support

      Glad our recommendations were able to help :)

      Admin

  19. Akin

    Method 2 worked for me like charm. Thank so much for this.

    • WPBeginner Support

      Glad our recommendation helped you :)

      Admin

  20. Carly

    Worked perfectly – thanks so much!

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  21. Tasmim

    Really good suggestion. works really fine now

    • WPBeginner Support

      Glad our recommendation helped :)

      Admin

  22. elijah

    which location should i post the method one which line

  23. Tudor

    It worked, thank you!

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  24. Andri

    Thanks very much Method 3 worked.

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

    • WPBeginner Support

      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.

      Admin

  25. Rush

    Thanks for help!

    • WPBeginner Support

      You’re welcome :)

      Admin

  26. Khan

    METHOD 2 worked perfectly.
    I was trying to install the elegant theme

    Thanks Brother!

    • WPBeginner Support

      Glad our guide could help :)

      Admin

  27. Theo

    Thank you, that was most helpful. I modified .htaccess.

    • WPBeginner Support

      Glad our guide was able to help :)

      Admin

  28. Nathan

    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

  29. Ravi

    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

    • WPBeginner Support

      Glad our recommendation was helpful :)

      Admin

  30. James Voufo Safor

    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

      Glad our guide could help :)

      Admin

  31. kwaku Vesper

    thanks very much it worked

    • WPBeginner Support

      You’re welcome, glad our guide could help :)

      Admin

  32. Waqar

    Did all these methods but still getting the error :(
    Don’t know what else to do

    • WPBeginner Support

      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.

      Admin

  33. Steve

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

    • WPBeginner Support

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

      Admin

  34. Mark Ferguson

    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

      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.

      Admin

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.