---
title: Filtre el contenido y la URL del archivo llms.txt
url: "https://www.seopress.org/es/soporte/hooks/filtre-el-contenido-y-la-url-del-archivo-llms-txt/"
lang: es
updated: 2026-10-21
hook_name: seopress_llms_txt_file, seopress_llms_placeholders_replaced, seopress_llms_txt_url
required_version: 9.5
---

# Filtre el contenido y la URL del archivo llms.txt

- **Hook name:** `seopress_llms_txt_file, seopress_llms_placeholders_replaced, seopress_llms_txt_url`
- **Required version:** 9.5

```php
<?php
/**
 * Append a line to the generated llms.txt file.
 *
 * @param string $content The final llms.txt content.
 *
 * @return string
 */
function sp_llms_txt_file( $content ) {
	return $content . "\n> Contact: https://example.com/contact/\n";
}
add_filter( 'seopress_llms_txt_file', 'sp_llms_txt_file' );

/**
 * Filter the content once the placeholders of a custom llms.txt are replaced.
 *
 * @param string $content Content with placeholders resolved.
 *
 * @return string
 */
function sp_llms_placeholders_replaced( $content ) {
	return str_replace( '{{year}}', gmdate( 'Y' ), $content );
}
add_filter( 'seopress_llms_placeholders_replaced', 'sp_llms_placeholders_replaced' );

/**
 * Filter the llms.txt URL (always at the site root by default).
 *
 * @param string $url The llms.txt URL.
 *
 * @return string
 */
function sp_llms_txt_url( $url ) {
	return $url;
}
add_filter( 'seopress_llms_txt_url', 'sp_llms_txt_url' );
```

Source: [https://gist.github.com/wp-seopress/d92c6f3f1fe2b0ab13ecd56db8fe090d](https://gist.github.com/wp-seopress/d92c6f3f1fe2b0ab13ecd56db8fe090d)


`seopress_llms_placeholders_replaced` solo se ejecuta cuando se guarda un contenido llms.txt personalizado en los ajustes.
