To use the SEO API, import wixSeoFrontend
from the wix-seo-frontend
module:
import wixSeoFrontend from "wix-seo-frontend";
Gets the page's SEO-related link tags.
Use the links
property to get a page's SEO-related link tags which provide additional
SEO information about your page. For example, the tags may contain a link to a canonical
or alternate version of the current page.
Note:
You should always invoke the wixSeoFrontend.links
getter outside of the onReady()
event handler to
ensure receiving the proper response.
import wixSeoFrontend from "wix-seo-frontend";
// ...
let links = wixSeoFrontend.links;
/* links:
*
* [
* {
* "rel": "canonical",
* "href": "http://mysite.com/canonical_version"
* }, {
* "rel": "author",
* "href": "http://mysite.com/janedoe"
* }
* ]
*/
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.
import wixSeoFrontend from "wix-seo-frontend";
// ...
let metaTags = wixSeoFrontend.metaTags;
/* metaTags:
*
* [
* {
* "name": "robots",
* "content": "noindex"
* }, {
* "property": "og:image",
* "content": "wix:image://v1/6...2.jpg/a.jpg#originWidth=970&originHeight=120"
* }
* ]
*/