Is there any tool or API that might help me remove a bunch of duplicate blocks from a large number of courses?
We used templates to generate courses recently but, for reasons we haven't yet figured out, a number of the courses have two copies of blocks like "Upcoming events" and "Recent activity" while it only makes sense for them to have one. I am wondering if there is a tool that can help me weed these out programmatically. I've looked at moosh and while it can add blocks, it cannot remove them. I'd be interested if there is a PHP API for removing blocks or a good way to do it via database queries (currently my best guess).
We are on Moodle 3.8.2