Introduction

To use the SEO API, import wixSeoFrontend from the wix-seo-frontend module:

Copy
Did this help?


metaTags


metaTagsArray<MetaTag>Read-only

Gets the page's SEO-related meta tags.

The metaTags property retrieves the SEO-related meta tags from the head of the page.

The keys in the returned metaTags objects represent the keys in the tag, while the values in the object represent the values in the tag.

For example:

{ "property": "og:image", "content": "https://.../Wix+logo.jpg" }

Produces:

Note: You should always invoke the wixSeoFrontend.metaTags getter outside of the onReady() event handler to ensure receiving the proper response.

Did this help?

structuredData


structuredDataArray<object>Read-only

Gets the page's structured data.

The structured data on your page helps search engines understand more about your page and your business so they can display a richer snippet of your pages in search results.

Set the structured data with a list of structured data objects in the JSON-LD format as defined by schema.org.

Note: You should always invoke the wixSeoFrontend.structuredData getter outside of the onReady() event handler to ensure receiving the proper response.

Did this help?

title


titlestringRead-only

Gets the page's title.

The title is an important factor that lets search engines determine the topic of a page.

Note: You should always invoke the wixSeoFrontend.title getter outside of the onReady() event handler to ensure receiving the proper response.

Did this help?


setMetaTags( )


Sets the page's SEO-related meta tags.

The setMetaTags() function creates SEO-related meta tags in the head of the page.

The keys in the specified metaTags objects represent the keys in the tag, while the values in the metaTags object represent the values in the tag.

For example:

Copy

Produces:

When setting og:image meta tags, the content can be and external image URL or a Media Manager image URL as described here.

The meta tags you set overwrite any meta tag information set earlier.

Notes:

  • Do not use setMetaTags() to create tags for the title. Use the setTitle() function instead.

  • You should always set the metaTags inside the onReady() event handler to ensure search engines can read it.

Method Declaration
Copy
Method Parameters
metaTagsArray<MetaTag>Required

The meta tags to set.

Did this help?

setStructuredData( )


Sets the page's structured data.

The structured data on your page helps search engines understand more about your page and your business so they can display a richer snippet of your pages in search results.

The structured data you set overwrites any structured data information set earlier.

Note: You should always set the structured data inside the onReady() event handler to ensure search engines can read it.

Method Declaration
Copy
Method Parameters
structuredDataArray<object>Required

List of structured data objects in the JSON-LD format as defined by schema.org.

Did this help?

setTitle( )


Sets the page's title.

Setting a proper title is important to let search engines determine the topic of your page.

Note: You should always set the title inside the onReady() event handler to ensure search engines can read it.

Method Declaration
Copy
Method Parameters
titlestringRequired

The title to set.

Did this help?
  翻译: