If the Similar AI WordPress plugin does not work for your setup, you can integrate the Similar AI API using client-side JavaScript instead. Two approaches below.
WPCode lets you inject custom JavaScript into your WordPress site without editing theme files. Make sure the WPCode plugin is installed and activated before proceeding.
Navigate to your WordPress admin dashboard and open the Headers & Footers settings in WPCode. Paste the Similar AI JavaScript snippet into the Footer section. This ensures the script loads on every page.
<!-- WPCode > Headers & Footers > Footer --> <script src="https://api.similar.ai/your-site/internal-links.js"></script>
In the WordPress block editor, add a Custom HTML block where you want the internal links to appear. Paste the following container div:
<div id="similarai-relatedSearches"></div>
If the block editor switches back to visual mode, click the three-dot menu on the block and select Edit as HTML to re-paste the code. The JavaScript loaded in the footer will find this container and populate it with internal links automatically.
If you prefer not to use a plugin, you can add the script directly to your WordPress theme footer template. This gives you full control and avoids a plugin dependency.
Go to /wp-admin/theme-editor.php?file=footer.php in your WordPress admin, or navigate to Appearance > Theme File Editor and select footer.php.
Insert the Similar AI script just before </body> in footer.php:
<!-- Add before </body> in footer.php --> <script src="https://api.similar.ai/your-site/internal-links.js"></script>
Add the target container wherever you want the links to render. You can place it inside your post template or directly in individual posts using a Custom HTML block:
<div id="similarai-relatedSearches"></div>
Once saved, the script will detect the container and populate it with relevant internal links on each page load.
For a Google Tag Manager approach instead of direct script injection, see the JavaScript and GTM integration guide. If you want a server-side WordPress integration, try the WordPress plugin guide first.
Similar AI generates relevant internal links that help visitors and search engines discover more of your content. Set up takes minutes.