How to set or change path to Drupal 8 contact form? Drupal 8 provides two default contact forms: "Personal contact form" and "Website feedback."


While "Personal contact form" is added to each user's profile by default, to "Website feedback" Drupal automatically provides a link to this form from the footer. The path of this link is "contact" by default.
How can I change the path to this contact form, where are those paths generally set and configured?

And by the way, is it possible to change the labels?
I also needed a page at /contact path. With a simple custom module you can change the default routing for the contact forms.

Let's assume custom module is called: example and the new default for the contact forms will be /contactform instead of /contact:

example.services.yml

services:
  example.route_subscriber:
    class: Drupal\example\Routing\RouteSubscriber
    tags:
      - { name: event_subscriber }


src/Routing/RouteSubscriber.php

&lt;?php
// Save this file as `src/Routing/RouteSubscriber.php` in your module directory.

namespace Drupal\example\Routing;

use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;

/**
 * Listens to the dynamic route events.
 */
class RouteSubscriber extends RouteSubscriberBase {
  /**
   * {@inheritdoc}
   */
  public function alterRoutes(RouteCollection $collection) {
    // Change the core's default path for `/contact` so that we can use it as an alias.
    if ($route = $collection-&gt;get('contact.site_page')) {
      $route-&gt;setPath('/contactform');
    }
    if ($route = $collection-&gt;get('entity.contact_form.canonical')) {
      $route-&gt;setPath('/contactform/{contact_form}');
    }
  }
}