The WordPress 4.8 text widget will destroy your content

I just completely lost the contents of a text widget, and it was WordPress’s fault. I had a normal, old-style text widget, containing a set of links, and within each… More »

Spread the love

I just completely lost the contents of a text widget, and it was WordPress’s fault.

I had a normal, old-style text widget, containing a set of links, and within each link was a FontAwesome icon tag, so that when the widget displayed on the site, you would see a set of icons, each one linking to a different URL.

After upgrading the site to WordPress 4.8, I wanted to remove one of the icons from the widget. So I went to Admin > Appearance > Widgets as normal, and lo and behold, the text widget had now converted into a WYSIWYG editor widget (though still very misleadingly called a text widget), as was announced in the WordPress 4.8 release notes. I was aware that this would be the case…

However, on visual mode, the widget showed no content at all (because I had not needed to enqueue FontAwesome for WordPress admin in my theme files), and on switching to text mode, the link tags had been somehow stripped, leaving just the <i> tags of the FontAwesome icons.

Yes, WordPress destroyed my content.

I immediately installed the new third party Classic Text Widget but still had to rebuild the link tags for each icon.

Thinking about this, the ONLY way I could have recovered the full content of my old text widget would have been to go into the database and extract the serialised content from the options table before loading the admin widget screen.

This is not acceptable, and I don’t think I need to say that WordPress should have left the normal text widget as it was and created a separate WYSIWYG widget with a new name instead. What happened to the backward compatibility that they’re always bleating about?

This is WordPress’s first backward step in quite a while, but jeez it’s a big one. Someone in the WordPress core team seriously messed up and they should be called out on their idiotic decision.

So beware: if you’re a heavy text widget user, and you use them for HTML markup precisely because they don’t mess with it, WordPress 4.8 will try to break your sites. I would advise getting used to extracting the serialised widget instance content directly from your databases and then converting them all to Classic Text Widgets. You may also need to edit your CSS since the Classic Text Widget has a different class to the old text widget.

Share Button
Facebook Comments
Spread the love

Posted by News Monkey