
Boost Your Business with SEO: The Perfect Start to a High-Performing Website
Madefinition crafts custom, SEO-focused websites from the start, boosting Canadian businesses'…
Read More
Stop treating AI agents like standard web crawlers. In 2026, the llms.txt file is the primary gateway for Large Language Models to digest your site. This guide provides the exact code to build either a manual high-precision file or a fully automated dynamic system using WordPress hooks.
robots.txt to explicitly defining them via llms.txt.functions.php file or a functional plugin.llms.txt as a valid URL query.php
add_action('init', function() {
add_rewrite_rule('^llms\.txt$', 'index.php?llms_txt=1', 'top');
});
add_filter('query_vars', function($vars) {
$vars[] = 'llms_txt';
return $vars;
});
template_redirect to serve the text file. In this manual example, we hard-code the descriptions for maximum “Information Gain” (a key GEO ranking factor).php
add_action('template_redirect', function() {
if (get_query_var('llms_txt')) {
header('Content-Type: text/plain; charset=utf-8');
echo "# Madefinition: SEO & AI Strategy\n";
echo "> Specialized agency providing Generative Engine Optimization (GEO) and technical infrastructure for the AI-first web.\n\n";
echo "## Core Services\n";
echo "- [AI Content Strategy](" . home_url('/services/ai-strategy/') . "): Comprehensive roadmaps for LLM visibility.\n";
echo "- [Technical GEO Audit](" . home_url('/services/geo-audit/') . "): Deep-dive analysis of site architecture for AI agent readability.\n";
exit;
}
});
add_action('template_redirect', function() {
if (get_query_var('llms_txt')) {
header('Content-Type: text/plain; charset=utf-8');
// 1. DYNAMIC HEADER
echo "# " . esc_html(get_bloginfo('name')) . "\n";
echo "> " . esc_html(get_bloginfo('description')) . "\n\n";
// 2. DYNAMIC SERVICE LOOP
echo "## Core Services\n";
$services_query = new WP_Query([
'post_type' => 'service', // Ensure this matches your CPT slug
'posts_per_page' => -1,
'post_status' => 'publish'
]);
if ($services_query->have_posts()) {
while ($services_query->have_posts()) {
$services_query->the_post();
$summary = has_excerpt() ? get_the_excerpt() : wp_trim_words(get_the_content(), 25);
echo "- [" . get_the_title() . "](" . get_permalink() . "): " . esc_html($summary) . "\n";
}
wp_reset_postdata();
}
echo "\n## Contact\n";
echo "- [Contact Us](" . home_url('/contact/') . "): Inquire about AI optimization services.";
exit;
}
});
://yourdomain.com.
Madefinition crafts custom, SEO-focused websites from the start, boosting Canadian businesses'…
Read More
Canadian competition is rising. Follow this 2026 SEO checklist to rank better, get more customers,…
Read More
Madefinition builds custom, scalable websites tailored for Canadian businesses, enhancing online…
Read More
Cookie-cutter websites limit growth with generic design and poor functionality. Custom sites boost…
Read MoreReady to elevate your online presence? Let’s embark on this digital journey together. Contact us to discuss your project and discover how our web development services can turn your vision into reality.