You click “Install Now” on a theme zip in WordPress and get a white page that says “The link you followed has expired.” The message is misleading: nothing expired. The upload was bigger than your server allows. This guide shows how to confirm that, raise the right limits (or skip the browser uploader), and get the theme installed.
Quick answer: The upload went over PHP’s post_max_size, so PHP threw away the form data, including WordPress’s security token, and WordPress showed its “expired” message. Upload a smaller file or raise the limits.
- Make sure you are uploading the installable theme zip, not the full marketplace download.
- Check Upload max filesize in Tools > Site Health > Info > Server.
- Raise
upload_max_filesizeandpost_max_sizeto 64M in.htaccess,.user.inior your host’s PHP settings. - On Nginx, raise
client_max_body_sizeas well. - Or skip the browser: install with
wp theme installor upload the folder over SFTP.
In this guide
- Before You Start
- Why WordPress Says “The Link You Followed Has Expired”
- Check Your Current Upload Limits in Site Health
- Fix 1: Upload the Installable Theme Zip, Not the Full Download
- Fix 2: Raise the Limits in .htaccess (Apache and LiteSpeed)
- Fix 3: Raise the Limits in php.ini or .user.ini (Nginx and PHP-FPM)
- Fix 4: Raise Memory and Time Limits in wp-config.php
- Fix 5: Skip the Browser Uploader with WP-CLI or SFTP
- Seeing “413 Request Entity Too Large” Instead?
- If It Still Doesn’t Work
- Frequently Asked Questions
- Next Steps

Before You Start
- Access: WordPress admin, plus your host’s file manager, SFTP or SSH to edit files in the WordPress root (the folder with
wp-config.php). - Time: 10–20 minutes.
- Backup: download a copy of
.htaccessandwp-config.phpbefore you edit them. A wrong line in either file can take the whole site down with a 500 error, and the copy lets you undo it in seconds.
Why WordPress Says “The Link You Followed Has Expired”
WordPress protects forms with nonces, short-lived security tokens that prove a request came from a logged-in user. When you upload a theme under Appearance > Themes > Add New, the form sends a nonce along with the file.
If the request is bigger than post_max_size, PHP discards the whole request body, nonce included. WordPress cannot verify the request, assumes the token is stale, and shows its generic “expired link” message.
Four PHP settings cause nearly all of these failures:
upload_max_filesize: the largest single file PHP accepts (often 2MB on default setups).post_max_size: the largest whole request PHP accepts. It must be at least as large asupload_max_filesize.max_execution_time: how long a script may run before PHP stops it (often 30 seconds).max_input_time: how long a script may spend receiving input such as an upload.
Check Your Current Upload Limits in Site Health
Before you change any file, see which limits your server actually enforces. You do not need a phpinfo() script for this.
- Open your WordPress dashboard.
- Go to Tools > Site Health.
- Click the Info tab, then expand Server and Media Handling.
Look at Upload max filesize and PHP post max size. If your theme zip is 28MB and the limit shows 2M or 8M, you have found the problem.
Fix 1: Upload the Installable Theme Zip, Not the Full Download
Many “expired link” errors come from uploading the wrong file. When you choose “Download All files & documentation” on ThemeForest, you get a master zip with documentation, design files, licences, plugins, and the actual theme zip nested inside.
These bundles can run to tens or hundreds of megabytes. Uploading the master file causes two problems:
- It goes over your server’s upload limits.
- Even if the upload finishes, WordPress cannot find
style.cssat the top level and fails. If that happens, see how to fix “The theme is missing the style.css stylesheet”.
Before you upload, check the file on your own computer:
- Extract the downloaded marketplace zip.
- Find the inner zip named after the theme (for example
theme-name.zip). - Open it and check that
style.cssandfunctions.phpsit directly inside its top-level folder. - Upload only that inner zip.
If the right zip still fails, raise the limits with one of the next fixes.
Fix 2: Raise the Limits in .htaccess (Apache and LiteSpeed)
If your server runs LiteSpeed Enterprise, or Apache with PHP as a module (mod_php), the .htaccess file in your WordPress root is usually the fastest place to change the limits.
Open .htaccess with SFTP, SSH or your host’s file manager, and add these lines just below the # END WordPress line:
# Custom PHP Upload Limits for WordPress Themes
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
php_value memory_limit 256MSave the file, reload Site Health and check that Upload max filesize now shows 64 MB, then try the upload again. If the site shows a 500 Internal Server Error right after saving, your host runs PHP in a mode that rejects php_value lines. Remove them and use Fix 3 instead.
Fix 3: Raise the Limits in php.ini or .user.ini (Nginx and PHP-FPM)
On Nginx, or Apache with PHP-FPM, set the limits in the server’s main php.ini (if you have root access) or in a .user.ini file in your WordPress root (often /public_html/ or /var/www/html/). On Hostinger you can also change them in hPanel; see how to increase the PHP memory limit and upload size on Hostinger.
Create or edit .user.ini in the WordPress root and add:
; Increase file upload and execution limits
upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 256M
max_execution_time = 300
max_input_time = 300According to the PHP core directives documentation, post_max_size must be equal to or larger than upload_max_filesize. If you raise the upload size to 64M but leave the post size at 8M, anything over 8MB still fails without a clear error. On Nginx, also check client_max_body_size (see the 413 section below).
PHP-FPM caches .user.ini files for a few minutes, so the new values may not show in Site Health straight away. If you have root access to your VPS, restart PHP-FPM over SSH to apply them now. Use the command that matches your PHP version:
# Restart PHP 8.2 FPM on Ubuntu/Debian
sudo systemctl restart php8.2-fpm
# Or restart PHP 8.3 FPM
sudo systemctl restart php8.3-fpmThe restart prints nothing when it works. Reload Site Health and check the new values.
Fix 4: Raise Memory and Time Limits in wp-config.php
If you cannot edit server settings, you can still raise memory and execution time in wp-config.php. This does not fix an upload that is simply too large: ini_set() cannot change upload_max_filesize, post_max_size or max_input_time. It only helps when the file is accepted but WordPress runs out of time or memory while unpacking it.
Open wp-config.php in the WordPress root and paste this just above the /* That's all, stop editing! Happy publishing. */ line:
// Increase memory and execution time
@ini_set('max_execution_time', '300');
define('WP_MEMORY_LIMIT', '256M');
define('WP_MAX_MEMORY_LIMIT', '512M');Themes with large demo content also need these limits during the import. See how to install an Envato WordPress theme and import demo content.
Fix 5: Skip the Browser Uploader with WP-CLI or SFTP
If you have SSH or SFTP access, you can avoid the browser upload altogether, so no upload limit applies.
Method A: Install with WP-CLI
Connect to the server over SSH and use WP-CLI theme install. The local zip path must be a file already on the server (upload it with SFTP first), or use the URL form:
# Navigate to your WordPress root
cd /var/www/html
# Install the theme from a local zip file path
wp theme install /path/to/my-theme.zip --activate
# Or install directly from a remote URL
wp theme install https://example.com/downloads/my-theme.zip --activateOn Hostinger shared hosting, the WordPress root is ~/domains/yourdomain.com/public_html rather than /var/www/html. When the install works, the output looks like this:
Unpacking the package...
Installing the theme...
Theme installed successfully.
Activating 'my-theme'...
Success: Switched to 'My Theme' theme.Method B: Upload the Theme Folder over SFTP
Without WP-CLI, extract the theme zip on your computer. You get a folder named after the theme (for example astra or custom-theme).
- Connect to your server with an SFTP client such as FileZilla or Cyberduck.
- Open
/wp-content/themes/. - Upload the unzipped theme folder into that directory.
- In WordPress, go to Appearance > Themes.
- Click Activate on the new theme.
Seeing “413 Request Entity Too Large” Instead?
On Nginx the same oversized upload can fail earlier, with a plain 413 Request Entity Too Large page. Nginx rejected the request before PHP saw it, so raising the PHP limits alone changes nothing. The Nginx default is 1 MB. Set client_max_body_size in the http or server block of your Nginx configuration to at least the value you chose for upload_max_filesize:
server {
client_max_body_size 128M;
}Then test the configuration and reload Nginx over SSH:
sudo nginx -t && sudo systemctl reload nginxnginx -t should report that the syntax is ok and the test is successful before the reload runs. On managed or shared hosting you cannot edit this file yourself; ask your host to raise the limit.
If It Still Doesn’t Work
- Site Health still shows 2 MB. Your host is probably enforcing its own limit, or you edited a file PHP does not read (for example
.htaccesson a PHP-FPM server). Try the other file, wait five minutes for the.user.inicache, or ask support. Otherwise use WP-CLI or SFTP from Fix 5. - The limits are high enough, but the error appears instantly. A security plugin or web application firewall may be stripping the
_wpnoncetoken from the upload. Turn the firewall off briefly, try the upload, then turn it back on and add an exception. - The upload works but the install fails with “style.css” missing. You uploaded the wrong zip. Go back to Fix 1.
Frequently Asked Questions
Does “The link you followed has expired” happen with plugin uploads too?
Yes. The same thing happens when you upload a plugin under Plugins > Add New > Upload Plugin, and large page builders can exceed 15MB. The same fixes apply: raise the limits in .user.ini or your host’s PHP settings, or install it over SSH with wp plugin install.
Why didn’t editing functions.php fix the upload error?
Because PHP has already handled the upload before your theme loads. Adding @ini_set('upload_max_filesize', '64M'); to functions.php has no effect: PHP does not allow upload_max_filesize to change at runtime. Set it in .htaccess, .user.ini, php.ini or your host’s control panel instead.
What PHP limits should a WordPress site use?
For most sites, upload_max_filesize = 64M, post_max_size = 64M, memory_limit = 256M and max_execution_time = 300 are enough. That covers large theme uploads, bulk imports and image resizing. Go higher only if a specific upload or import still needs it.
Why do I see this error when saving a page or submitting a form?
Then the nonce really did expire or was cached. Nonces stay valid for 12 to 24 hours, so a tab left open overnight fails; reload it and try again. If a front-end form fails for visitors, a page cache may be serving an old nonce. Exclude that page, or follow our guide to CDN edge cache rules for WordPress.
Next Steps
Once the theme is installed, go back to Tools > Site Health and confirm the limits you set are the ones you want to keep. If the theme ships with demo content, import it next; the same time and memory limits apply there.

