AI assistants like ChatGPT, Claude, and Gemini are becoming product discovery channels. But unlike Google, they don’t crawl your store automatically — they need a structured file to understand what you sell.

That file is llms.txt. And for Magento 2, you can generate it in under 5 minutes with a free open-source module.

Here’s how.

Tutorial: generate llms.txt file for Magento 2 to improve AI search visibility in ChatGPT and LLMs

What Is llms.txt and Why Does Magento Need It?

llms.txt is a plain-text Markdown file placed at your store root (e.g., https://yourstore.com/llms.txt). It tells AI systems what your store is, what categories you have, what products you sell, and what CMS pages exist — all in a clean, readable format.

Think of it as sitemap.xml for AI. But instead of listing every URL for crawlers, it curates the most important content for language models.

Without llms.txt, an AI assistant trying to recommend your products must parse:

  • Navigation menus
  • Cookie consent banners
  • JavaScript-rendered widgets
  • Footer links and sidebars

With llms.txt, the AI gets clean, structured context — instantly.


Step 1: Install the Module via Composer

SSH into your Magento 2 server and run:

composer require angeo/module-llms-txt
bin/magento setup:upgrade
bin/magento cache:flush

That’s it for installation. The module angeo/module-llms-txt is free, MIT-licensed, and available on Packagist. It generates both llms.txt and llms.ljson (the structured JSON variant for product catalogs).


Step 2: Configure in Magento Admin

Navigate to:

Stores → Configuration → General → Angeo → LLMS

Here you can:

  • Trigger manual generation immediately

Click Generate Now (or your equivalent button) to create the files immediately.


Step 3: Verify the Generated Files

Open your browser and check:

  • https://yourstore.com/llms.txt
  • https://yourstore.com/llms.ljson

You should see something like this for llms.txt:

# Store: My Magento Store

# Store: My Magento Store

## STORE
Name: TEST Store
URL: https://teststore.com/
Currency: USD

### CATEGORIES ###
Category ID: 3
Name: All products
Parent ID: 2
URL: https://teststore.com/all-products
Description: test description

### PRODUCTS ###
SKU: test
Name: test
Price: 100.000000
URL: https://teststore.com/test
Short Description: test short description
Description: test description

## CMS PAGES

TYPE: PAGE
TITLE: 404 Not Found
URL: https://teststore.com/no-route
CONTENT:  The page you requested was not found, and we have a fine guess why. If you typed the URL directly, please make sure the spelling is correct. If you clicked on a link to get here, the link is outdated. What can you do? Have no fear, help is near! There are many ways you can get back on track with Magento Store. Go back to the previous page. Use the search bar at the top of the page to search for your products. Follow these links to get you back on track!Store Home | My Account 

TYPE: PAGE
TITLE: Home page
URL: https://teststore.com/home
CONTENT: CMS homepage content goes here. 

If both files load correctly with a 200 OK status, you’re done.


Step 4: Enable Cron for Automatic Updates

Product prices, stock levels, and catalog content change frequently. Set up automatic regeneration so your AI files always reflect your current catalog.

If Magento cron is already running on your server, simply enable cron generation in the module config. If not, add the standard Magento cron entry:

# crontab -e
* * * * * php /var/www/html/bin/magento cron:run 2>&1

Then run once manually to confirm:

bin/magento cron:run

The module will then automatically regenerate llms.txt and llms.ljson on schedule.


Multi-Store Setup

If you run multiple store views (e.g., English + Dutch, or separate B2B/B2C stores), the module handles this natively. Each store view generates its own files scoped to that store’s products, categories, and CMS pages.

This means AI systems accessing your Dutch store view get Dutch product names and descriptions — not a mix of languages.


What Gets Generated — Full Overview

File Format Contents Best for
llms.txt Markdown Store info, categories, products, CMS pages AI context & navigation
llms.ljson Line-delimited JSON Structured product objects with attributes AI product queries & recommendations

Both files are placed in your Magento pub/ directory and served as static files — no performance impact on your store.


Checklist: You’re Done When…

  • composer require angeo/module-llms-txt ran successfully
  • bin/magento setup:upgrade completed
  • ✅ Files visible at /llms.txt and /llms.ljson
  • ✅ Both files return HTTP 200
  • ✅ Cron configured for automatic regeneration
  • ✅ Multi-store views configured if applicable

Why This Matters Now

In 2026, AI assistants have become a primary product discovery channel for a growing segment of online shoppers. Users ask ChatGPT “what’s the best waterproof hiking jacket” and follow the recommendation directly — without ever visiting Google.

Stores that provide structured, machine-readable content to AI systems get recommended. Stores that don’t remain invisible — regardless of how good their products are.

llms.txt and llms.ljson are the minimum viable implementation. Five minutes of setup. Potentially significant visibility gain as AI commerce grows.


Module Details


Questions about the setup or multi-store configuration? Leave a comment below or open an issue on GitHub.

Tutorial: generate llms.txt file for Magento 2 to improve AI search visibility in ChatGPT and LLMs


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *