Remove same modifier from many objects I have been searching on Internet for a while and I only have found this piece of code (from this site)

import bpy

scene = bpy.context.scene
for o in scene.objects:
    if o.type == 'MESH':
    for m in o.modifiers:
        bpy.ops.object.modifier_remove(modifier="Smoke")


But it didn´t work for me. It only removes the modifier from the active object, not for all the objects in the scene.

What am I doing wrong?

Thanks pals.
Many operators work on only the active object and some will work on all selected objects, removing a modifier is a case of only working on the active object, the active object is the one that has it's properties displayed so is the only one with a visible modifier list.

You can delete modifiers without using operators, this way you don't have to change the active object and it also doesn't matter if the modifier has been renamed.

import bpy

scene = bpy.context.scene
for o in scene.objects:
    if o.type == 'MESH':
        for m in o.modifiers:
            if m.type == 'SMOKE':
                o.modifiers.remove(m)