Skip to main content
2 of 2
added 250 characters in body
oknate
  • 14.5k
  • 4
  • 53
  • 98

Migrate plus migrations are entities: the following code is adapted from MigrationGroup::delete(), where it finds each migration in a group and deletes them:

$migration_to_delete = 'my_rss_importer'; 
$migration = \Drupal::entityTypeManager()
  ->getStorage('migration')
  ->load($migration_to_delete);
$migration->delete();

Note that this calls Cache::invalidateTags(['migration_plugins']), so after a cache clear, it will remove your cached plugins.

oknate
  • 14.5k
  • 4
  • 53
  • 98