diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php
index cf07b07..d70c32d 100644
--- a/src/wp-includes/class-wp-query.php
+++ b/src/wp-includes/class-wp-query.php
@@ -402,6 +402,22 @@ class WP_Query {
 	 */
 	public $is_robots = false;
 
+	/**
+	 * Signifies whether the current query is for the llms.txt file.
+	 *
+	 * @since 7.0.0
+	 * @var bool
+	 */
+	public $is_llmstxt = false;
+
+	/**
+	 * Signifies whether the current query is for the llms-full.txt file.
+	 *
+	 * @since 7.0.0
+	 * @var bool
+	 */
+	public $is_llmstxt_full = false;
+
 	/**
 	 * Signifies whether the current query is for the favicon.ico file.
 	 *
@@ -518,6 +534,8 @@ class WP_Query {
 		$this->is_attachment        = false;
 		$this->is_singular          = false;
 		$this->is_robots            = false;
+		$this->is_llmstxt           = false;
+		$this->is_llmstxt_full      = false;
 		$this->is_favicon           = false;
 		$this->is_posts_page        = false;
 		$this->is_post_type_archive = false;
@@ -815,6 +833,10 @@ class WP_Query {
 
 		if ( ! empty( $query_vars['robots'] ) ) {
 			$this->is_robots = true;
+		} elseif ( ! empty( $query_vars['llmstxt'] ) ) {
+			$this->is_llmstxt = true;
+		} elseif ( ! empty( $query_vars['llmstxt_full'] ) ) {
+			$this->is_llmstxt_full = true;
 		} elseif ( ! empty( $query_vars['favicon'] ) ) {
 			$this->is_favicon = true;
 		}
@@ -1040,7 +1062,7 @@ class WP_Query {
 
 		if ( ! ( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed
 				|| ( wp_is_serving_rest_request() && $this->is_main_query() )
-				|| $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_robots || $this->is_favicon ) ) {
+				|| $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_robots || $this->is_llmstxt || $this->is_llmstxt_full || $this->is_favicon ) ) {
 			$this->is_home = true;
 		}
 
@@ -4623,6 +4645,28 @@ class WP_Query {
 		return (bool) $this->is_robots;
 	}
 
+	/**
+	 * Determines whether the query is for the llms.txt file.
+	 *
+	 * @since 7.0.0
+	 *
+	 * @return bool Whether the query is for the llms.txt file.
+	 */
+	public function is_llmstxt() {
+		return (bool) $this->is_llmstxt;
+	}
+
+	/**
+	 * Determines whether the query is for the llms-full.txt file.
+	 *
+	 * @since 7.0.0
+	 *
+	 * @return bool Whether the query is for the llms-full.txt file.
+	 */
+	public function is_llmstxt_full() {
+		return (bool) $this->is_llmstxt_full;
+	}
+
 	/**
 	 * Determines whether the query is for the favicon.ico file.
 	 *
diff --git a/src/wp-includes/class-wp-rewrite.php b/src/wp-includes/class-wp-rewrite.php
index 8b75fa5..a47bed3 100644
--- a/src/wp-includes/class-wp-rewrite.php
+++ b/src/wp-includes/class-wp-rewrite.php
@@ -1284,6 +1284,12 @@ class WP_Rewrite {
 		$home_path      = parse_url( home_url() );
 		$robots_rewrite = ( empty( $home_path['path'] ) || '/' === $home_path['path'] ) ? array( 'robots\.txt$' => $this->index . '?robots=1' ) : array();
 
+		// llms.txt and llms-full.txt -- only if installed at the root.
+		$llmstxt_rewrite = ( empty( $home_path['path'] ) || '/' === $home_path['path'] ) ? array(
+			'llms\.txt$'      => $this->index . '?llmstxt=1',
+			'llms-full\.txt$' => $this->index . '?llmstxt_full=1',
+		) : array();
+
 		// favicon.ico -- only if installed at the root.
 		$favicon_rewrite = ( empty( $home_path['path'] ) || '/' === $home_path['path'] ) ? array( 'favicon\.ico$' => $this->index . '?favicon=1' ) : array();
 
@@ -1452,9 +1458,9 @@ class WP_Rewrite {
 
 		// Put them together.
 		if ( $this->use_verbose_page_rules ) {
-			$this->rules = array_merge( $this->extra_rules_top, $robots_rewrite, $favicon_rewrite, $sitemap_rewrite, $deprecated_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $page_rewrite, $post_rewrite, $this->extra_rules );
+			$this->rules = array_merge( $this->extra_rules_top, $robots_rewrite, $llmstxt_rewrite, $favicon_rewrite, $sitemap_rewrite, $deprecated_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $page_rewrite, $post_rewrite, $this->extra_rules );
 		} else {
-			$this->rules = array_merge( $this->extra_rules_top, $robots_rewrite, $favicon_rewrite, $sitemap_rewrite, $deprecated_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules );
+			$this->rules = array_merge( $this->extra_rules_top, $robots_rewrite, $llmstxt_rewrite, $favicon_rewrite, $sitemap_rewrite, $deprecated_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules );
 		}
 
 		/**
diff --git a/src/wp-includes/class-wp.php b/src/wp-includes/class-wp.php
index f166474..3df8265 100644
--- a/src/wp-includes/class-wp.php
+++ b/src/wp-includes/class-wp.php
@@ -15,7 +15,7 @@ class WP {
 	 * @since 2.0.0
 	 * @var string[]
 	 */
-	public $public_query_vars = array( 'm', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'pagename', 'page_id', 'error', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'favicon', 'taxonomy', 'term', 'cpage', 'post_type', 'embed' );
+	public $public_query_vars = array( 'm', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'pagename', 'page_id', 'error', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'llmstxt', 'llmstxt_full', 'favicon', 'taxonomy', 'term', 'cpage', 'post_type', 'embed' );
 
 	/**
 	 * Private query variables.
@@ -746,8 +746,8 @@ class WP {
 
 		$set_404 = true;
 
-		// Never 404 for the admin, robots, or favicon.
-		if ( is_admin() || is_robots() || is_favicon() ) {
+		// Never 404 for the admin, robots, llmstxt, or favicon.
+		if ( is_admin() || is_robots() || is_llmstxt() || is_llmstxt_full() || is_favicon() ) {
 			$set_404 = false;
 
 			// If posts were found, check for paged content.
diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
index 262b069..e6880ce 100644
--- a/src/wp-includes/functions.php
+++ b/src/wp-includes/functions.php
@@ -1751,6 +1751,184 @@ function do_favicon() {
 	exit;
 }
 
+/**
+ * Displays the llms.txt file content.
+ *
+ * Outputs a machine-readable summary of the site's key content,
+ * following the llms.txt standard (https://llmstxt.org/).
+ * Contains links and excerpts only.
+ *
+ * @since 7.0.0
+ */
+function do_llmstxt() {
+	header( 'Content-Type: text/plain; charset=utf-8' );
+
+	/**
+	 * Fires when displaying the llms.txt file.
+	 *
+	 * @since 7.0.0
+	 */
+	do_action( 'do_llmstxt' );
+
+	$cached = get_transient( 'wp_llmstxt' );
+
+	if ( false === $cached ) {
+		$cached = _generate_llmstxt( false );
+
+		/** This filter is documented in wp-includes/functions.php */
+		$duration = apply_filters( 'llmstxt_cache_duration', 12 * HOUR_IN_SECONDS );
+		set_transient( 'wp_llmstxt', $cached, $duration );
+	}
+
+	/**
+	 * Filters the llms.txt output.
+	 *
+	 * @since 7.0.0
+	 *
+	 * @param string $output The llms.txt output.
+	 */
+	echo apply_filters( 'llmstxt_output', $cached );
+}
+
+/**
+ * Displays the llms-full.txt file content.
+ *
+ * Outputs a comprehensive version of the site's content including
+ * full page/post bodies, following the llms.txt standard.
+ *
+ * @since 7.0.0
+ */
+function do_llmstxt_full() {
+	header( 'Content-Type: text/plain; charset=utf-8' );
+
+	/**
+	 * Fires when displaying the llms-full.txt file.
+	 *
+	 * @since 7.0.0
+	 */
+	do_action( 'do_llmstxt_full' );
+
+	$cached = get_transient( 'wp_llmstxt_full' );
+
+	if ( false === $cached ) {
+		$cached = _generate_llmstxt( true );
+
+		/** This filter is documented in wp-includes/functions.php */
+		$duration = apply_filters( 'llmstxt_full_cache_duration', 24 * HOUR_IN_SECONDS );
+		set_transient( 'wp_llmstxt_full', $cached, $duration );
+	}
+
+	/**
+	 * Filters the llms-full.txt output.
+	 *
+	 * @since 7.0.0
+	 *
+	 * @param string $output The llms-full.txt output.
+	 */
+	echo apply_filters( 'llmstxt_full_output', $cached );
+}
+
+/**
+ * Generates llms.txt or llms-full.txt content.
+ *
+ * @since 7.0.0
+ * @access private
+ *
+ * @param bool $full Whether to include full post content. Default false.
+ * @return string The generated llms.txt content.
+ */
+function _generate_llmstxt( $full = false ) {
+	$site_name = get_bloginfo( 'name' );
+	$site_desc = get_bloginfo( 'description' );
+	$site_url  = home_url( '/' );
+
+	$output = "# {$site_name}\n\n";
+
+	if ( $site_desc ) {
+		$output .= "> {$site_desc}\n\n";
+	}
+
+	/**
+	 * Filters the post types included in llms.txt files.
+	 *
+	 * @since 7.0.0
+	 *
+	 * @param string[] $post_types Array of post type slugs.
+	 * @param bool     $full       Whether this is for llms-full.txt.
+	 */
+	$post_types = apply_filters( 'llmstxt_post_types', array( 'page' ), $full );
+
+	$posts = get_posts( array(
+		'post_type'      => $post_types,
+		'post_status'    => 'publish',
+		'posts_per_page' => -1,
+		'orderby'        => 'menu_order title',
+		'order'          => 'ASC',
+	) );
+
+	if ( ! $posts ) {
+		$output .= "## Links\n\n";
+		$output .= "- [{$site_name}]({$site_url}): Home page\n";
+
+		return $output;
+	}
+
+	$output .= "## Pages\n\n";
+
+	foreach ( $posts as $post ) {
+		$title = get_the_title( $post );
+		$url   = get_permalink( $post );
+
+		if ( $full ) {
+			$content = wp_strip_all_tags(
+				apply_filters( 'the_content', $post->post_content )
+			);
+			$content = preg_replace( '/\n{3,}/', "\n\n", $content );
+			$content = trim( $content );
+
+			$output .= "### {$title}\n";
+			$output .= "URL: {$url}\n\n";
+
+			if ( $content ) {
+				$output .= $content . "\n\n";
+			}
+
+			$output .= "---\n\n";
+		} else {
+			$excerpt = get_the_excerpt( $post );
+			$line    = "- [{$title}]({$url})";
+
+			if ( $excerpt ) {
+				$line .= ": {$excerpt}";
+			}
+
+			$output .= $line . "\n";
+		}
+	}
+
+	return $output;
+}
+
+/**
+ * Clears the llms.txt transient caches when content changes.
+ *
+ * @since 7.0.0
+ * @access private
+ *
+ * @param int $post_id Post ID.
+ */
+function _clear_llmstxt_cache( $post_id = 0 ) {
+	if ( $post_id && wp_is_post_revision( $post_id ) ) {
+		return;
+	}
+
+	delete_transient( 'wp_llmstxt' );
+	delete_transient( 'wp_llmstxt_full' );
+}
+add_action( 'save_post',    '_clear_llmstxt_cache' );
+add_action( 'deleted_post', '_clear_llmstxt_cache' );
+add_action( 'switch_theme', '_clear_llmstxt_cache' );
+
 /**
  * Determines whether WordPress is already installed.
  *
diff --git a/src/wp-includes/query.php b/src/wp-includes/query.php
index 592e70e..8fd3b65 100644
--- a/src/wp-includes/query.php
+++ b/src/wp-includes/query.php
@@ -660,6 +660,46 @@ function is_robots() {
 	return $wp_query->is_robots();
 }
 
+/**
+ * Is the query for the llms.txt file?
+ *
+ * @since 7.0.0
+ *
+ * @global WP_Query $wp_query WordPress Query object.
+ *
+ * @return bool Whether the query is for the llms.txt file.
+ */
+function is_llmstxt() {
+	global $wp_query;
+
+	if ( ! isset( $wp_query ) ) {
+		_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '7.0.0' );
+		return false;
+	}
+
+	return $wp_query->is_llmstxt();
+}
+
+/**
+ * Is the query for the llms-full.txt file?
+ *
+ * @since 7.0.0
+ *
+ * @global WP_Query $wp_query WordPress Query object.
+ *
+ * @return bool Whether the query is for the llms-full.txt file.
+ */
+function is_llmstxt_full() {
+	global $wp_query;
+
+	if ( ! isset( $wp_query ) ) {
+		_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '7.0.0' );
+		return false;
+	}
+
+	return $wp_query->is_llmstxt_full();
+}
+
 /**
  * Is the query for the favicon.ico file?
  *
diff --git a/src/wp-includes/template-loader.php b/src/wp-includes/template-loader.php
index b318359..86631c2 100644
--- a/src/wp-includes/template-loader.php
+++ b/src/wp-includes/template-loader.php
@@ -46,6 +46,22 @@ if ( is_robots() ) {
 	 */
 	do_action( 'do_robots' );
 	return;
+} elseif ( is_llmstxt() ) {
+	/**
+	 * Fired when the template loader determines a llms.txt request.
+	 *
+	 * @since 7.0.0
+	 */
+	do_llmstxt();
+	return;
+} elseif ( is_llmstxt_full() ) {
+	/**
+	 * Fired when the template loader determines a llms-full.txt request.
+	 *
+	 * @since 7.0.0
+	 */
+	do_llmstxt_full();
+	return;
 } elseif ( is_favicon() ) {
 	/**
 	 * Fired when the template loader determines a favicon.ico request.
diff --git a/tests/phpunit/tests/rewrite/llmstxt.php b/tests/phpunit/tests/rewrite/llmstxt.php
new file mode 100644
index 0000000..22ad4db
--- /dev/null
+++ b/tests/phpunit/tests/rewrite/llmstxt.php
@@ -0,0 +1,155 @@
+<?php
+/**
+ * Tests for llms.txt and llms-full.txt virtual file support.
+ *
+ * @group rewrite
+ * @group llmstxt
+ */
+class Tests_Rewrite_LlmsTxt extends WP_UnitTestCase {
+
+	/**
+	 * Test that llmstxt query var is registered.
+	 */
+	public function test_llmstxt_query_var_registered() {
+		global $wp;
+		$this->assertContains( 'llmstxt', $wp->public_query_vars );
+	}
+
+	/**
+	 * Test that llmstxt_full query var is registered.
+	 */
+	public function test_llmstxt_full_query_var_registered() {
+		global $wp;
+		$this->assertContains( 'llmstxt_full', $wp->public_query_vars );
+	}
+
+	/**
+	 * Test is_llmstxt() returns false by default.
+	 */
+	public function test_is_llmstxt_default() {
+		$this->go_to( '/' );
+		$this->assertFalse( is_llmstxt() );
+	}
+
+	/**
+	 * Test is_llmstxt_full() returns false by default.
+	 */
+	public function test_is_llmstxt_full_default() {
+		$this->go_to( '/' );
+		$this->assertFalse( is_llmstxt_full() );
+	}
+
+	/**
+	 * Test basic llms.txt output contains site name.
+	 */
+	public function test_generate_llmstxt_contains_site_name() {
+		update_option( 'blogname', 'Test Site LlmsTxt' );
+		delete_transient( 'wp_llmstxt' );
+
+		$output = _generate_llmstxt( false );
+
+		$this->assertStringContainsString( '# Test Site LlmsTxt', $output );
+	}
+
+	/**
+	 * Test llms.txt output contains site description.
+	 */
+	public function test_generate_llmstxt_contains_description() {
+		update_option( 'blogdescription', 'A test site for llms.txt' );
+		delete_transient( 'wp_llmstxt' );
+
+		$output = _generate_llmstxt( false );
+
+		$this->assertStringContainsString( '> A test site for llms.txt', $output );
+	}
+
+	/**
+	 * Test llms.txt includes published pages.
+	 */
+	public function test_generate_llmstxt_includes_pages() {
+		$page_id = self::factory()->post->create( array(
+			'post_type'   => 'page',
+			'post_title'  => 'About Us LlmsTxt',
+			'post_status' => 'publish',
+		) );
+
+		delete_transient( 'wp_llmstxt' );
+		$output = _generate_llmstxt( false );
+
+		$this->assertStringContainsString( 'About Us LlmsTxt', $output );
+		$this->assertStringContainsString( get_permalink( $page_id ), $output );
+	}
+
+	/**
+	 * Test llms.txt does NOT include draft pages.
+	 */
+	public function test_generate_llmstxt_excludes_drafts() {
+		self::factory()->post->create( array(
+			'post_type'   => 'page',
+			'post_title'  => 'Draft Page LlmsTxt',
+			'post_status' => 'draft',
+		) );
+
+		delete_transient( 'wp_llmstxt' );
+		$output = _generate_llmstxt( false );
+
+		$this->assertStringNotContainsString( 'Draft Page LlmsTxt', $output );
+	}
+
+	/**
+	 * Test llms-full.txt includes page content.
+	 */
+	public function test_generate_llmstxt_full_includes_content() {
+		self::factory()->post->create( array(
+			'post_type'    => 'page',
+			'post_title'   => 'Services LlmsTxt',
+			'post_content' => 'We provide excellent services for testing.',
+			'post_status'  => 'publish',
+		) );
+
+		delete_transient( 'wp_llmstxt_full' );
+		$output = _generate_llmstxt( true );
+
+		$this->assertStringContainsString( '### Services LlmsTxt', $output );
+		$this->assertStringContainsString( 'We provide excellent services for testing.', $output );
+	}
+
+	/**
+	 * Test cache invalidation on post save.
+	 */
+	public function test_cache_cleared_on_save_post() {
+		set_transient( 'wp_llmstxt', 'cached_content' );
+		set_transient( 'wp_llmstxt_full', 'cached_full_content' );
+
+		$post_id = self::factory()->post->create( array(
+			'post_type'   => 'page',
+			'post_status' => 'publish',
+		) );
+
+		wp_update_post( array( 'ID' => $post_id, 'post_title' => 'Updated' ) );
+
+		$this->assertFalse( get_transient( 'wp_llmstxt' ) );
+		$this->assertFalse( get_transient( 'wp_llmstxt_full' ) );
+	}
+
+	/**
+	 * Test llmstxt_post_types filter works.
+	 */
+	public function test_llmstxt_post_types_filter() {
+		add_filter( 'llmstxt_post_types', function ( $types ) {
+			$types[] = 'post';
+			return $types;
+		} );
+
+		self::factory()->post->create( array(
+			'post_type'   => 'post',
+			'post_title'  => 'Blog Post LlmsTxt',
+			'post_status' => 'publish',
+		) );
+
+		delete_transient( 'wp_llmstxt' );
+		$output = _generate_llmstxt( false );
+
+		$this->assertStringContainsString( 'Blog Post LlmsTxt', $output );
+	}
+}
