---
title: Filter local business schema output
url: "https://www.seopress.org/support/hooks/filter-local-business-schema-output/"
lang: en-US
updated: 2026-10-20
hook_name: seopress_schemas_local_business_html
required_version: 4.5
---

# Filter local business schema output

- **Hook name:** `seopress_schemas_local_business_html`
- **Required version:** 4.5

```php
<?php
function sp_local_business_schema_html( $json ) {
	// $json is the encoded JSON-LD document (no <script> tag).
	$data = json_decode( $json, true );

	if ( is_array( $data ) ) {
		$data['priceRange'] = '$$';
		$json               = wp_json_encode( $data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE );
	}

	return $json;
}
add_filter( 'seopress_schemas_local_business_html', 'sp_local_business_schema_html' );
```

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


Modify the sitewide Local Business JSON-LD produced from the Local Business settings.

The filter receives the JSON-LD string printed inside the script element, not the script element itself.
