In admin panel, I create a widget by choosing it's Type, Design Theme and applying the custom widget options. I have not selected any Layout Updates for that widget.

Let's say I have created ten widgets of the same type in the above mentioned way. Now I want to retrieve this collection of widgets and get their custom options. Is there any way to do it?

Refer this link for images.

2 Answers 2


After some thinking and exploring I came up with this solution:


To the experts out there, is there any other way achieve the result other than the one which I used?

  • For me this returns nothing
    – Haris
    Commented Sep 4, 2023 at 5:07

You can use the Widget's model method "getWidgets()" or "getWidgetsArray()" to get all the widgets:


namespace Vendor\Module\Block\Adminhtml\Widget;

use Magento\Widget\Model\Widget;

class Test

    protected $_widget;

    public function __construct(
        Widget $_widget
        $this->_widget = $_widget;

    public function getAllWidgets(): array
        // here you have all the widgets
        $array = $this->_widget->getWidgetsArray();
        return $array;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.