> 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

# GetSeoPattern

# Package: seo

# Namespace: PageTypeSeoPatternsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/seo/seo-pattern-v1/get-seo-pattern.md

## Permission Scopes:
View SEO Settings: SCOPE.PROMOTE.VIEW-SEO

## Introduction

Retrieves the SEO pattern in effect for a page type.

The response contains the site's own pattern in `pattern`, and the pattern Wix
provides in `defaultPattern`. `source` reports which of the two is in effect.
`pattern` is empty when the site has no pattern of its own.

---

## REST API

### Schema

```
 Method: getSeoPattern
 Description: Retrieves the SEO pattern in effect for a page type.  The response contains the site's own pattern in `pattern`, and the pattern Wix provides in `defaultPattern`. `source` reports which of the two is in effect. `pattern` is empty when the site has no pattern of its own.
 URL: https://www.wixapis.com/promote/seo/v1/seo-patterns/{pageType}
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  pageType
 Method parameters: 
   query param name: pageId | type: pageId | description: GUID of a single page built from a Wix Data collection, to retrieve the pattern of that page alone.  Supported only for the `WIX_DATA_PAGE_ITEM` page type.  | validation: maxLength 200
   param name: pageType | type:   none | required: true 
 Return type: GetSeoPatternResponse
  - name: seoPattern | type: SeoPattern | description: The page type's pattern: the site's own pattern, the Wix default, and which of the two is in effect.  
     - name: id | type: string | description: SEO pattern GUID, in the format `{pageType}`.  For a pattern that applies to a single page built from a Wix Data collection, the format is `{pageType}:{pageId}`.  | read-only: true | validation: maxLength 400
     - name: pageType | type: string | description: Page type the pattern applies to. For example, `STATIC_PAGE`, `BLOG_POST`, or `STORES_PRODUCT`.  | read-only: true | validation: maxLength 100
     - name: pageId | type: string | description: GUID of a single page built from a Wix Data collection, when the pattern applies to that page alone rather than to the whole page type.  Supported only for the `WIX_DATA_PAGE_ITEM` page type.  | validation: maxLength 200
     - name: pattern | type: SeoPatternBlob | description: The site's own pattern for the page type, which takes precedence over the Wix default.  Empty when the site has no pattern of its own, in which case `defaultPattern` applies.  
        - name: tags | type: array<Tag> | description: The pattern's SEO tag templates.  A tag may reference only the variables the page type offers. Call [List SEO Pattern Variables](https://dev.wix.com/docs/api-reference/business-management/seo/seo-pattern-v1/list-seo-pattern-variables.md) for the page type to retrieve them.  A tag whose `disabled` or `custom` value is itself a variable is returned with that value unset, because those fields are booleans. The behavior still applies when the page renders.  | validation: maxItems 100
           - name: type | type: string | description: SEO tag type.   Supported values: `title`, `meta`, `script`, `link`.  
           - name: props | type: object | description: A `{"key": "value"}` pair object where each SEO tag property (`"name"`, `"content"`, `"rel"`, `"href"`) contains a value. For example: `{"name": "description", "content": "the description itself"}`.  
           - name: meta | type: object | description: SEO tag metadata. For example, `{"height": 300, "width": 240}`.  
           - name: children | type: string | description: SEO tag inner content. For example, `<title> inner content </title>`.  
           - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages) — i.e. an entry from the site's Advanced/Custom Tags list.  This flag is scoped to that feature only. It is NOT an indicator of whether a standard tag (`title`, `description`, Open Graph, etc.) reflects a manually configured value versus a computed default/pattern — standard tags always resolve with `custom: false`, even when their content comes from a page's manually saved SEO title/description override. Don't use this field to verify whether a live page reflects a manual per-page SEO edit.  Limitation: when `ResolveStaticPageSeoTags` is called without `seoData`, the per-page SEO data is read only from the Vibe/Wix-managed-headless override store. That store holds nothing for classic Wix Editor or Wix Studio pages, so even genuine Advanced/Custom Tags saved on those pages are missing from the response entirely — there, `false` means this API could not tell, not that no custom tag exists. Pass `seoData` explicitly to resolve against a known set of tags.  
           - name: disabled | type: boolean | description: Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines.  
     - name: defaultPattern | type: SeoPatternBlob | description: The pattern Wix provides for the page type, which applies whenever the site has no pattern of its own.  Always returned, so you can see what a reset would restore.  | read-only: true 
     - name: source | type: PatternSource | description: Which pattern is in effect for the page type: the site's own, or the Wix default.  | read-only: true 
         - enum:
         -     PATTERN_SOURCE_UNSPECIFIED: Unknown source.
         -     PATTERN_SOURCE_USER: The site has a pattern of its own for the page type, returned in `pattern`.
         -     PATTERN_SOURCE_DEFAULT: The site has no pattern of its own for the page type, so the Wix default in `defaultPattern` applies.
     - name: language | type: string | description: Language the pattern applies to, as an IETF BCP 47 language tag. For example, `en-US` for U.S. English.  A page type has a single pattern, so this reports the site's primary language.  | read-only: true | validation: maxLength 100
     - name: origin | type: Origin | description: What made the most recent change to the pattern, for example a Wix user or the site migration flow. Derived from the caller, not from the request.  Reported only on the response to a write, and on the event the write emits. It isn't stored with the pattern, so Get SEO Pattern and List SEO Patterns always report `ORIGIN_UNSPECIFIED`, as does a write by a caller Wix doesn't identify as a specific origin.  | read-only: true 
         - enum:
         -     ORIGIN_UNSPECIFIED: Unknown origin. Returned by read methods, because origin isn't stored alongside the data it describes.
         -     ORIGIN_USER: A user, working in the dashboard or editor, or calling the API on their own behalf.
         -     ORIGIN_MIGRATION: The flow that imports an existing site into Wix.
         -     ORIGIN_AI: An AI agent or an automated suggestion flow.

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: COLLECTION_NAME_NOT_SUPPORTED | Description: A `collectionName` was specified. Resolving a dynamic page by collection isn't supported yet, so specify the page's GUID in `pageId` instead.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PAGE_ID_NOT_SUPPORTED | Description: A `pageId` was specified for a page type that has a single pattern for the whole type. Only `WIX_DATA_PAGE_ITEM` supports a per-page pattern.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: UNSUPPORTED_PAGE_TYPE | Description: Wix doesn't recognize the specified `pageType`. The error message lists the page types that are supported.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: PAGE_TYPE_NOT_ON_SITE | Description: The page type is valid, but the Wix business solution that provides it isn't installed on the site.


```

### Examples

### Retrieve the pattern in effect for a page type
This page type has a pattern of its own, so `source` is `PATTERN_SOURCE_USER`. `defaultPattern` shows what a reset would restore.

```curl
curl -X GET \
'https://www.wixapis.com/seo-metatags-server/v1/seo-patterns/STATIC_PAGE' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.seo.seoPatterns.getSeoPattern(pageType, options)
 Description: Retrieves the SEO pattern in effect for a page type.  The response contains the site's own pattern in `pattern`, and the pattern Wix provides in `defaultPattern`. `source` reports which of the two is in effect. `pattern` is empty when the site has no pattern of its own.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  pageType
 Method parameters: 
   param name: options | type: GetSeoPatternOptions  none  
        - name: pageId | type: string | description: GUID of a single page built from a Wix Data collection, to retrieve the pattern of that page alone.  Supported only for the `WIX_DATA_PAGE_ITEM` page type.  | validation: maxLength 200
   param name: pageType | type: string | description: Page type whose pattern to retrieve. For example, `STATIC_PAGE`, `BLOG_POST`, or `STORES_PRODUCT`. | required: true | validation: maxLength 100
 Return type: PROMISE<GetSeoPatternResponse>
  - name: seoPattern | type: SeoPattern | description: The page type's pattern: the site's own pattern, the Wix default, and which of the two is in effect.  
     - name: _id | type: string | description: SEO pattern GUID, in the format `{pageType}`.  For a pattern that applies to a single page built from a Wix Data collection, the format is `{pageType}:{pageId}`.  | read-only: true | validation: maxLength 400
     - name: pageType | type: string | description: Page type the pattern applies to. For example, `STATIC_PAGE`, `BLOG_POST`, or `STORES_PRODUCT`.  | read-only: true | validation: maxLength 100
     - name: pageId | type: string | description: GUID of a single page built from a Wix Data collection, when the pattern applies to that page alone rather than to the whole page type.  Supported only for the `WIX_DATA_PAGE_ITEM` page type.  | validation: maxLength 200
     - name: pattern | type: SeoPatternBlob | description: The site's own pattern for the page type, which takes precedence over the Wix default.  Empty when the site has no pattern of its own, in which case `defaultPattern` applies.  
        - name: tags | type: array<Tag> | description: The pattern's SEO tag templates.  A tag may reference only the variables the page type offers. Call [List SEO Pattern Variables](https://dev.wix.com/docs/api-reference/business-management/seo/seo-pattern-v1/list-seo-pattern-variables.md) for the page type to retrieve them.  A tag whose `disabled` or `custom` value is itself a variable is returned with that value unset, because those fields are booleans. The behavior still applies when the page renders.  | validation: maxItems 100
           - name: type | type: string | description: SEO tag type.   Supported values: `title`, `meta`, `script`, `link`.  
           - name: props | type: object | description: A `{"key": "value"}` pair object where each SEO tag property (`"name"`, `"content"`, `"rel"`, `"href"`) contains a value. For example: `{"name": "description", "content": "the description itself"}`.  
           - name: meta | type: object | description: SEO tag metadata. For example, `{"height": 300, "width": 240}`.  
           - name: children | type: string | description: SEO tag inner content. For example, `<title> inner content </title>`.  
           - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages) — i.e. an entry from the site's Advanced/Custom Tags list.  This flag is scoped to that feature only. It is NOT an indicator of whether a standard tag (`title`, `description`, Open Graph, etc.) reflects a manually configured value versus a computed default/pattern — standard tags always resolve with `custom: false`, even when their content comes from a page's manually saved SEO title/description override. Don't use this field to verify whether a live page reflects a manual per-page SEO edit.  Limitation: when `ResolveStaticPageSeoTags` is called without `seoData`, the per-page SEO data is read only from the Vibe/Wix-managed-headless override store. That store holds nothing for classic Wix Editor or Wix Studio pages, so even genuine Advanced/Custom Tags saved on those pages are missing from the response entirely — there, `false` means this API could not tell, not that no custom tag exists. Pass `seoData` explicitly to resolve against a known set of tags.  
           - name: disabled | type: boolean | description: Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines.  
     - name: defaultPattern | type: SeoPatternBlob | description: The pattern Wix provides for the page type, which applies whenever the site has no pattern of its own.  Always returned, so you can see what a reset would restore.  | read-only: true 
     - name: source | type: PatternSource | description: Which pattern is in effect for the page type: the site's own, or the Wix default.  | read-only: true 
         - enum:
         -     PATTERN_SOURCE_UNSPECIFIED: Unknown source.
         -     PATTERN_SOURCE_USER: The site has a pattern of its own for the page type, returned in `pattern`.
         -     PATTERN_SOURCE_DEFAULT: The site has no pattern of its own for the page type, so the Wix default in `defaultPattern` applies.
     - name: language | type: string | description: Language the pattern applies to, as an IETF BCP 47 language tag. For example, `en-US` for U.S. English.  A page type has a single pattern, so this reports the site's primary language.  | read-only: true | validation: maxLength 100
     - name: origin | type: Origin | description: What made the most recent change to the pattern, for example a Wix user or the site migration flow. Derived from the caller, not from the request.  Reported only on the response to a write, and on the event the write emits. It isn't stored with the pattern, so Get SEO Pattern and List SEO Patterns always report `ORIGIN_UNSPECIFIED`, as does a write by a caller Wix doesn't identify as a specific origin.  | read-only: true 
         - enum:
         -     ORIGIN_UNSPECIFIED: Unknown origin. Returned by read methods, because origin isn't stored alongside the data it describes.
         -     ORIGIN_USER: A user, working in the dashboard or editor, or calling the API on their own behalf.
         -     ORIGIN_MIGRATION: The flow that imports an existing site into Wix.
         -     ORIGIN_AI: An AI agent or an automated suggestion flow.

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: COLLECTION_NAME_NOT_SUPPORTED | Description: A `collectionName` was specified. Resolving a dynamic page by collection isn't supported yet, so specify the page's GUID in `pageId` instead.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PAGE_ID_NOT_SUPPORTED | Description: A `pageId` was specified for a page type that has a single pattern for the whole type. Only `WIX_DATA_PAGE_ITEM` supports a per-page pattern.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: UNSUPPORTED_PAGE_TYPE | Description: Wix doesn't recognize the specified `pageType`. The error message lists the page types that are supported.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: PAGE_TYPE_NOT_ON_SITE | Description: The page type is valid, but the Wix business solution that provides it isn't installed on the site.


```

### Examples

### Retrieve the pattern in effect for a page type
This page type has a pattern of the site's own, so `source` is `PATTERN_SOURCE_USER`.

```javascript
import { seoPatterns } from "@wix/seo";

async function getSeoPattern() {
  const response = await seoPatterns.getSeoPattern("STATIC_PAGE");
  return response;
}

/* Promise resolves to:
 * {
 *   "seoPattern": {
 *     "pageType": "STATIC_PAGE",
 *     "pattern": {
 *       "tags": [
 *         {
 *           "type": "title",
 *           "children": "{{page.name}} | {{site.name}}",
 *           "custom": false,
 *           "disabled": false
 *         },
 *         {
 *           "type": "meta",
 *           "props": { "name": "description", "content": "{{page.name}} at {{site.business.name}}." },
 *           "children": "",
 *           "custom": false,
 *           "disabled": false
 *         }
 *       ]
 *     },
 *     "defaultPattern": {
 *       "tags": [
 *         {
 *           "type": "title",
 *           "children": "{{page.name}} | {{site.name}}",
 *           "custom": false,
 *           "disabled": false
 *         }
 *       ]
 *     },
 *     "source": "PATTERN_SOURCE_USER",
 *     "origin": "ORIGIN_UNSPECIFIED",
 *     "_id": "STATIC_PAGE"
 *   }
 * }
 */

```

### getSeoPattern (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 { seoPatterns } from '@wix/seo';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { seoPatterns },
  // Include the auth strategy and host as relevant
});


async function getSeoPattern(pageType,options) {
  const response = await myWixClient.seoPatterns.getSeoPattern(pageType,options);
};
```

---