---
title: "modal_kit_pro_captcha_hostnames – Modal Kit Docs"
description: "Accept bot check tokens solved on other hostnames, such as a static copy of the site that still sends its forms to this one."
language: "en-US"
canonical_url: "https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_hostnames/"
source_url: "https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_hostnames/"
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_captcha_hostnames`

filter

Pro

PHP

Accept bot check tokens solved on other hostnames, such as a static copy of the site that still sends its forms to this one.

Runs each time the site checks a bot check token: on the form relay and when a game with the check on is played. The provider reports the hostname the visitor solved the check on, and the site refuses the token unless that hostname is in this list.

By default the list holds the hosts of the **Site Address** and the **WordPress Address** (`home_url()` and `site_url()`).

## Parameters

Parameter

Description

`$hosts`

string[]

Hostnames, without a scheme or port.

## Returns

`string[]` The hostnames, compared in lower case. An empty array switches the hostname check off.

## Example

### Allow a static copy of the site

WordPress runs at `cms.example.com` and visitors see a static export at `www.example.com`, whose forms still go through this site.

PHP

```
add_filter( 'modal_kit_pro_captcha_hostnames', function ( $hosts ) {
  $hosts[] = 'www.example.com';

  return array_unique( $hosts );
} );
```

Good to know

Most providers also keep a list of allowed domains for each site key. Add the hostname there too, or the widget may refuse to load on it.

Tokens checked with a provider’s published test secret skip the hostname check, because they’re solved on the provider’s own test host.

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

Related

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

## Need a hook that isn’t here?

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

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