Step 1 - Add jQuery via Site Header injection
Open your Ghost admin panel and navigate to Settings > Code injection. Paste the following script tag into the Site Header field. This loads jQuery, which the Linking Agent script depends on.
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"> </script>
If your Ghost theme already includes jQuery, you can skip this step. Check your theme source or look for jQuery in your page source before adding a duplicate.
Step 2 - Load the Linking Agent script in Site Footer
Still in Settings > Code injection, paste the following into the Site Footer field. Replace YOUR_API_KEY with the key provided by your onboarding team.
<script src="https://dev-dot-isentropic-snow-282609.ew.r.appspot.com/api/js-internal-linking/?apikey=YOUR_API_KEY"></script>
API key
Contact our onboarding team if you do not yet have an API key. You can also find it in the Linking Agent dashboard by entering a test URL and inspecting the X-API-KEY value in the request.
Production endpoint
The script URL shown above is a development endpoint. For your production environment and final API key, speak with your onboarding team. They will provide the correct endpoint for your site.
Step 3 - Add the container div to your post template
The Linking Agent script looks for a specific div element on the page to render links into. Open your post template file at:
current/content/themes/source/post.hbs
Add the following div where you want the internal links to appear. A common placement is below the post content, before the comments section.
<div id="similarai-relatedSearches"></div>
Once the div is in place and your code injection scripts are saved, the Linking Agent will automatically populate the container with relevant internal links on each post page.
If you are using a custom Ghost theme, the post template path may differ. Check your theme directory for the equivalent of post.hbs and place the div there.
Related guides
Depending on your setup, these guides may also be helpful:
Frequently asked questions
How does Similar AI add internal links to a Ghost CMS blog?
Similar AI's Linking Agent identifies contextually relevant internal linking opportunities across your posts and injects optimized anchor links automatically. For Ghost CMS, this is implemented via code injection in the Admin panel or by editing your <code>post.hbs</code> template to load the Similar AI script.
Do I need developer skills to set up the Ghost CMS integration?
Basic familiarity with Ghost's Admin panel and Handlebars templates is helpful but not required for most steps. The setup involves pasting a script snippet into Ghost's header or footer code injection fields, which is accessible to non-developers through the Ghost Admin UI.
What is the difference between using code injection versus editing post.hbs for this integration?
Code injection via Ghost Admin is the quicker, theme-agnostic approach that survives theme updates, making it ideal for most blogs. Editing <code>post.hbs</code> directly gives you finer control over script placement within individual post layouts, which is useful if you need the Linking Agent script to fire at a specific point in the page render.
Will Similar AI's Linking Agent work across all Ghost post types and custom templates?
The Linking Agent works on any page that loads the Similar AI script, so as long as your custom templates include the injected header or footer snippet, all post types are covered. If you use multiple custom post templates in Ghost, you may need to verify each template includes the script or rely on the global code injection method.
How does internal linking through Similar AI benefit a Ghost blog's SEO?
Strategic internal links help search engines discover and understand the topical relationships between your posts, distributing link equity and improving crawl depth. The Linking Agent continuously surfaces new linking opportunities as you publish content, so your Ghost blog's internal link structure grows alongside your content library without manual audits.
Ready to add internal links to your Ghost blog?
Get the Linking Agent running on your Ghost site in minutes. Our team can walk you through the setup and provide your production credentials.