Hide contextual filter parameter from view url I'm using Views to create a view which shows list of contents. The requirements of the view is something like this: 


The page display url must be /mycontents
The contents must be filtered by current user(The content's author must be current user).


And what I did: 


Set Page settings &gt; Path to /mycontents 
In Advanced > Contextual Filters , add Authored by  
In the contextual filter's When the default value is not in the url section, checked Provide default value and selected User ID from logged in user.


The problem is that after saving the view, the actual url of the view becomes /mycontens/{uid}. Is there any way to remove the {uid} from the path?
I don't think this is possible if you show the view as a page, but you might be able to solve the problem by creating a custom route and rendering the view on that page, where you fetch the uid programatically.

You must do something like this in your Controller:

$user_id = 1;
$args = [$user_id];
$view = Drupal\views\Views::getView('my_view_id');
if (is_object($view)) {
  $view-&gt;setArguments($args);
  $view-&gt;setDisplay('page');
  $view-&gt;preExecute();
  $view-&gt;execute();
  return $view-&gt;buildRenderable('page', $args);
}