[wp-hackers] Re: Delete/Clear Widgets in Database

scribu at gmail.com scribu at gmail.com
Wed Dec 24 11:48:16 GMT 2008


You could just write

update_option('sidebars_widgets', NULL);

On 12/24/08, Nathan Rice <ncrice at gmail.com> wrote:
> Figured it out on my own.  Here's what I added:
> $null = null;
> update_option('sidebars_widgets',$null);
>
> It clears out all active widgets ... gives you a clean slate.
>
> Nathan
>
>
> On Tue, Dec 23, 2008 at 10:28 PM, Nathan Rice <ncrice at gmail.com> wrote:
>
>> I have several widgetized sections in a particular theme, and I'm looking
>> for a way to clear out all the widgets placed into the sections in 1
>> swoop.
>> Is there a single line I can place in my functions.php file that will
>> basically take all the widgets currently placed into widget sections and
>> remove them?
>>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


-- 
http://scribu.net


More information about the wp-hackers mailing list