Search.../

setTitle( )

Sets the page's title.

Description

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.

Syntax

function setTitle(title: string): Promise<void>

setTitle Parameters

NAME
TYPE
DESCRIPTION
title
string

The title to set.

Returns

Fulfilled - When the title is set.

Return Type:

Promise<void>

Related Content:

Was this helpful?

Set a page's SEO title

Copy Code
1import wixSeoFrontend from 'wix-seo-frontend';
2
3// ...
4
5$w.onReady( () => {
6 wixSeoFrontend.setTitle("New Title")
7 .then( () => {
8 console.log("title set");
9 } )
10 .catch( () => {
11 console.log("failed setting title");
12 } );
13
14} );