| |

WordPress Database Encoding & the Case of Disappearing Widgets

Recently I was updating the widgets on my homepage to promote the new WP in One Month. I decided to do so with the logo and a caption, making Jetpack’s Image Widget the perfect candidate. I uploaded the logo, added a title, then copy and pasted the text from the website’s ‘Jumbotron’ area for the caption. I clicked ‘Save’ and something strange happened: all of the Image Widgets, everywhere on my site, disappeared. I tried to do the same thing with a Text Widget, thinking maybe there’s a bug in Jetpack’s Image Widget or it doesn’t allow certain text/markup. After going through the same steps and clicking ‘Save’ every Text Widget on the site disappeared. I decided (really, was forced) to do some investigating.

[TL;DR] Here’s the reason: Depending on how your WordPress database is encoded, certain character types will break widgets. The font (Lato) I was using is apparently the culprit, which I figured out with the help of WP Engine Support. There have been lengthly discussions on this.

Here is what I tried and why I thought these steps would resolve the issue. In each, I copy and pasted text directly from WP in One Month’s site:

  • Remove all HTML markup from the caption in Jetpack’s Image Widget, then slowly add certain elements back in. I thought perhaps there was broken markup or the Image Widget got rid of some markup.
  • Do the same thing for the Text Widget: remove all HTML markup and slowly add it back in, for the same reason as above.
  • Try creating the widget on my staging site & locally to rule out it being an issue specific to my live site or WP Engine. I was able to recreate the issue.
  • Create a completely different Text Widget with nothing but plain text. This worked. It was around this time I decided I would completely abandon using Jetpack’s Image Widget for this task.
  • Create a  Text Widget with some HTML markup.  This and everything below worked.
    • Add more HTML markup.
    • Add an image.
  • Copy and Paste the text from WP in One Month into a Plain text editor and then from the plain text editor into the Text Widget. That worked.
    • Add markup and an image to that text. This also worked.

During this time I was communicating back and forth with WP Engine’s Support team while they ran their own tests, including some of what’s above. When I told  them about the last step, they told me it was likely the font compounded with a database encoding issue native to WordPress. I can’t stress how helpful they were, and during a particularly rough week for them too.

For what it’s worth:

  • This was the first time in 12 years using WordPress I ran into this issue.
  • I am using Lato by Google Fonts on WP in One Month. That’s the font of the text I was trying to copy/paste.
  • I plan on copying text from other areas of the site and pasting it into Text Widgets to see what happens.

I’m still a little fuzzy on if there is an actual resolution in place. My site has been on WordPress for years now – I’m not sure if new, clean WordPress installs still have an encoding problem. There are instructions on how to convert Database Character Sets on the Codex. I did not try this, but might on my staging site when I have some time. If you have any more information, feel free to leave it in the comments!

Similar Posts

  • 100 Words 042

    Whew. It’s been a little too long since I’ve done one of these. With the semester starting things have gotten super busy for me! This morning I was able to help a fellow Coalworker with an issue regarding WordPress that was solved by using pre_get_posts (tutorial coming soon). This is significant for me because a year…

  • My Next Tech: Podcast Gear

    Back in April, I walked you through my current podcast gear, which I’ve been enjoying! That said, I always knew that this equipment was a temporary “between setups” setup that let me upgrade from a USB mic while familiarizing myself with interfaces and XLR mics without a huge investment. Hopefully in the Fall, I’ll be…

  • | |

    Interesting Links for Friday

    The Offline Glass: This is fantastic. A glass that will only stand up if a cell phone is under it. This is needed in all bars. Google Robot helps boy throw out first pitch: This is ridiculous and amazing. Google is doing things that are truly changing the world. And the story isn’t too bad either 😉…

  • | |

    Info Overload- The New Design

    Note: This article was published while I was in my early 20s. I was much younger and dumber. Please don’t hold it against me. One of the perils of having a 20+ year old website! I hadn’t realized it, but next month will be 2 and a half years since my last redesign, which is…

  • | |

    Simplecast Episodes and New Projects Page

    Over the weekend, I announced on Twitter that I officially released a plugin I’ve been working on for a while called Simplecast Episodes, which allows you to add and embed podcasts hosted at simplecast.fm into WordPress. I’m happy to say that it’s officially in the WordPress Plugin Directory.

  • |

    How I Light my Live Streams: Automated Lighting Setups

    One of my biggest pieces of advice for people getting into video (or even doing virtual talks) is, “Have good lighting.” This will make you look better, and your webcam won’t have to work as hard, meaning a better picture. There are some simple solutions, but I wanted something a little more automated. Here’s what…