Remove a contextual filter programmatically
To remove a contextual filters just set the $args to empty array or unset the desired arguments unset($args[0]) to remove the first argument an so on:
Here is an example to remove all contextual filters:

/**
 * Implements hook_views_pre_view().
 */
function MYMODULE_views_pre_view(&amp;$view, &amp;$display_id, &amp;$args) {
  if ($view-&gt;name == 'some_view') {
    // Remove all filters.
    $args = [];
  }