[Solved] WordPress Update Not Working

I was having trouble updating plugins are the Wordress core.

Symptoms:

  • WordPress not updating to the latest version. The lastest version is 5.0.3. After the one-click update, WordPress would say “Welcome to WordPress 5.0.2”
  • Updated Yoast from version 9.3 to 9.4. But Yoast is still trying to load all of the js assets from 9.3 which do not exist anymore.

Clearing the Cache

There are couple other blog posts detailing how to clear various caches including:

  • Browser cache
  • Cloudflare cache
  • WP Cache plugin

None of these worked. After some trial and error, I found the files were cached in the PHP opcache. In some versions of PHP, byte code is cached.

To clear the byte code, simple add this line to the function.php file of one of your plugins:

opcache_reset();

Reload the page once, then remove that line. You should be good to go.