> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: Add SEO to Your Router ## Article: Add SEO to Your Router ## Article Link: https://dev.wix.com/docs/develop-websites-sdk/code-your-site/build-a-custom-backend/routers/add-seo-to-your-router.md ## Article Content: # Add SEO to Your Router This article demonstrates how to configure [SEO for your router pages](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/build-a-custom-backend/routers/about-routers.md#sitemap). There are 2 parts to setting up the SEO: 1. Create meta tags for Google to learn about your pages. 1. Create a sitemap for Google to use to find your pages. > **Note**: Routers currently require Velo APIs and file naming conventions. While you can use the JavaScript SDK alongside Velo for data operations and logic, router handlers must be defined using Velo syntax in the `routers.js` backend file. ## Step 1 | Set meta tags for router pages To set SEO meta tags for your router's pages: 1. In your `router.js` file, create an object that contains your desired SEO settings inside the `router()` function. This becomes the [`HeadOptions`](https://www.wix.com/velo/reference/wix-router/wixrouterresponse/head) object that you pass to the router page. The sample code below contains several properties that are set using the data it retrieves in the `router()` function, including the following: - The `title` property, which contains the page's SEO title. - The `description` property, which contains a short description of the page's content. - A `noIndex` flag, set to `false`. This tells Google that it should index your page. - Additional meta tags contained in the `metaTags` property. You can add meta tags to this property. ```javascript let seoData = { title: data.title, description: "This is a description of " + data.title + " page", noIndex: false, metaTags: { "og:title": data.title, "og:image": data.image, }, }; ``` Keep or remove these properties, and add your own as needed. > **Note:** The `HeadOptions` object can also contain a `keywords` property, but Google ignores your site's keywords. 2. Specify the `HeadOptions` object as the third parameter in the `ok()` function. This object is then sent to the router page so that Google has SEO information for it. ```javascript return ok("myRouter-page", data, seoData); ``` ## Step 2 | Create the sitemap for your router To add your router pages to your sitemap: 1. In your router's `sitemap()` function, create a [`WixRouterSitemapEntry`](https://dev.wix.com/docs/velo/events-service-plugins/routers/service-plugins/wix-router/wix-router-sitemap-entry.md) object for each URL the router can possibly route to. Each `WixRouterSitemapEntry` in the code example below includes the router page's URL, title, and name. The example groups them into an array. ```javascript let siteMapEntries = Object.keys(peopleData).map((name) => { const data = peopleData[name]; let entry = new WixRouterSitemapEntry(name); entry.pageName = "myRouter-page"; entry.url = "/myRouter/" + name; entry.title = data.title; return entry; }); ``` 2. Return all the sitemap entries to create the router sitemap. For example: ```javascript return Promise.resolve(siteMapEntries); ``` ## Step 3 | Check your router sitemap To ensure that your sitemap is working properly, you can get the sitemap from your published site: 1. In your web browser, go to your published site's URL and append `/sitemap.xml` to it. * For premium sites, if your site's published URL is: `https://mysite.com`, go to: `https://mysite.com/sitemap.xml`. * For free sites, if your site's published URL is `https://username.wixsite.com/site-name`, go to `https://username.wixsite.com/site-name/sitemap.xml`. 2. Check that the sitemap matches the layout of your router pages. ## See also - [Create a router](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/build-a-custom-backend/routers/create-a-router.md) - [About routers](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/build-a-custom-backend/routers/about-routers.md) - [Tutorial: Create dynamic pages with a custom router](https://dev.wix.com/docs/develop-websites-sdk/get-started/tutorials/data/tutorial-create-dynamic-pages-with-custom-router.md)