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.
function title(): Promise<string>;
import { seo } from "@wix/site-seo";
import { createClient } from "@wix/sdk";
import { site } from "@wix/site";
const wixClient = createClient({
host: site.host(),
modules: { seo },
});
// ...
let title = await wixClient.seo.title(); // "Page Title"
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.