Essentially, there is a setting controlling the size of files uploaded from the WordPress Admin area and a setting to stop scripts from running too long as well. In fact, these limits help to protect your site and improve the overall performance. However, when the file you are uploading exceeds the maximum size or it takes a long time to upload, the problem occurs. There are several ways to fix this problem.
1. Increase limits in functions.php file
By this way, you add the following code to the WordPress Theme's functions.php file:
@ini_set( 'upload_max_size' , '120M' );
@ini_set( 'post_max_size', '120M');
@ini_set( 'max_execution_time', '300' );
In these lines, you can increase the upload_max_size and post_max_size to be larger than the file you are uploading. Also, increasing the max_execution_time is very useful in case it takes a long time to upload the file.
However, the downside is that when you change the theme, these changes will be reset to the old limits.
2. Increase limits in .htaccess file
Another way is to edit the .htaccess file. Connecting to your website via FTP, you can fix the issue by adding the following lines to the bottom of the .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
Save the file and check the problem on your site again.
3. Increase limits in php.ini file
To look for this file, you need to connect your site via FTP Client account. In case you are on a shared hosting account, you may not find this file, but you can create a blank php.ini file and upload to the site's root folder.
Then, in this file, add the following code:
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
4. Contact the hosting provider
In case you want to avoid any other unexpected problem, the simplest way is to contact the hosting provider and wait. They can help you fix this error quickly.
After trying one of the methods above, you can visit your site and upload file again.
We hope that this article is useful for you when you need to fix "The link you followed has expired" error. Share the post so that you can save others from troubles.