This error usually appears when you're trying to upload a WordPress theme or plugin.
Most standard WordPress installations have server limits for file upload size and script execution time. If a file is too large, or if the upload takes too long, WordPress stops the process and shows this message:
“The link you followed has expired.”
To check your current upload limit:
Go to Media > Add New in your WordPress dashboard.
At the bottom of the page, you’ll see something like:
“Maximum upload file size: 2 MB” (this is the default for many hosts).
If your file exceeds this limit—or if your server's timeout is too short—you’ll need to increase these values.
Fortunately, this isn’t hard to solve. Below are several methods you can try. Each involves adding a few lines of code to your WordPress setup.
If your hosting environment gives you access to the php.ini
file, this is a reliable method.
Connect to your site via FTP or your hosting control panel.
Locate or create a php.ini
file in your root directory.
Make a backup before editing.
Add or update the following lines:
memory_limit = 256M
upload_max_filesize = 64M
upload_max_size = 64M
post_max_size = 64M
max_execution_time = 300
max_input_time = 1000
Save the file and reattempt your upload.
This file is part of your WordPress theme, so changes here only apply to the active theme. If you change themes later, you’ll need to reapply the changes.
Go to Appearance > Theme File Editor or access the file via FTP.
Open the functions.php
file of your active theme.
Add this code at the bottom:
@ini_set('upload_max_size', '100M');
@ini_set('post_max_size', '100M');
@ini_set('max_execution_time', '300');
Adjust the values if needed.
Save and test the upload again.
You can also set these limits through .htaccess
, a configuration file in your WordPress root folder.
Locate the .htaccess
file (you may need to enable viewing hidden files).
Add this code at the bottom:
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 and check if the upload works.
If none of the methods above work, or you’re unsure about editing files, reach out to your hosting support.
Send them a quick explanation and ask them to increase the following limits:
memory_limit
upload_max_size
post_max_size
upload_max_filesize
max_execution_time
max_input_time
Including a screenshot of the error can help them identify the issue faster.