Bulk publish objects

How do I publish multiple objects at once?
We create multiple objects programmatically. After checking the data on the objects manually we want publish all objects at once (instead of opening every object and click “Save & Publish”).
Is there a way to do that?

In the UI you can open objects in a grid view and use batch edit action for the Published field:

Programatically you can set object to be published:

$object->setPublished(true);
$object->save();
1 Like

You can do that either programmatically or through the object grid.
In the grid you have an option to batch update all or selected the objects.

Thanks @mertaivan & @neha
The batch edit option in the grid was what I was looking for - no idea how I missed that.