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
- Open the Code Injection panel.
- 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.
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:
- Learn best practices for adding custom code.
- Read our general guide on code-based customizations.
- For help with Swiftype, contact them at support@swiftype.com or visit their documentation.
- Visit the Squarespace Forum, our customer and developer forum.
- Hire a Squarespace Expert to help build custom code for your site.
Comments
0 comments
Please sign in to leave a comment.