Search.../

routerSitemap( )

Returns the sitemap for a router or dynamic page prefix.

Description

The routerSitemap() function returns a Promise that resolves to a list of WixSitemapEntry objects. Each WixSitemapEntry includes information about a page, such as its URL, title, and name.

A sitemap is used by search engines to find the links to the site's pages.

Syntax

function routerSitemap(routerPrefix: string): WixRouterSitemapEntry

routerSitemap Parameters

NAME
TYPE
DESCRIPTION
routerPrefix
string

The prefix of the router to get the sitemap for.

Returns

Fulfilled - A list of sitemap entries. Rejected - The error that caused the rejection.

Return Type:

Promise<Array<WixRouterSitemapEntry>>

Was this helpful?

Get the sitemap for a prefix

Copy Code
1import wixSiteFrontend from 'wix-site-frontend';
2
3// ...
4
5wixSiteFrontend.routerSitemap("routerPrefix")
6 .then( (routerSitemap) => {
7 const sitemap = routerSitemap;
8 } );
9
10/*
11 * sitemap:
12 *
13 * [
14 * {
15 * "url": "Ash",
16 * "lastModified": null,
17 * "changeFrequency": "",
18 * "priority": null,
19 * "title": "Ash Stowe",
20 * "pageName": "Ash's Page"
21 * },
22 * {
23 * "url": "Aiden",
24 * "lastModified": null,
25 * "changeFrequency": "",
26 * "priority": null,
27 * "title": "Aiden Johnson",
28 * "pageName": "Aiden's page"
29 * },
30 * {
31 * "url": "Jess",
32 * "lastModified": null,
33 * "changeFrequency": "",
34 * "priority": null,
35 * "title": "Jess White",
36 * "pageName": "Jess's page"
37 * },
38 * {
39 * "url": "Morgan",
40 * "lastModified": null,
41 * "changeFrequency": "",
42 * "priority": null,
43 * "title": "Morgan James",
44 * "pageName": "Morgan's Page"
45 * }
46 * ]
47 */