afterSitemap( )


Registers a hook that is called after a sitemap is created.

The afterSitemap hook is a data binding router hook that is triggered after a sitemap is created for the specified router.

The afterSitemap() function is not a function that you call from your code. You define the function in a file named routers.js in the Code File's Backend section of the Velo Sidebar. The function is called as described above.

Use this hook to revise the list of pages in your sitemap. For example, you can add a search page's information to your sitemap.

The function returns an array of WixRouterSitemapEntry objects. Typically the returned array is a modified version of the one the function received.

If the function does not return a WixRouterSitemapEntry array, the array received as the sitemapEntries parameter acts as the router's effective sitemap entries.

Method Declaration
Copy
Method Parameters

The sitemap request.


sitemapEntriesArray<WixRouterSitemapEntry>Required

The generated sitemap entries.

Returns
Return Type:Promise<Array<WixRouterSitemapEntry>>
Did this help?