2

Drush for Drupal 6 had a plugin that allowed you to delete a view. That plugin's functionality was mostly rolled into drush for Drupal 7.

I have a view that can't be edited through the UI, and I was hoping the drush could solve the problem.

4

I don't know of a Drush command for this, but if you know your view's machine name or ID wiping it from the database isn't too hard.

SELECT vid FROM views_view WHERE name = 'your_views_machine_name';
DELETE FROM views_view WHERE vid = id_from_above;
DELETE FROM views_display WHERE vid = id_from_above;

That should be the last you ever hear from that view.

  • Make sure you also run drush cc views after you've run these queries, to clear the views cache. – Justin Feb 12 '15 at 21:53
0

Drush Views has not been fully incorporated in Views for D7 yet, supposidely only drush views-export works at this time. And, I couldnt get even that to work.

0

Or without doing a lookup for vid. Find the view id in the url, or html code.

For example in admin/structure/views/view/section_banner, section_banner is the view name.

delete views_display from views_display inner join views_view on views_display.vid = views_view.vid where views_view.name =  'view_name';
delete from views_view where name = 'view_name';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.