---
title: Filtrar el archivo robots.txt con SEOPress PRO
url: "https://www.seopress.org/es/soporte/hooks/filtrar-el-archivo-robots-txt-con-seopress-pro/"
lang: es
updated: 2021-09-30
hook_name: seopress_robots_txt_file
required_version: 3.7.4
---

# Filtrar el archivo robots.txt con SEOPress PRO

- **Hook name:** `seopress_robots_txt_file`
- **Required version:** 3.7.4

```php
add_filter('seopress_robots_txt_file','sp_robots_txt_file');
function sp_robots_txt_file($html) {
	//eg for Polylang and multidomain option enabled
	if (function_exists('pll_current_language') && pll_current_language() =='en') {
		$html = 'my custom rules here for english domain';
	} else {
		$html = 'my custom rules here for default case';
	}
	return $html;
}
```

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



