コンテンツへスキップ
Jetpack

個別の製品

セキュリティ
VaultPress Backup Scan Akismet Anti-spam
パフォーマンス
サイト検索 Boost VideoPress
成長
Stats ソーシャル ニュースレター SEO Blaze CRM
管理
Manage モバイルアプリ

製品バンドル

Pro WordPressサイト向けのセキュリティ、パフォーマンス、成長支援ツールです。 完了 より高いサービス上限を備えたJetpackの全機能。
料金
概要 Jetpack AI がサイトにできること スキル エージェントに WordPress のスーパーパワーを ドキュメント AI エージェントの接続と設定 はじめに ChatGPT、Claude、コーディングエージェントを接続 比較 Jetpack と他の WordPress MCP コネクタの比較

エージェントを接続しよう。無料です。

ChatGPT や Claude を接続して、サイトの運営を任せましょう。有料プランは不要です。

ChatGPT 版を入手 (新しいタブで開きます) または Claude を使う (新しいタブで開きます)
サポート チームによるガイドとサポート ドキュメント Jetpack の各機能の使い方ガイド 機能リクエスト Request features and vote on ideas ブログ ニュース、製品の最新情報、使い方ガイド
概要
ログイン 始める
セキュリティ
VaultPress Backup Scan Akismet Anti-spam
パフォーマンス
サイト検索 Boost VideoPress
成長
Stats ソーシャル ニュースレター SEO Blaze CRM
管理
Manage モバイルアプリ

製品バンドル

Pro 完了
料金
概要 Jetpack AI がサイトにできること スキル エージェントに WordPress のスーパーパワーを ドキュメント AI エージェントの接続と設定 はじめに ChatGPT、Claude、コーディングエージェントを接続 比較 Jetpack と他の WordPress MCP コネクタの比較

エージェントを接続しよう。無料です。

ChatGPT や Claude を接続して、サイトの運営を任せましょう。有料プランは不要です。

ChatGPT 版を入手 (新しいタブで開きます) または Claude を使う (新しいタブで開きます)
サポート チームによるガイドとサポート ドキュメント Jetpack の各機能の使い方ガイド 機能リクエスト Request features and vote on ideas ブログ ニュース、製品の最新情報、使い方ガイド
概要 検索
ログイン 始める

ブログ / Developers

Hook of the Month: Customizing Contact Forms

Jeremy Herve のアバター

Jeremy Herve 3月 18, 2016 · 読了時間の目安: 1分


Did you know you could create contact forms with Jetpack? This month, we’ll discover different ways to customize these forms on your site.

Jetpack Subscriptions

Change the post-submission success message

Would you like to thank your readers after they submit a form on your site? Maybe you want to let them know that you’ll be in touch soon or maybe you want to confirm that their email address has been added to a raffle.

The grunion_contact_form_success_message filter allows you to specify a custom success message on each one of the forms on your site. In the example below, I’ve defined 2 custom success messages:

  • The first one is only displayed on the form displayed on page ID 1471.
  • The second appears on all other forms, and replaces Jetpack’s default success message.
function jetpackcom_contact_confirmation() {
	if ( is_page( '1471' ) ) {
		$conf = __( 'A special confirmation message for the form you added to page 1471', 'plugin-textdomain' );
	} else {
		$conf = __( 'A generic confirmation message to display for all the other forms', 'plugin-textdomain' );
	}
	return $conf;
}
add_filter( 'grunion_contact_form_success_message', 'jetpackcom_contact_confirmation' );
 

Redirect readers to a specific page after submission

Better than a custom success message, you can redirect your readers to a specific page on your site. As soon as they click the submit button, they can be redirected to a page of your choosing. For example, readers could be redirected to a page where they can claim a prize after giving you their contact information.

To create that redirection, we’ll use the grunion_contact_form_redirect_url filter. This filter allows us to set different redirection URLs for each form on your site.

/**
 * Jetpack Contact Form Custom Redirections.
 *
 * @param  string $redirect Post submission URL.
 * @param  int    $id       Contact Form ID.
 * @param  int    $post_id  Post ID.
 *
 * @return string $redirect Custom Post submission URL.
 */
function jetpackcom_custom_form_redirect( $redirect, $id, $post_id ) {
	/**
	 * Create a list of pages where you've inserted forms.
	 * For each contact Form ID (found via the id attribute on the form),
	 * set up a custom URL where the user will be redirected.
	 */
	$redirects = array(
		'1370' => home_url( 'page_on_your_site' ),
		'2239' => home_url( 'another_page' ),
		'1370' => home_url( 'page_on_your_site' ),
	);

	// Let's loop though each custom redirect.
	foreach ( $redirects as $origin => $destination ) {
		if ( $id == $origin ) {
			return $destination;
		}
	}

	// Default Redirect for all the other forms.
	return $redirect;
}
add_filter( 'grunion_contact_form_redirect_url', 'jetpackcom_custom_form_redirect', 10, 3 );
 

Customize the “Required” label

By default, Jetpack will display a “Required” text next to form fields that your readers are required to fill in before they can submit a form:

Required Jetpack form field

Sometimes, you might want to change “Required” into something else. That’s where the jetpack_required_field_text filter comes in:

 function jetpackcom_custom_required() {
 	return __( 'This is important, you must fill it in.', 'plugin-textdomain' );
 }
 add_filter( 'jetpack_required_field_text', 'jetpackcom_custom_required' );
 

The Contact Form module includes more than 20 other hooks in addition to the ones mentioned above. Check the code to learn more. You can also visit our support page to discover some of the other options available for customizing the contact form.

Do you want to dive deeper into Jetpack, and discover other useful hooks to help you customize Jetpack? Make sure to follow this blog and discover a new hook each month!

いいね 読み込み中…
Jeremy Herve のアバター

Written by

Jeremy Herve

WordPress, TV Series, music, kids, and board games. I think that's probably the best way to define me in a few words. 🙂 I work at Automattic where I lead a team building tools for bloggers and creators. I talk a lot about WordPress things, but also about all things open source in general. I live in Brittany, France, so you'll also find me sharing pictures from our beautiful region from time to time.

Jetpack のメリットを見る

Jetpack が WordPress サイトの保護、速度向上、成長にどう役立つかをご覧ください。

プランを見る

Questions about this post? Ask in the support forum

シェア


Keep reading.

More from Developers, newest first.

すべての投稿を見る

Developers 9月 2, 2026

Jetpack 16.1.3: Critical Security Update

Yesterday we released a ne…

Brandon Kraft のアバター Brandon Kraft 読了時間の目安: 2分

Developers 3月 5, 2026

How to Install WordPress on XAMPP + a Better Alternative

Learn how to install WordP…

Jen Swisher のアバター Jen Swisher 読了時間の目安: 8分

Developers 3月 3, 2026

How to Install WordPress on a Subdomain (Step-by-Step Guide)

Complete setup guide: How …

Jen Swisher のアバター Jen Swisher 読了時間の目安: 7分

AI ファーストで WordPress サイトを運営しよう。

Free to start, and AI agents are free to connect. Money back within 14 days on yearly plans.

始める Jetpack を無料で入手

WordPress プラグイン

  • Akismet アンチスパム↗ (新しいタブで開きます)
  • Jetpack↗ (新しいタブで開きます)
  • Jetpack ブースト↗ (新しいタブで開きます)
  • Jetpack CRM↗ (新しいタブで開きます)
  • Jetpack プロテクト↗ (新しいタブで開きます)
  • Jetpack 検索↗ (新しいタブで開きます)
  • Jetpack ソーシャル↗ (新しいタブで開きます)
  • Jetpack VideoPress↗ (新しいタブで開きます)
  • VaultPress バックアップ↗ (新しいタブで開きます)
  • WP Super Cache↗ (新しいタブで開きます)
  • ダウンロード

AI

  • Jetpack AI
  • スキル
  • WordPress MCP

パートナー

  • パートナープログラム
  • おすすめのホスティング事業者
  • ホスティング事業者向け
  • 代理店向け
  • アフィリエイト向け

開発者

  • ドキュメント↗ (新しいタブで開きます)
  • ベータプログラム
  • GitHub の Jetpack↗ (新しいタブで開きます)

ヘルプ

  • ナレッジベース
  • フォーラム↗ (新しいタブで開きます)
  • レビューとお客様の声
  • お問い合わせ
  • Jetpack について
  • プレス
言語を選択 日本語
  • English
  • Deutsch
  • Español
  • Français
  • 日本語

© 2026 Automattic Inc. 無断転載を禁じます。

  • 利用規約↗ (新しいタブで開きます)
  • プライバシーポリシー↗ (新しいタブで開きます)
  • GDPR

によって心を込めて制作されています。

App Storeからダウンロード Google Playで入手
コメントを読み込み中…
  • リブログ
  • 定期購入 開始日
    Jetpack
    53,352人の購読者に加わりましょう

    WordPress.com のアカウントをお持ちですか ? 今すぐログインしてください。

  • Jetpack
    短縮リンクをコピーReader で投稿を表示
    購読管理登録ログイン
    このコンテンツを報告
    このバーを折りたたむ
%d