Index: /branches/release-38/lib/MT/Object.pm
===================================================================
--- /branches/release-38/lib/MT/Object.pm (revision 2369)
+++ /branches/release-38/lib/MT/Object.pm (revision 2389)
@@ -697,4 +697,5 @@
     my(@args) = @_;
     if (!ref $obj) {
+        $obj->remove_meta( @args ) if $obj->has_meta;
         return $obj->driver->direct_remove($obj, @args);
     } else {
@@ -976,8 +977,33 @@
 sub remove_meta {
     my $obj = shift;
-    return 1 unless ref $obj;
     my $mpkg = $obj->meta_pkg or return;
-    my $id_field = $obj->datasource . '_id';
-    return $mpkg->remove({ $id_field => $obj->id });
+    if ( ref $obj ) {
+        my $id_field = $obj->datasource . '_id';
+        return $mpkg->remove({ $id_field => $obj->id });
+    } else {
+        # static invocation
+        my ($terms, $args) = @_;
+        $args = { %$args } if $args; # copy so we can alter
+        my $meta_id = $obj->datasource . '_id';
+        my $offset = 0;
+        $args->{fetchonly} = [ 'id' ];
+        $args->{join} = [ $mpkg, $meta_id ];
+        $args->{no_triggers} = 1;
+        $args->{limit} = 50;
+        while ( $offset >= 0 ) {
+            $args->{offset} = $offset;
+            if (my @list = $obj->load( $terms, $args )) {
+                my @ids = map { $_->id } @list;
+                $mpkg->driver->direct_remove( $mpkg, { $meta_id => \@ids });
+                if ( scalar @list == 50 ) {
+                    $offset += 50;
+                } else {
+                    $offset = -1; # break loop
+                }
+            } else {
+                $offset = -1;
+            }
+        }
+    }
 }
 
