Is there a way to delete bone constraints by name? I'm trying to delete all bone constraints containing part of the name 'Action' for selected pose bones. I'm still learning scripting and this is the best I could come up with. Any pointers would be really appreciated!
import bpy    

for bone in bpy.context.selected_pose_bones:
    if 'Action' in pose.bones.constraints.name:
        bpy.ops.pose.constraints_clear()
Delete the constraints with name &quot;Action&quot; or delete the constraints from bone which contain &quot;Action&quot; in bone's name? I will assume the later one in my following answer:


Use bone.constraints.remove(constraint) instead of operator. armature - delete bone constraint in python

Directly use what you get from for loop


import bpy

for bone in bpy.context.selected_pose_bones:
    if 'Action' in bone.name:
        # Iterate over all the bone's constraints and delete them all
        for c in bone.constraints:
            bone.constraints.remove(c)  # Remove constraint


import bpy

for bone in bpy.context.selected_pose_bones:
    for c in bone.constraints:
        if 'Action' in c.name:
            bone.constraints.remove(c)  # Remove constraint