---
title: Filter manual custom schema
url: "https://www.seopress.org/support/hooks/filter-manual-custom-schema/"
lang: en-US
updated: 2026-10-16
hook_name: seopress_rich_snippets_custom_{$key}_html
required_version: 4.6
---

# Filter manual custom schema

- **Hook name:** `seopress_rich_snippets_custom_{$key}_html`
- **Required version:** 4.6

```php
<?php
// $key is the index of the custom schema among the custom schemas of the post (0 = first custom schema).
add_filter( 'seopress_rich_snippets_custom_0_html', 'sp_rich_snippets_custom_html', 10, 2 );
function sp_rich_snippets_custom_html( $html, $context ) {
	// $html is the custom schema as a string (the <script type="application/ld+json"> block you entered).
	// $context is an array describing the current page, use it to apply conditions.

	// Do your stuff.

	return $html;
}
```

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



