---
title: Filter automatic book schema
url: "https://www.seopress.org/support/hooks/filter-automatic-book-schema/"
lang: en-US
updated: 2026-10-21
hook_name: seopress_schemas_auto_book_json, seopress_schemas_auto_book_html
required_version: 10.3
---

# Filter automatic book schema

- **Hook name:** `seopress_schemas_auto_book_json, seopress_schemas_auto_book_html`
- **Required version:** 10.3

```php
<?php
// Filter the automatic Book schema (array, before encoding).
function sp_book_schema_json( $json ) {
	// $json is the Book schema as an array.
	$json['inLanguage'] = 'en-US';

	return $json;
}
add_filter( 'seopress_schemas_auto_book_json', 'sp_book_schema_json' );

// Filter the full <script type="application/ld+json"> markup.
function sp_book_schema_html( $html ) {
	// Return an empty string to print nothing.
	return $html;
}
add_filter( 'seopress_schemas_auto_book_html', 'sp_book_schema_html' );
```

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


The JSON filter receives the schema as an array. The HTML filter receives the complete script element as a string.
