> For the complete documentation index, see [llms.txt](https://knowledgebase.ajaxsearchpro.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.ajaxsearchpro.com/hooks/filters/index-table-related/asp_index_cf_contents_before_tokenize.md).

# asp\_index\_cf\_contents\_before\_tokenize

Gives access to **all of the custom field content** merged into a string, before they are sent to tokenization

```
apply_filters('asp_post_custom_field_before_tokenize', $field_contents, $the_post);
```

### Parameters

* **$field\_contents** (string) - contents of all the custom fields merged as a string
* **$post** (WP\_Post) - post type object

{% hint style="danger" %}
The return value should always be an **string**
{% endhint %}

### Sample usage

```php
add_filter( 'asp_post_custom_field_before_tokenize', 'asp_change_cf_index', 10, 3 );
function asp_change_cf_index( $field_contents, $post ) {
    if ( $field_contents == '' ) {
        return 'my custom field contents';
    } else {
        return $field_contents;
    }
}
```
