Drupal: Changing Page Titles and URLs

Summary

Changing the title of a page in Drupal will change the URL and can cause broken links to your web page, so you should be aware of how these elements interact.

Details

In Drupal, four page elements are tied together:

  • title
  • page URL
  • menu listing
  • browser title

Setting the Page Title

When you set the title of a page:

Drupal page title snippet

that title also automatically becomes:

  1. The URL of the page:

    Drupal example URL

  2. The menu listing both in the top and side menus (if the page is included in a menu):

    Drupal example menu Drupal menu example


  3. The title in the tab of the browser:

    Drupal browser tab example

Changing the Page Title

If you change the page title, Drupal will automatically change the URL, as well as the browser title.

  • In some cases, you will want both the title and the URL to change. For example, if a department name changes, you will want the URL to reflect this change.
    • In the college sites ONLY, a redirect is automatically put in place for this URL change.
    • For all other sites, please submit a ticket to Web and Mobile to create a redirect.
  • In other cases you will not need the URL to change, for example if you change the title from Contact to Contact Us.

Items to consider before changing the page title:

  • If the URL changes and you are not using the college build, links to the page may break. These links may be on your own site, on other unh.edu websites or on external sites.
  • Your page rankings in search engines such as Google can be affected by these redirects and broken links.
  • Although your page title has changed, your menu listing will remain the same and can cause confusion if not addressed.

How to change a page title without changing the URL

College sites (and sites using the College build)

  1. Edit the page.
  2. On the right side of the page, click on URL path options. An accordion will display with a checked box for Generate automatic URL alias:

    Drupal URL config example

  3. Uncheck the box. The alias will become active:

    Drupal URL config example

  4. Now change the title in the Title field at the top of the page and save the page.
  5. To change the menu listing, while in Edit mode click on Menu options on the right side of the page:

    Drupal menu config example

  6. Type the new menu listing in the Menu link title This will change the menu listing to match the new title.

Other Sites

  1. Edit the page.
  2. At the bottom of the page, click on URL path settings. A box will display with a checked box for Generate automatic URL alias:

    Drupal URL config example

  3. Uncheck the box. The alias will become active:

    Drupal URL config example

  4. Then change the title in the Title field at the top of the page and save the page. The title will change, leaving the alias the same.
  5. If you want to change the menu listing, at the bottom of the page click on Menu settings:

    Drupal menu config example

  6. Type the new menu listing in the Menu link title This will change the menu listing to match the new title.


Want to learn more?

Additional help on this and other related topics is available during a regularly scheduled Drupal/myPages/Website Tools - Walk-in/Zoom-in Session. More information, including a complete schedule, is available at https://at-training.unh.edu/apps/ssr?action=course&id=288.

Details

Article ID: 1881
Created
Fri 7/19/19 6:25 PM
Modified
Tue 10/29/19 7:29 PM