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.
function setTitle(title: string): Promise<void>;
The title to set.
import wixSeoFrontend from "wix-seo-frontend";
// ...
$w.onReady(() => {
wixSeoFrontend
.setTitle("New Title")
.then(() => {
console.log("title set");
})
.catch(() => {
console.log("failed setting title");
});
});
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.