> 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 # CreateSeoUserConfig # Package: seo # Namespace: SeoUserConfigService # Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/seo/seo-user-config/create-seo-user-config.md ## Introduction Creates the SEO configuration for the current site. If a configuration already exists for the site, this method returns an `ALREADY_EXISTS` error. Use [Update Seo User Config](https://dev.wix.com/docs/api-reference/business-management/marketing/seo/seo-user-config/update-seo-user-config.md) to modify an existing configuration. --- ## REST API ### Schema ``` Method: createSeoUserConfig Description: Creates the SEO configuration for the current site. If a configuration already exists for the site, this method returns an `ALREADY_EXISTS` error. Use [Update Seo User Config](https://dev.wix.com/docs/api-reference/business-management/marketing/seo/seo-user-config/update-seo-user-config.md) to modify an existing configuration. URL: https://www.wixapis.com/v1/seo-user-configs Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: seoUserConfig, seoUserConfig.shouldFlattenUrlHierarchy, seoUserConfig.shouldUsePartialRouteMatch Method parameters: param name: seoUserConfig | type: SeoUserConfig | description: Site-level SEO configuration. Controls URL structure and non-existent page behavior to optimize how search engines index and resolve a site's pages. | required: true - name: shouldFlattenUrlHierarchy | type: boolean | description: Whether to flatten page URLs. When `true`, all pages use flat URLs regardless of their position in the page hierarchy. For example, a subpage at `/parent/child-page` is accessible at `/child-page`. When `false`, page URLs reflect the full parent-child hierarchy. This setting only affects URL structure, it doesn't change the physical page hierarchy in the site's page tree. Default: `false` | required: true - name: shouldUsePartialRouteMatch | type: boolean | description: Whether non-existent pages return a `200` status code instead of a `404`. When `false`, requests to non-existent pages return an HTTP `404` status code. This setting is the SEO-recommended behavior that correctly signals missing pages to search engines. When `true`, non-existent page requests return a `200` status code. Avoid this setting unless you have a specific SEO reason, as it prevents search engines from correctly detecting missing pages. Default: `false` for sites created on or after September 1, 2024. `true` for sites created before that date. | required: true Return type: CreateSeoUserConfigResponse - name: seoUserConfig | type: SeoUserConfig | description: Created SEO configuration. - name: id | type: string | description: SEO configuration GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the SEO configuration is updated. To prevent conflicting changes, the current `revision` must be passed when updating the SEO configuration. Ignored when creating an SEO configuration. - name: createdDate | type: string | description: Date and time the SEO configuration was created. - name: updatedDate | type: string | description: Date and time the SEO configuration was last updated. - name: shouldFlattenUrlHierarchy | type: boolean | description: Whether to flatten page URLs. When `true`, all pages use flat URLs regardless of their position in the page hierarchy. For example, a subpage at `/parent/child-page` is accessible at `/child-page`. When `false`, page URLs reflect the full parent-child hierarchy. This setting only affects URL structure, it doesn't change the physical page hierarchy in the site's page tree. Default: `false` - name: shouldUsePartialRouteMatch | type: boolean | description: Whether non-existent pages return a `200` status code instead of a `404`. When `false`, requests to non-existent pages return an HTTP `404` status code. This setting is the SEO-recommended behavior that correctly signals missing pages to search engines. When `true`, non-existent page requests return a `200` status code. Avoid this setting unless you have a specific SEO reason, as it prevents search engines from correctly detecting missing pages. Default: `false` for sites created on or after September 1, 2024. `true` for sites created before that date. ``` ### Examples ### Create SeoUserConfig Creates a SeoUserConfig with basic info ```curl curl -X POST \ 'https://www.wixapis.com/seo-user-config/v1/seo-user-config-entity' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ --data-binary '{ "seoUserConfig": { "lorem": "lorem", "ipsum": "lorem ipsum", "businessAddress": "Pankivska 14a" }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.seo.SeoUserConfigService.createSeoUserConfig(seoUserConfig) Description: Creates the SEO configuration for the current site. If a configuration already exists for the site, this method returns an `ALREADY_EXISTS` error. Use [Update Seo User Config](https://dev.wix.com/docs/api-reference/business-management/marketing/seo/seo-user-config/update-seo-user-config.md) to modify an existing configuration. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: seoUserConfig, seoUserConfig.shouldFlattenUrlHierarchy, seoUserConfig.shouldUsePartialRouteMatch Method parameters: param name: seoUserConfig | type: SeoUserConfig | description: Site-level SEO configuration. Controls URL structure and non-existent page behavior to optimize how search engines index and resolve a site's pages. | required: true - name: shouldFlattenUrlHierarchy | type: boolean | description: Whether to flatten page URLs. When `true`, all pages use flat URLs regardless of their position in the page hierarchy. For example, a subpage at `/parent/child-page` is accessible at `/child-page`. When `false`, page URLs reflect the full parent-child hierarchy. This setting only affects URL structure, it doesn't change the physical page hierarchy in the site's page tree. Default: `false` | required: true - name: shouldUsePartialRouteMatch | type: boolean | description: Whether non-existent pages return a `200` status code instead of a `404`. When `false`, requests to non-existent pages return an HTTP `404` status code. This setting is the SEO-recommended behavior that correctly signals missing pages to search engines. When `true`, non-existent page requests return a `200` status code. Avoid this setting unless you have a specific SEO reason, as it prevents search engines from correctly detecting missing pages. Default: `false` for sites created on or after September 1, 2024. `true` for sites created before that date. | required: true Return type: PROMISE - name: _id | type: string | description: SEO configuration GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the SEO configuration is updated. To prevent conflicting changes, the current `revision` must be passed when updating the SEO configuration. Ignored when creating an SEO configuration. - name: _createdDate | type: Date | description: Date and time the SEO configuration was created. - name: _updatedDate | type: Date | description: Date and time the SEO configuration was last updated. - name: shouldFlattenUrlHierarchy | type: boolean | description: Whether to flatten page URLs. When `true`, all pages use flat URLs regardless of their position in the page hierarchy. For example, a subpage at `/parent/child-page` is accessible at `/child-page`. When `false`, page URLs reflect the full parent-child hierarchy. This setting only affects URL structure, it doesn't change the physical page hierarchy in the site's page tree. Default: `false` - name: shouldUsePartialRouteMatch | type: boolean | description: Whether non-existent pages return a `200` status code instead of a `404`. When `false`, requests to non-existent pages return an HTTP `404` status code. This setting is the SEO-recommended behavior that correctly signals missing pages to search engines. When `true`, non-existent page requests return a `200` status code. Avoid this setting unless you have a specific SEO reason, as it prevents search engines from correctly detecting missing pages. Default: `false` for sites created on or after September 1, 2024. `true` for sites created before that date. ``` ### Examples ### createSeoUserConfig ```javascript import { seoUserConfig } from '@wix/seo-user-config'; async function createSeoUserConfig(seoUserConfig) { const response = await seoUserConfig.createSeoUserConfig(seoUserConfig); }; ``` ### createSeoUserConfig (with elevated permissions) ```javascript import { seoUserConfig } from '@wix/seo-user-config'; import { auth } from '@wix/essentials'; async function myCreateSeoUserConfigMethod(seoUserConfig) { const elevatedCreateSeoUserConfig = auth.elevate(seoUserConfig.createSeoUserConfig); const response = await elevatedCreateSeoUserConfig(seoUserConfig); } ``` ### createSeoUserConfig (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { seoUserConfig } from '@wix/seo-user-config'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { seoUserConfig }, // Include the auth strategy and host as relevant }); async function createSeoUserConfig(seoUserConfig) { const response = await myWixClient.seoUserConfig.createSeoUserConfig(seoUserConfig); }; ``` ---