Add human readable keywords to page URLs
-
- UpdatedAug 3, 2023
- 4 minutes to read
- Vancouver
- Service Portal Designer
Add human readable keywords to the URLs of portal pages to improve search engine optimization (SEO) and click-through rates and help users understand what to expect on the page.
Before you begin
Role required: sp_admin or admin
About this task
Human readable keywords are added to URLs in the following format:
https://<instance>/<portal suffix>/<guest language>/<keywords>?id=<page id>&<page parameters>
Keywords can be populated using static content or dynamic page variables and can include a single slash (/). Dynamic page variables load keywords that are based on data in a record. The page parameters in the URL specify which record to use. In the following examples, the category and short description of a knowledge article and the category and name of a catalog item are added as keywords:
- https://<instance>/kb/en/faq/what-is-a-cookie?id=kb_article_view&sysparm_article=KB0000007
- https://<instance>/sp/es/hardware/developer-laptop-mac?id=sc_cat_item&sys_id=774906834fbb4200086eeed18110c737
Procedure
Result
If users access the page using the URL without human readable keywords, the page URL is updated in one of the following ways:
- On the initial page load by a guest user, the page redirects to the human readable URL.
- On the initial page load by an authenticated user, the URL is updated to include the human readable keywords without redirection.
- On subsequent page loads for all users, the URL is updated to include the human readable keywords without redirection.
Example: Knowledge article page with human readable keywords in the URL
In this example, the kb_article_view page displays knowledge article KB0000007. The knowledge article record has the following fields and values:
- Category is FAQ
- Short description is What is a cookie?
The page has been configured to add keywords based on these field values to the URL using dynamic page variables such as %category/%short_descr. The question mark in the short description isn’t an allowed character in the URL keywords so it’s automatically removed from the URL. The question mark that is in the URL is the query parameter that's always included before the page ID.
The URL that is displayed in the browser appears as: http://<instance>.com/kb/en/faq/what-is-a-cookie?id=kb_article_view&sysparm_article=KB0000007.
What to do next
For pages that have canonical URLs, you must include the human readable keywords in the canonical URL. In the SEO script include that returns canonical URLs for pages, use one of the getHumanReadableUrl methods in the SPSEOUtilsSNC class to return the human readable keywords in page URLs and include them in the canonical URLs.
For more information about including human readable keywords in canonical URLs, refer to the following resources:
Related Content
- Create and edit a page using the Service Portal Designer
Create or edit a page and use layouts to organize the columns that house the widgets.
- Page navigation in Service Portal by URL
You can navigate to a portal or a page in Service Portal using a URL.