Swiftype is a third-party service you can use to add a search engine to your site.
Note: For the best search experience, we recommend using our Search Block instead of a third-party service.
The steps in this guide include Code Injection and adding advanced code to the Code Block. These are Premium features available in Business and Commerce plans.
Before you begin
- To add a Swiftype search field, your site must be public. Visit Publishing or hiding your site for help updating your settings.
- You can have one Swiftype search field per page. If you add multiple, none will work.
Get the Swiftype install code
Create a search engine and copy the install code in Swiftype:
- Log into your Swiftype account and click Create A New Engine.
- Enter your website URL, and click Verify URL.
- Swiftype will crawl your site and create your search engine, showing the progress along the way.
- Name your search engine and click Create engine.
- Click Complete Setup.
- On the next screen, click Install Search.
- Customize your search field, then click Activate Site Search.
- Copy the install code and save the search field code.
Add the code to your site
In Squarespace, add the code to your site using Code Injection and Code Blocks.
Step 1 - Add the install code to your site's Code Injection
- In the Home Menu, click Settings, click Advanced, then click Code Injection.
- Paste the install code in the Header field.
- Click Save.
Step 2 - Add the search field code to a page
After you add the install code to your site's Code Injection, add the search field code to pages where you want the Swiftype search field to appear:
- Click an insert point and select Code from the Block Menu. For more help with this step, visit Using the Code Block.
- Paste the Search field code.
- Click Save.
Note: This code-based customization falls outside the scope of our support. This means that we’re unable to help further with setup or troubleshooting. Additionally, since this is a code-based solution, we can’t guarantee its functionality or full compatibility with Squarespace. This includes how it functions with our responsive design, particularly its appearance on mobile devices, and if it functions on all templates. Code-based customizations can also cause display issues with future updates to our platform. While we can't help further, there are many resources that can point you in the right direction: