Activate Widgets Of Current Users

I want to activate a widget in all my current users sidebars. I think the easiest way to do this is via a SQL query. Could someone help me out as to what I should enter exactly. I suspect it's something like this:

UPDATE wp_#_options ADD widget_friends

  • Andrew
    • Champion of Loops


    It's a bit more complicated than that I'm afraid. The blog option you're looking for is 'sidebars_widgets'. The problem is that it's a serialized array.

    So unless there's a fancy query that can insert an item into a serialized array you'll probably have to code a script that goes through each blog doing the following:
    1) grab 'sidebars_widgets' and unserialize
    2) add your users widget to the array
    3) serialize and update 'sidebars_widgets'

    There's probably a function you could use to add the widget as well. I just tend to grab raw data and manipulate it rather than figuring out how functions work, etc.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.