18 November 2023

There is a function called views_delete_view, that does just that. The only thing is that views_delete_view() function in Drupal 7 takes a view object as its argument, not a machine name.

Source code viewer
  1. $view = views_get_view(your_view_name);
  2. views_delete_view($view);
Programming Language: PHP