👀# How to Add a “View as Markdown” Button to Shopify Product Pages
This guide explains how to add a custom “View as Markdown” button to your Shopify product pages.
The button will appear on each product page and open a URL like:
<https://llms.YOURDOMAIN/>{{ product.handle }}.md
⚠️ This button will only show for specific products — you must define those products by their handle.
🔧 Step-by-Step Instructions
1. Open Shopify Theme Code Editor
In your Shopify admin, go to:
Online Store → Themes
Find your live theme (or preview theme).
Click Actions → Edit Code.
2. Find the Product Template
Locate the Liquid template that renders the product page. This is often:
Theme using Sections Everywhere (OS 2.0+)
/sections/main-product.liquid
/sections/product-template.liquid
/sections/product-information.liquid
/sections/product-content.liquid
Traditional or older themes:
/templates/product.liquid
/templates/product.json (combined with a section defined via main schema)
Decide where you want the button to appear on the product page — for example:
Below the product title - {{ product.title }}
Above or below the description - {{ product.description }}
In a custom section at the bottom of the page
Does it impact the effectiveness if the button is below the fold or hidden in an accordion section?
Yes we believe it’s more effective to place the button above the fold and not hidden inside an accordion section. If you must place it below the fold, we recommend trying to keep it outside of an accordion section if at all possible.
Where do you recommend placing it? We recommend placing it at the top of the page below the product title.
Visual Examples of Placement Options:
Below Product Title
Below Product Subheader
Below or Included in Product Description
You may also choose to change the wording from “View as Markdown” to:
“See AI-Readable Version”
“View ChatGPT-Optimized Page”
“View AI Summary (Markdown)”
3. Replace YOURDOMAIN With Your Actual Domain
Before adding the button, replace YOURDOMAIN in the code below with your actual domain — without https:// and without a trailing slash. For example, if your domain is:
{% if product.handle == 'PRODUCTHANDLE-1' or product.handle == 'PRODUCTHANDLE-2' %}
With:
{% if product.handle == '3-barebones-keyboard' or product.handle == 'model-o-2-wireless-mouse' %}
You must do this step for the button to work properly.
You can add as many product handles as you like—just connect them using “or”, like in the example above.
5. Paste the Button Code
All you have to do is add the button code once to your product page and it will automatically adapt the hyperlink to the right product based on the product handle.
Add the following HTML snippet within your product template file:
Reminder: Make sure to replace YOURDOMAIN in the URL with your actual domain and the PRODUCTHANDLE-# with the product handles you want the button to show.
✅ What It Does
Renders a "View as Markdown" button only on selected product pages.
Adding visible, relevant links from your main domain to subdomain markdown content generally has a neutral or positive effect on main domain SEO, as long as it’s done to genuinely help users and not to manipulate rankings. It strengthens your site’s authority and discoverability for both users and search engines.
Impact of Linking to Subdomain Content on Main Domain SEO
Effect on Main Domain SEO
Description
Positive (if relevant/visible)
Improves UX, topical authority, site structure
Neutral (most cases)
No direct ranking boost, but supports brand ecosystem
Negative (if abused)
Possible link dilution or penalties for manipulative linking
Positive Effects
1. Enhanced User Experience
Visible, relevant links to high-quality subdomain content can improve user navigation and satisfaction.
If users find helpful resources via these links, engagement metrics (like time on site and reduced bounce rate) may improve—factors that search engines consider for ranking.
2. Demonstrates Topical Authority
Linking to in-depth, authoritative markdown resources on your subdomain signals to search engines that your main domain is a valuable hub for comprehensive information.
This can strengthen your site’s perceived expertise and relevance in its niche.
3. Potential for Rich Snippets and Sitelinks
Well-structured linking can help search engines understand your site architecture, which may lead to enhanced search features like sitelinks or rich results.
Neutral or Minimal Effects
1. No Direct SEO Boost from Outbound Links
Linking to a subdomain (even your own) is treated similarly to linking to an external site. It does not directly increase the main domain’s rankings.
However, if the subdomain becomes authoritative and earns backlinks, the overall brand ecosystem can benefit indirectly.
2. Crawl Budget Considerations
For very large sites, excessive outbound linking could marginally impact crawl efficiency, but this is rarely a concern for most businesses.
Potential Negative Effects (If Misused)
1. Link Dilution
If you add too many outbound links (including to subdomains) on a single page, you may dilute the value passed to each link. This is only an issue if overdone.
2. Perceived Manipulation
If links appear manipulative (e.g., hidden, irrelevant, or stuffed with keywords), both the main domain and subdomain could be penalized.
Best Practices
Use clear, descriptive anchor text that matches the linked content’s purpose.
Keep links contextually relevant—add them where they genuinely help users.
Avoid excessive linking or creating doorway pages solely for SEO.
When the LLM accesses the markdown, it should be able to access a number of different versions of the product page based on what’s best for an individual prompt. For example, rather than having 1 markdown for 1 product page “Best sneakers for running,” it could lead the LLM to markdowns for “Best sneakers for walking” and “comfy shoes for nurses” that are each optimized for the given prompt.