onclick="return confirm('Are you sure you want to delete this blog?');">
<?= __('Delete') ?>
</a>
</td>
</tr>
<?php } ?>
</table>
Here we have added another column “Delete” and in the delete link we have used javascript’s confirm dialog.
We will redirect the user to the list page after deleting the blog. So we just need to create the controller file. Please check the readymade Magento 2 Blog Extension
There is nothing much to talk about here because we have seen very similar codes before also. Only thing you have to notice is $model->delete() method. After loading the model we have deleted it with delete() and we have redirected to the list page.