DEV Community

Cover image for How to fix "The link you followed has expired" when uploading wordpress theme
Stephen Akugbe
Stephen Akugbe

Posted on

How to fix "The link you followed has expired" when uploading wordpress theme

I was recently working on a wordpress website and I was having issues uploading a new theme because I kept seeing "The link you followed has expired" error.
This error does not give much clues about what’s actually wrong, which is why it's quite difficult to debug. It is ususally caused by a small "maximum upload file size", generally, the size is usually 2MB, this is usually not enough as some wordpress themes are much larger than this 2MB limit.

There are 2 ways to fix this:

Method 1: Edit .htaccess file

The .htaccess file is a core file used by WordPress, to edit the file, you need to access the WordPress files in your server through an FTP or cPanel file manager.

To edit it through cpanel file manager
Step 1: Login to your cpanel and select file manager
Image of cpanel highlighting file manager

Step 2: Select the .htaccess file shown below and paste the following code at the end of the file.

php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
Enter fullscreen mode Exit fullscreen mode

Image showing .htaccess file on cpanel file manager
Step 3: Once you're done click save and then reload your wordpress site.

sometimes the file manager might not be configured to show hidden files automatically, you'll need to do that yourself before you can view the .htaccess file for editing.
To show hidden files, follow these steps:

  • Go to settings as shown below Image showing how to view hidden files on cpanel file manager
  • Select the show hidden files option and save Image showing how to view hidden files on cpanel file manager then go back to step 2.

Method 2: Create A PHP.ini File

The php.ini file is a configuration file used by PHP and WordPress. It is usually located in the root directory of the site.

Most users are on a shared hosting account, so they may not find it in their site’s root folder. In that case, you need to create a blank php.ini file and edit the content.

Step 1: Login to your cpanel and select file manager
Image of cpanel highlighting file manager

Step 2: Create a new file and name it "php.ini"
Image showing creation process of php.ini file

Step 3: Open the php.ini file you just created and paste the following codes in it:

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
Enter fullscreen mode Exit fullscreen mode

Save and then reload your wordpress site.
This increases your upload size limits to 64MB and fixes the error.

Thank you for reading.

Top comments (0)