Working with XPaths
XPaths are expressions that identify elements on a web page. For example, //img selects all <img> elements.
If you are more familiar with CSS selectors than XPath, refer to this CSS-to-XPath conversion table.
The table below lists common XPath patterns you can adapt for your own site:
| XPath | Description |
|---|---|
//h1 | Selects all <h1> elements. |
//div[@id="main"] | Selects the <div id="main"> element. Useful for restricting indexing to a specific page region and excluding footers or sidebars. |
//p[contains(@class,"notes")] | Selects <p> elements whose class includes notes, e.g. <p class="something notes whatever">. |
//img[contains(@class,"main-image")]//@src | Selects the src attribute of <img> elements whose class includes main-image. Use this to tell the crawler which image to index for a page. |
Control what content is indexed
The SS360 crawler automatically identifies titles, images, and content for your search results. When the defaults do not match your site's structure, you can fine-tune indexing by pointing the crawler to specific content blocks or excluding unwanted ones.
Configure indexing rules in two places:
- Crawler settings — site-wide rules
- Result Groups — rules scoped to individual result groups (if you use result grouping)
Define XPaths with XPath Helper
-
Install the XPath Helper Chrome extension.
-
Go to a page on your website and click the XPath Helper icon in the browser toolbar to open the black overlay panel.
-
Hold Shift and hover over elements on the page. The extension highlights each element in yellow and shows the corresponding XPath in the QUERY field. The RESULTS field previews the matched content.

-
Shorten the generated XPath to make it more general. Two common approaches:
- Remove from the end to match more child nodes.
- Remove from the front to broaden the match — when shortening from the front, the expression must start with
//.
A good shortening target is any element that has an
idattribute. You can drop everything before it and start the XPath there.Example:
/html/body[@id='body']/main/section[@class='u-pb-xxl u-pb-xl--sm']/article[@class='flex container'][1]/div[@class='main-feature__content col-6 col-12-sm']Shortened to:
//*[@id='body']//div[contains(@class,'main-feature__content')] -
Copy the XPath into the SS360 control panel under Data Structuring → Content Extraction and paste it into the appropriate field (see the next section for field descriptions).
-
Click Test and enter a page URL to verify the result. You can also use Index Single URL to preview everything that will be extracted from a page at once.
Content Extraction XPath fields
Configure all fields under Data Structuring → Content Extraction. Enter one XPath per line.
Title XPaths
Points the crawler to the main title of each page. The default is //h1.
Other common values:
//title— uses the HTML<title>tag//h2— useful when pages do not have an<h1>
Title Regular Expression gives you additional control over the extracted title string. For example, if every page title includes a brand suffix:
<title>Working with XPaths – Site Search 360</title>
Set Title XPath to //title and Regular Expression to ([^–])+. The crawler then uses only the part before the –, dropping – Site Search 360.

Image XPaths
Points the crawler to the main image on a page. Matched images are shown as thumbnails in search results.
Leave this field empty if the crawler's default image detection works for your site. To target a specific image:
//img[@id='main']/@src
For lazy-loaded images, target the data-src attribute instead:
//div[@class='product-detail-images']//img/@data-src
To prevent any images from being indexed, toggle Extract Images off. Alt texts and captions can still be indexed separately.
Default Image XPath
Specifies a fallback image to use when no other image is found on a page. Example:
//img[@id='logo']/@src
Include Content XPaths
Restricts indexing to specific content blocks. Leave empty to index everything.
Exclude Content XPaths
Tells the crawler to ignore specific content blocks. Leave empty to index everything.
Search Snippet XPath
Located under Search Settings → Search Snippet → Use content behind search snippet XPath.
By default, SS360 shows content surrounding the matched search terms. A common alternative is to use page meta descriptions instead. The field is pre-filled with:
//meta[@name="description"]/@content
To switch to meta descriptions, go to Search Settings and update the Search Snippet Source.
