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 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

14 Comments

  1. Screwed up a bunch of subscription boxes on client sites. Destroyed formatting and stripped code. I had to revert – thank goodness I had backups!

  2. Yes, there are some heated discussions on this in a couple of Facebook forums as well:

    Advanced WordPress
    https://www.facebook.com/groups/advancedwp/permalink/1529658927096316/

    Genesis WordPress
    https://www.facebook.com/groups/genesiswp/permalink/1534964056554786/

  3. This is just awful. I’m glad to know about it ahead of time at least. So, would this be a reasonable approach? Go through all my sites and assess what, if anything, I have in text widgets. Make a copy of what’s there. Update to 4.8 and assess damage. Install Classic Text Widget and recreate my content as needed using my saved copy. This will take quite a lot of time to go through so many sites and deal with this. Is there ANY chance they will fix this in an upcoming minor release? This makes no sense at all!

  4. Sorry I was a bit slow refining my plugin, which should avoid such grief. It basically reverts the widget https://wordpress.org/plugins/add-paragraphs-option-to-text-widget/ ( with an option to turn on visual editor ONLY is you want it )

  5. https://github.com/gitlost/ye-olde-text-widget

  6. Thanks, explains what happened to me. Such a mess to clean up.

  7. Hi Andy,
    It was nice reading your opinions on the 4.8 update but I must admit I am a bit on the fence with this one. To be sure the new WYSIWYG editor widget didn’t cause conflicts or data loss they could have created a separate widget type.

    The editor for all posts, pages and post types remains the same throughout so it only makes sense that the introduction of HTML enabled widgets follows this design and implementation.

    The issue you faced was due to WordPress stripping empty spans and divs. Whenever I use Bootstrap icons in a widget area I use a shortcode that returns the markup so [icon code=”fa fa-phone fa-3x”] which would return .

    A quick and dirty approach would be to add HTML comments: . I appreciate solutions to the problem you faced are irrelevant now but WordPress could have done things better but before every update they do say to backup your website database and files before proceeding.

  8. Many of the issues are simply due to “forced implemenation of new features.

    I mean any new major feature should be “off” by default, with a toggle to enable.

    Doesn’t take a genius to figure out that this approach is a solution and doesn’t require anything more than a check box.

    If the feature turns out to be without issues, “then” in future versions set to “on” by default.

    Seems to be a lot of hubris in the WordPress core crowd – “you will get my new features and you will like it…”

    Why does it have to be that way?

    +++

    It could be argued, “Well, you are not helping to build out updates and core features and you didn’t test the beta – so who are you to talk bud!”

    Well, geez, historically speaking, if you haven’t learned by now that auto “on” new features in updates are a bad idea, then I don’t know what to say. Add a toggle, with off being the default. How hard could it be…

  9. I completely agree with you….Wordpress screwed up! This has caused me some headaches!

    I’ll be trying out the classic text widget plugin.

    Peace,
    Todd

  10. Thank God…I had backups…! Anyway thanks for the useful information….

  11. This just Screwed up a bunch of subscription boxes on client sites. Destroyed formatting and stripped code. I had to revert – thank goodness I had backups! This makes me remind of how important backups are.

  12. thanks for sharing such a nice post keep it up

  13. Thanks

  14. apparently I’m not the only one that this happened to 😉

Add a Comment

If you have used this form and would like a copy of the information held about you on this website, or would like the information deleted, please email info@zigpress.com.