WordPress upgrade breaks the visual editor

I hardly ever use WordPress’ visual editor. As a web developer, it just feels more natural and efficient for me to compose pages and posts in the HTML panel, manually adding the markup I need to give me the control I want.

But because WordPress makes publishing to the web so accessible to a wide audience of varying technical aptitude, I get how important the visual editor is. In fact, it was a fairly non-technical client that first pointed out to me that the visual editor on their site had stopped working after a recent WordPress upgrade.

A little research turned up lots of posts in the WordPress forums from people having the same issue, although I don’t remember any specifically attributing the problem to an upgrade. I just assumed some file used by the editor had gotten corrupted somehow and that it was an isolated incident. I found a solution suggested by someone in the forums, it worked, and I moved on to other projects.

Over the last few weeks however, I’ve upgraded around half a dozen other WordPress installations for clients and they’ve all had the same issue. After the upgrade, the “kitchen sink” (the visual editor toolbar) disappears and the tab that switches between the Visual and HTML views doesn’t do anything. You can’t view the page or post content in the Visual mode.

The original fix still works but it involves adding a line of PHP to the wp-config.php file. Not overly complex but also probably not something your average WordPress user wants to try to do themselves. Luckily I found another solution that solves the problem and actually has some added benefit as well.

Enter the Use Google Libraries plugin. Again, I’m speculating that the visual editor issue is caused by some file that is incompatible with some aspect of the newest WordPress version (3.3.1). Because of the functionality of the visual editor, it’s most likely a javascript file that stops working. The Use Google Libraries plugin allows your site to use Google-hosted common javascript libraries rather than WordPress’ local (to your server) copies. This appears to solve the visual editor issue because the problematic file is no longer used, a working copy from Google’s CDN is substituted instead. Problem solved.

The added benefit of using Google-hosted javascript libraries is increased performance. Google Libraries CDN is popular because of the performance advantage, so there’s a good chance that your visitors have already visited another site that uses them. If they have, those files will already be in their browser cache and don’t need to get downloaded again. Your site loads faster. If your visitor hasn’t already cached copies, the browser will need to download them. But Google Libraries files are compressed so file sizes are smaller and download faster. Your site loads faster. Lastly, any files you can offload to another server is less work yours has to do. Your server is faster.

So if you’re having problems with the visual editor after a WordPress upgrade, or if you’re just looking for an easy way to get a little performance boost, try the Use Google Libraries plugin. Search for ‘use google libraries’ from the Install Plugins control panel page or browse to http://wordpress.org/extend/plugins/use-google-libraries/ and download it directly from the WordPress Plugin Directory.