Change Views Display Title Programatically I had a similar question recently, related to changing the path on a Views Display. Following this reasoning (as well as other examples I've seen), I assumed I could follow a similar approach. Unfortunately, that doesn't seem to be the case.

Related question for reference: Change Views Path Programatically

What I currently have:

$view = \Drupal\views\Entity\View::load('custom_view');
$display =&amp; $view-&gt;getDisplay('page_1');
$display['display_options']['title'] = 'My Custom Title';
$view-&gt;save();


However, this does not seem to alter the title of the Display. I've attempted a method of changing the Display title in a Views hook, at that works correctly, but I'd like to be able to change the title without relying on actually viewing the View to utilize its hooks. In addition, I believe this would set the title for all Displays, which I don't want. Working example:

function my_moudule_views_post_render(ViewExecutable $view) {
    $view-&gt;setTitle('My Custom Title');
}


Following this approach, I attempted to utilize the \Drupal\views\Views::getView() method, but was unsuccessful.
Your code is working I believe, but it could be that "page_1" is not the correct page variant name...I had to use 'default', that was what I ran into when creating a test View and attempting to try your code out... in my case to verify, I enable kint, do a ksm($view) and check the 'display' array to verify the variants. You may need to alter 'default' to see the intended results. Also make sure to cache rebuild just in case drush cr afterwards, you may want to programmatically empty the cache bin for this View depending on the use case.

Also, you mentioned the hook affecting all the Views. That is true, but you could add some more granular logic to the hook to make it only affect specific View, by specifically drilling down to the ID (the 'machine name" in the Views GUI) and performing logic only if the machine name matches, e.g. if my View machine name is "foobar_view_custom", then you can do:

/**
 * Implements hook_views_post_render().
 */
function mymodule_views_post_render(ViewExecutable $view, &amp;$output, CachePluginBase $cache)
{
  $display = $view-&gt;getDisplay();
  $id = $display-&gt;display['id'];
  if ($id === "foobar_view_custom") {
    $view-&gt;setTitle("PROGRAMMATICALLY CHANGED");
  }

}


The difference here is you are altering the actual data in the database for the title of the View entity in your first implementation, versus in the hook, it would only change it during rendering, so really depends on use case (if the title was dynamic based on date or something, the hook might be better. Long term alteration, like in an update hook or something, probably would want to alter the actual data with the entity method) Both implementations should cache just fine.