Change Views Path Programatically
In Drupal 8 the configuration of a View is stored in an entity, which you can load, modify and save:

use Drupal\views\Entity\View;

  $view = View::load('custom_view');
  $display =&amp; $view-&gt;getDisplay('page_1');
  $display['display_options']['path'] = 'example/path';
  $view-&gt;save();