---
title: "modal_kit_pro_results_count – Modal Kit Docs"
description: "Decide whether a page sends Results events to your site. Turn it off for static exporters other than Simply Static, or on staging."
language: "en-US"
canonical_url: "https://modalkitwp.com/docs/hooks/modal_kit_pro_results_count/"
source_url: "https://modalkitwp.com/docs/hooks/modal_kit_pro_results_count/"
content_type: "text/markdown"
---

[All hooks](https://modalkitwp.com/docs/hooks/)

Free · PHP hooks

[modal_kit_layouts](https://modalkitwp.com/docs/hooks/modal_kit_layouts/)

[modal_kit_styles](https://modalkitwp.com/docs/hooks/modal_kit_styles/)

[modal_kit_theme_tokens](https://modalkitwp.com/docs/hooks/modal_kit_theme_tokens/)

[modal_kit_meta_schema](https://modalkitwp.com/docs/hooks/modal_kit_meta_schema/)

[modal_kit_targets_request](https://modalkitwp.com/docs/hooks/modal_kit_targets_request/)

[modal_kit_dialog_context](https://modalkitwp.com/docs/hooks/modal_kit_dialog_context/)

[modal_kit_dialog_panel](https://modalkitwp.com/docs/hooks/modal_kit_dialog_panel/)

[modal_kit_button_actions](https://modalkitwp.com/docs/hooks/modal_kit_button_actions/)

[modal_kit_render_button_action](https://modalkitwp.com/docs/hooks/modal_kit_render_button_action/)

[modal_kit_link_prefix](https://modalkitwp.com/docs/hooks/modal_kit_link_prefix/)

[modal_kit_close_label](https://modalkitwp.com/docs/hooks/modal_kit_close_label/)

[modal_kit_post_type_capabilities](https://modalkitwp.com/docs/hooks/modal_kit_post_type_capabilities/)

[modal_kit_pattern_categories](https://modalkitwp.com/docs/hooks/modal_kit_pattern_categories/)

[modal_kit_pattern_collections](https://modalkitwp.com/docs/hooks/modal_kit_pattern_collections/)

[modal_kit_pattern_collection_types](https://modalkitwp.com/docs/hooks/modal_kit_pattern_collection_types/)

[modal_kit_starter_settings](https://modalkitwp.com/docs/hooks/modal_kit_starter_settings/)

[modal_kit_backdrop_capability](https://modalkitwp.com/docs/hooks/modal_kit_backdrop_capability/)

[modal_kit_backdrop_request](https://modalkitwp.com/docs/hooks/modal_kit_backdrop_request/)

[modal_kit_optimizer_paths](https://modalkitwp.com/docs/hooks/modal_kit_optimizer_paths/)

[modal_kit_pro_listings](https://modalkitwp.com/docs/hooks/modal_kit_pro_listings/)

Pro · PHP hooks

[modal_kit_pro_providers](https://modalkitwp.com/docs/hooks/modal_kit_pro_providers/)

[modal_kit_pro_captcha_providers](https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_providers/)

[modal_kit_pro_captcha_hostnames](https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_hostnames/)

[modal_kit_pro_country](https://modalkitwp.com/docs/hooks/modal_kit_pro_country/)

[modal_kit_pro_country_sources](https://modalkitwp.com/docs/hooks/modal_kit_pro_country_sources/)

[modal_kit_pro_results_goal](https://modalkitwp.com/docs/hooks/modal_kit_pro_results_goal/)

[modal_kit_pro_results_count](https://modalkitwp.com/docs/hooks/modal_kit_pro_results_count/)

[modal_kit_pro_coupon_issued](https://modalkitwp.com/docs/hooks/modal_kit_pro_coupon_issued/)

[modal_kit_pro_visitor_address](https://modalkitwp.com/docs/hooks/modal_kit_pro_visitor_address/)

[modal_kit_pro_play_rate_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_play_rate_limit/)

[modal_kit_pro_form_daily_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_form_daily_limit/)

[modal_kit_pro_address_daily_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_address_daily_limit/)

[modal_kit_pro_events_rate_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_events_rate_limit/)

[modal_kit_pro_modal_events_per_hour](https://modalkitwp.com/docs/hooks/modal_kit_pro_modal_events_per_hour/)

Pro · Updates

[modal_kit_pro_is_staging](https://modalkitwp.com/docs/hooks/modal_kit_pro_is_staging/)

[modal_kit_pro_pre_rollback](https://modalkitwp.com/docs/hooks/modal_kit_pro_pre_rollback/)

[modal_kit_pro_tested_up_to](https://modalkitwp.com/docs/hooks/modal_kit_pro_tested_up_to/)

Editor filters · JavaScript

[modalKit.layouts](https://modalkitwp.com/docs/hooks/modalkit-layouts/)

[modalKit.triggerTypes](https://modalkitwp.com/docs/hooks/modalkit-triggertypes/)

[modalKit.triggerMenuGroups](https://modalkitwp.com/docs/hooks/modalkit-triggermenugroups/)

[modalKit.buttonActions](https://modalkitwp.com/docs/hooks/modalkit-buttonactions/)

[modalKit.canvasChrome](https://modalkitwp.com/docs/hooks/modalkit-canvaschrome/)

[modalKit.styleTarget](https://modalkitwp.com/docs/hooks/modalkit-styletarget/)

[modalKit.settingsTabs](https://modalkitwp.com/docs/hooks/modalkit-settingstabs/)

[modalKit.styleEditor](https://modalkitwp.com/docs/hooks/modalkit-styleeditor/)

[modalKit.toolsRows](https://modalkitwp.com/docs/hooks/modalkit-toolsrows/)

[modalKit.pickerPreview](https://modalkitwp.com/docs/hooks/modalkit-pickerpreview/)

Hooks ▾

[All hooks](https://modalkitwp.com/docs/hooks/)

Free · PHP hooks

[modal_kit_layouts](https://modalkitwp.com/docs/hooks/modal_kit_layouts/)

[modal_kit_styles](https://modalkitwp.com/docs/hooks/modal_kit_styles/)

[modal_kit_theme_tokens](https://modalkitwp.com/docs/hooks/modal_kit_theme_tokens/)

[modal_kit_meta_schema](https://modalkitwp.com/docs/hooks/modal_kit_meta_schema/)

[modal_kit_targets_request](https://modalkitwp.com/docs/hooks/modal_kit_targets_request/)

[modal_kit_dialog_context](https://modalkitwp.com/docs/hooks/modal_kit_dialog_context/)

[modal_kit_dialog_panel](https://modalkitwp.com/docs/hooks/modal_kit_dialog_panel/)

[modal_kit_button_actions](https://modalkitwp.com/docs/hooks/modal_kit_button_actions/)

[modal_kit_render_button_action](https://modalkitwp.com/docs/hooks/modal_kit_render_button_action/)

[modal_kit_link_prefix](https://modalkitwp.com/docs/hooks/modal_kit_link_prefix/)

[modal_kit_close_label](https://modalkitwp.com/docs/hooks/modal_kit_close_label/)

[modal_kit_post_type_capabilities](https://modalkitwp.com/docs/hooks/modal_kit_post_type_capabilities/)

[modal_kit_pattern_categories](https://modalkitwp.com/docs/hooks/modal_kit_pattern_categories/)

[modal_kit_pattern_collections](https://modalkitwp.com/docs/hooks/modal_kit_pattern_collections/)

[modal_kit_pattern_collection_types](https://modalkitwp.com/docs/hooks/modal_kit_pattern_collection_types/)

[modal_kit_starter_settings](https://modalkitwp.com/docs/hooks/modal_kit_starter_settings/)

[modal_kit_backdrop_capability](https://modalkitwp.com/docs/hooks/modal_kit_backdrop_capability/)

[modal_kit_backdrop_request](https://modalkitwp.com/docs/hooks/modal_kit_backdrop_request/)

[modal_kit_optimizer_paths](https://modalkitwp.com/docs/hooks/modal_kit_optimizer_paths/)

[modal_kit_pro_listings](https://modalkitwp.com/docs/hooks/modal_kit_pro_listings/)

Pro · PHP hooks

[modal_kit_pro_providers](https://modalkitwp.com/docs/hooks/modal_kit_pro_providers/)

[modal_kit_pro_captcha_providers](https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_providers/)

[modal_kit_pro_captcha_hostnames](https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_hostnames/)

[modal_kit_pro_country](https://modalkitwp.com/docs/hooks/modal_kit_pro_country/)

[modal_kit_pro_country_sources](https://modalkitwp.com/docs/hooks/modal_kit_pro_country_sources/)

[modal_kit_pro_results_goal](https://modalkitwp.com/docs/hooks/modal_kit_pro_results_goal/)

[modal_kit_pro_results_count](https://modalkitwp.com/docs/hooks/modal_kit_pro_results_count/)

[modal_kit_pro_coupon_issued](https://modalkitwp.com/docs/hooks/modal_kit_pro_coupon_issued/)

[modal_kit_pro_visitor_address](https://modalkitwp.com/docs/hooks/modal_kit_pro_visitor_address/)

[modal_kit_pro_play_rate_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_play_rate_limit/)

[modal_kit_pro_form_daily_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_form_daily_limit/)

[modal_kit_pro_address_daily_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_address_daily_limit/)

[modal_kit_pro_events_rate_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_events_rate_limit/)

[modal_kit_pro_modal_events_per_hour](https://modalkitwp.com/docs/hooks/modal_kit_pro_modal_events_per_hour/)

Pro · Updates

[modal_kit_pro_is_staging](https://modalkitwp.com/docs/hooks/modal_kit_pro_is_staging/)

[modal_kit_pro_pre_rollback](https://modalkitwp.com/docs/hooks/modal_kit_pro_pre_rollback/)

[modal_kit_pro_tested_up_to](https://modalkitwp.com/docs/hooks/modal_kit_pro_tested_up_to/)

Editor filters · JavaScript

[modalKit.layouts](https://modalkitwp.com/docs/hooks/modalkit-layouts/)

[modalKit.triggerTypes](https://modalkitwp.com/docs/hooks/modalkit-triggertypes/)

[modalKit.triggerMenuGroups](https://modalkitwp.com/docs/hooks/modalkit-triggermenugroups/)

[modalKit.buttonActions](https://modalkitwp.com/docs/hooks/modalkit-buttonactions/)

[modalKit.canvasChrome](https://modalkitwp.com/docs/hooks/modalkit-canvaschrome/)

[modalKit.styleTarget](https://modalkitwp.com/docs/hooks/modalkit-styletarget/)

[modalKit.settingsTabs](https://modalkitwp.com/docs/hooks/modalkit-settingstabs/)

[modalKit.styleEditor](https://modalkitwp.com/docs/hooks/modalkit-styleeditor/)

[modalKit.toolsRows](https://modalkitwp.com/docs/hooks/modalkit-toolsrows/)

[modalKit.pickerPreview](https://modalkitwp.com/docs/hooks/modalkit-pickerpreview/)

[Docs](https://modalkitwp.com/docs/) / [Hooks](https://modalkitwp.com/docs/hooks/) / Pro · PHP hooks

# `modal_kit_pro_results_count`

filter

Pro

PHP

Decide whether a page sends Results events to your site. Turn it off for static exporters other than Simply Static, or on staging.

Runs while a page with a modal is built. When it returns false, the page gets no address to send events to, so nothing from it is counted on Results. Analytics services switched on under **Also send events to** still get their events.

Pro’s own answer is false when **Count results on this site** is off on **Modal Kit → Settings → Results**, for previews, for administrators when **Don’t count logged-in administrators** is on, and for Simply Static’s export requests (`?simply_static_page=`).

## Parameters

Parameter

Description

`$counts`

bool

Whether this page sends events.

## Returns

`bool` Whether it does, cast to a boolean.

## Examples

### Don’t count on staging

PHP

```
add_filter( 'modal_kit_pro_results_count', function ( $counts ) {
  return 'production' === wp_get_environment_type() ? $counts : false;
} );
```

### Another static exporter

Your exporter sends an `X-My-Export` header with each page it fetches, so the exported copies send nothing.

PHP

```
add_filter( 'modal_kit_pro_results_count', function ( $counts ) {
  return empty( $_SERVER['HTTP_X_MY_EXPORT'] ) ? $counts : false;
} );
```

Good to know

Returning true overrides Pro’s false for previews and administrators. It can’t switch counting on: while **Count results on this site** is off, the site refuses events.

Applied in `modal-kit-pro/includes/Results.php`.

Related

[`modal_kit_pro_results_goal`](https://modalkitwp.com/docs/hooks/modal_kit_pro_results_goal/)

[`modal_kit_pro_events_rate_limit`](https://modalkitwp.com/docs/hooks/modal_kit_pro_events_rate_limit/)

## Need a hook that isn’t here?

[Ask us](https://modalkitwp.com/support/)

[Developers overview](https://modalkitwp.com/developers/)
