I've been having this issue for a while ive been using widget manager and alot of my profiles have duplicate widgets.
I tried re pin them and un pin them. That just made the duplication worse..
Is their a way I can just delete all widgets then just re add them?
something like:
$content2= elgg_get_entities(array(
"type" => "object",
"subtype" => "widget",
'limit' => 1000));
foreach($content2 as $content){
$widget_guid = $content->guid;
$widget = get_entity($widget_guid);
$widget->delete();
}
I'm to scared to run this... dont want to wipe out something thats needed.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Juho Jaakkola@juho.jaakkola

Juho Jaakkola - 0 likes
- Juho Jaakkola@juho.jaakkola

Juho Jaakkola - 0 likes
- adrew22a@drew22a

adrew22a - 0 likes
You must log in to post replies.Yes, that is a valid way of removing widgets.
However you'll want to remove only the widgets that are in the profile context:
Also, you don't need get_entity() because elgg_get_entities() returns ElggWidget objects.
So you can just do:
Awesome! Thanks Juho!
Im getting this error now. but its been working so far
Fatal error: Unsupported operand types in /home/content/40/11160640/html//mod/elggx_userpoints/start.php on line 293