Deleting Branches except protected branches

Hello,

I want to delete branches that have already been merged in my main branch “dev”.
I saw a link that warns us that it will also delete protected branches

I need to be able to delete all branches that were already merged into my main branch “dev”
EXCEPT the protected branches.

Thank you.