Best practice is that every page on a website be unique and have a unique topic, Title, URL (Universal Resource Locator) and menu label. However, the numerous varied but similar degrees, programs or sub-units within the department or annually recurring events may mirror each other resulting in Title, URL or menu label duplication. There are a number of issues this may cause and some recommended strategies.
On this page:
- Duplicate URL
- Duplicate Menu Labels That Link to Different Pages
- Duplicate Menu Labels That Link to the Same Page
- Multiple Pages with the Same Title
- Recommendations
Duplicate URL
Obviously, you can’t have the same URL go to two places. If you accidentally create a page with the same Title as a page that already exists and you allow the Automatic URL Alias to be created, Drupal will add a version number, a dash followed by a number (-#), to the end of the path.
Solution:
If this happens and you then realize that the page already exists, you may want to manually merge the content, delete the duplicate and remove the version number from the path by using a Custom URL Alias. To correct a URL path always follow best practices for changing URLs.
Duplicate Menu Labels That Link to Different Pages
It’s a general best practice and required for accessibility to have contextually relevant links that set a clear expectation of where the link will go. Clickable text on your page, including the labels in the menu, should be unique and relevant to the context and clearly identify the target of the link. Learn more about the importance of unique clickable text.
Solution:
Then learn how to add non-visible text to your links, including menu items.
Duplicate Menu Labels That Link to the Same Page
There is absolutely nothing wrong with putting the same page in more than one place in the menu! In fact it can be very helpful. In this case the label text for the item can be the same, but it doesn’t have to be. For different audiences who need the same information, it may be advisable to use different key words in your link text, and that is just fine.
Wrong Menu Trails
The Drupal menu system requires a page to “live” in a specific place in the navigation in order to display the menu trail. It will display visually with parent items highlighted and should have a specific page that is its’ parent all the way to the top-level items. If it has sub-navigation items, they are its’ specific child navigation items.
When you try to place a page in 2 places in the navigation, sometimes Drupal won’t cooperate. No matter what you do, how many times you set and re-set the menu items, for some reason it will not display in the right hierarchy.
Solution:
For the additional menu item, the one that is not in the normal parent child hierarchy of the menu system, add it with a path that is the absolute URL in the Main Menu Navigation interface. Absolute paths, include the the “https://” and root part of the address.
Normally, we want to avoid absolute paths to other pages within the same site. On the test version of the site these will link to the live site. We have actually thought we were on the test site and done some test work because we clicked on a path that took us to the live site and we didn’t realize it. Also, if the root url for the site ever changes this link will be broken.
Multiple Pages with the Same Title
Search Engine Optimization best practices recommend that you give each page a unique contextually clear title tag in the header. This is the title used by search results and when sharing. By default the title tag for a page is the content entered into the “Title” field on the Content Type creation form.
Google and other search engines rank pages higher in search results that clearly march the search query. Having more than one page with the same title can be very confusing for search results.
Solutions:
- If your content strategy requires several pages to display with the same H1, you can use the H1 Hero Block type that will allow you to use a different H1 on your page than than the text entered in the Title field.
- For annually recurring events, we recommend updating the past items to change the Title, perhaps to include the year. You may also want to change the URL, see Duplicate URL above.
Recommendations
Make sure the link text and menu items are functioning as expected by conducting usability testing. If the context is not clear it may be a barrier to all visitors, not just those using assistive technology. Always consider best practices for link text and appearance.