> 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 # UpdateSeoUserConfig # Package: seo # Namespace: SeoUserConfigService # Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/seo/seo-user-config/update-seo-user-config.md ## Introduction Updates the SEO configuration for the current site. Each time the SEO configuration is updated, `revision` increments by 1. The current `revision` must be passed when updating the SEO configuration. This ensures you're working with the latest SEO configuration and prevents unintended overwrites. --- ## REST API ### Schema ``` Method: updateSeoUserConfig Description: Updates the SEO configuration for the current site. Each time the SEO configuration is updated, `revision` increments by 1. The current `revision` must be passed when updating the SEO configuration. This ensures you're working with the latest SEO configuration and prevents unintended overwrites. URL: https://www.wixapis.com/v1/seo-user-config Method: PATCH # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: seoUserConfig, seoUserConfig.revision 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: 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. | 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` - 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. Return type: UpdateSeoUserConfigResponse - name: seoUserConfig | type: SeoUserConfig | description: Updated 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. ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.seo.SeoUserConfigService.updateSeoUserConfig(seoUserConfig) Description: Updates the SEO configuration for the current site. Each time the SEO configuration is updated, `revision` increments by 1. The current `revision` must be passed when updating the SEO configuration. This ensures you're working with the latest SEO configuration and prevents unintended overwrites. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: seoUserConfig, seoUserConfig.revision 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: 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. | 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` - 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. 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 ### updateSeoUserConfig ```javascript import { seoUserConfig } from '@wix/seo-user-config'; async function updateSeoUserConfig(seoUserConfig) { const response = await seoUserConfig.updateSeoUserConfig(seoUserConfig); }; ``` ### updateSeoUserConfig (with elevated permissions) ```javascript import { seoUserConfig } from '@wix/seo-user-config'; import { auth } from '@wix/essentials'; async function myUpdateSeoUserConfigMethod(seoUserConfig) { const elevatedUpdateSeoUserConfig = auth.elevate(seoUserConfig.updateSeoUserConfig); const response = await elevatedUpdateSeoUserConfig(seoUserConfig); } ``` ### updateSeoUserConfig (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 updateSeoUserConfig(seoUserConfig) { const response = await myWixClient.seoUserConfig.updateSeoUserConfig(seoUserConfig); }; ``` ---