‘Could not copy file’ error when upgrading Wordfence plugin

Problem

I routinely update my WordPress Plugins and found when updating Wordfence I received the following error:

Installing Plugin: Wordfence Security 5.7.8

Downloading install package from https://downloads.wordpress.org/plugin/wordfence.5.7.8.zip…

Unpacking the package…

Could not copy file. wordfence/images/wordfenceFalcon.png

I tried a second time and received the same error for a different file.

Resolution

Searching WordPress support forums I was able to find a solution that worked.

I SSH’d on to my server and located the /wp-content/upgrade/ folder for my WordPress install. Inside I found a folder called wordfence.tmp

I deleted this folder completely by running sudo rm -rf /wp-content/upgrade/wordfence.tmp

Once the file was deleted I was able to perform the upgrade as normal.

Links

WordFence Upgrade issue on WordPress Support Forums

Leave a Reply

Your email address will not be published. Required fields are marked *