Search.../

head

Sets or gets the members to be written to the HTML head of the page.

Description

The information you set using the head property, such as links or meta tags. Overwrites any head information set earlier.

The members of the head property value are written to the HTML head for use by browsers and SEO bots.

Type:

HeadOptionsRead & Write
NAME
TYPE
DESCRIPTION
title
string

The page title. Written to the <title> tag.

description
string

Deprecated: Use the new metaTags format instead.

The page description.

keywords
string

Deprecated: Use the new metaTags format instead.

The page keywords.

noIndex
boolean

Deprecated: Use the new metaTags format instead.

Indicates whether to add a meta tag that prevents search engines from indexing the page.

metaTags
Array<MetaTag>

The page's SEO-related meta tags.

The keys in the object represent the keys in the tag and the values in the object represent the values in the tag.

For example:

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

Produces:

<meta property="og:image" content="https://.../Wix+logo.jpg"/>
html | Copy Code

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

Deprecated format: An object with key:value pairs where the key is the meta tag name and the value is the content.

links
Array<Link>

The page's SEO-related link tags, which provide additional SEO information about the page. For example, you can set a link to a canonical or alternate version of the page.

structuredData
Array<Object>

The page's structured data, which helps search engines understand more about the page and your business so they can display a richer snippet of the page in search results.

Was this helpful?

Get the response's head options

Copy Code
1export function myRouter_Router(request) {
2
3 let head = response.head;
4
5/*
6 * {
7 * "title": "A page title",
8 * "metaTags": [
9 * {
10 * "name": "description",
11 * "content": "A page description"
12 * }, {
13 * "name": "keywords",
14 * "content": "Velo Example"
15 * }, {
16 * "name": "robots",
17 * "content": "noindex"
18 * }, {
19 * "name": "og:title",
20 * "content": "The Title"
21 * }, {
22 * "property": "og:image",
23 * "content": "wix:image://v1/6...2.jpg/a.jpg#originWidth=970&originHeight=120"
24 * }
25 * ],
26 * "links": [
27 * {
28 * "rel": "canonical",
29 * "href": "http://mysite.com/somePage.html"
30 * }
31 * ],
32 * "structuredData": [
33 * {
34 * "@context": "http://schema.org",
35 * "@type": "Organization",
36 * "name": "My Organization Name",
37 * "url": "https://www.myorgdomain.com"
38 * }, {
39 * "@context": "http://schema.org",
40 * "@type": "Person",
41 * "email": "mailto:john.doe@somedomain.com",
42 * "jobTitle": "Professor",
43 * "name": "John Doe",
44 * "telephone": "(555) 555-555"
45 * }
46 * ]
47 * }
48 */
Set the response's head options

Copy Code
1export function myRouter_Router(request) {
2
3 let headOptions = {
4 "title": "A page title",
5 "metaTags": [
6 {
7 "name": "description",
8 "content": "A page description"
9 }, {
10 "name": "keywords",
11 "content": "Velo Example"
12 }, {
13 "name": "robots",
14 "content": "noindex"
15 }, {
16 "name": "og:title",
17 "content": "The Title"
18 }, {
19 "property": "og:image",
20 "content": "wix:image://v1/6...2.jpg/a.jpg#originWidth=970&originHeight=120"
21 }
22 ],
23 "links": [
24 {
25 "rel": "canonical",
26 "href": "http://mysite.com/somePage.html"
27 }
28 ],
29 "structuredData": [
30 {
31 "@context": "http://schema.org",
32 "@type": "Organization",
33 "name": "My Organization Name",
34 "url": "https://www.myorgdomain.com"
35 }, {
36 "@context": "http://schema.org",
37 "@type": "Person",
38 "email": "mailto:john.doe@somedomain.com",
39 "jobTitle": "Professor",
40 "name": "John Doe",
41 "telephone": "(555) 555-555"
42 }
43 ]
44 };
45
46 let response.head = headOptions;