Veeeetzzzz/easy-ai-seo
Optimise your site for AI search engines with zero dependencies.
π§ AI-SEO.js
AI-SEO.js is a lightweight, plug-and-play JavaScript utility that injects structured schema markup (JSON-LD) into any webpage. It's designed to make your content readable and indexable by AI-powered search engines (LLMs), like ChatGPT, Bing Chat, Google Gemini, and more β with just two lines of code.
π Features
- β Zero dependencies
- β CDN-compatible (GitHub Pages or Vercel)
- β Schema.org-compliant (for FAQ pages)
- β Works with any JavaScript framework (React, Next.js, Vue, plain HTML)
- β Minimal integration (just 2 script tags)
- β Optimized for AI and SEO bots
π¦ Installation
π Option 1: GitHub CDN (Recommended)
Use directly via GitHub Pages:
<script src="https://github.com/Veeeetzzzz/easy-ai-seo/ai-seo.js"></script>π Option 2: Host Locally
Download ai-seo.js and include it in your project:
<script src="/path/to/ai-seo.js"></script>π οΈ Usage
After including the script, initialize it like this:
<script>
AISEO.init({
pageType: 'FAQPage',
questionType: "How to optimize for AI search?",
answerType: "Use structured data, clear headings, and conversational answers."
});
</script>That's it. One line to inject structured JSON-LD markup into your site.
π§© Works With
- β Static HTML
- β React / Next.js
- β WordPress (paste into HTML block or template)
- β Shopify / Webflow
- β Any framework that supports JS
π Example Output (JSON-LD Injected)
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "How to optimize for AI search?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Use structured data, clear headings, and conversational answers."
}
}
]
}β Validation
Use the following tools to confirm your schema is valid and indexable:
- Google Rich Results Test
- Schema.org Validator
- Google Search Console (submit your URL for indexing)
π§ͺ LLM Readability Test (Optional)
Want to check if AI models can read and understand your page?
Try this prompt in ChatGPT, Gemini, or Bing Chat:
βCan you summarize the content from [https://yourwebsite.com]? What question does it answer?β
π‘οΈ Best Practices
- Host the JS file on a trusted domain (GitHub Pages or your own).
- Use HTTPS to avoid mixed content issues.
- Validate frequently when updating Q&A content.
- Keep your schema up-to-date with SEO best practices.
π§° Advanced (React/Next.js Example)
import { useEffect } from 'react';
const SEOPage = () => {
useEffect(() => {
const script = document.createElement('script');
script.src = "https://github.com/Veeeetzzzz/easy-ai-seo/ai-seo.js";
script.onload = () => {
AISEO.init({
pageType: 'FAQPage',
questionType: "What is AI SEO?",
answerType: "Itβs the practice of optimizing content for LLM-powered AI tools and search engines."
});
};
document.head.appendChild(script);
}, []);
return <h1>My Optimized Page</h1>;
};
export default SEOPage;π License
MIT License. Free for personal and commercial use.
π Support & Contributions
Feel free to fork, contribute, or submit issues/feature requests.
Created with β₯ to help the web evolve with AI-driven search.