@kenji-workdesk

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

Contact Form 7が送信できず、404エラーになる

以前も質問しましたが回答がつかなかったため、内容を短くして再投稿します。

解決したいこと

Contact Form 7 を TranslatePress で多言語化して使っています。
日本語ページは正常に送信できるのに、英語ページ(/en/ 配下)だけ送信中のぐるぐるが終わらず、完了メッセージが表示されません。

発生している問題・エラー

日本語ページ /contact/ → 成功(200 OK)
英語ページ /en/contact/ → 失敗(404 エラー)

POST https://example.com/wp-json/contact-form-7/v1/contact-forms/XXXX/feedback 404 (Not Found)

自分で試したこと

日本語用・英語用フォームを分けて、それぞれショートコードを貼り付け
TranslatePress の .wpcf7 翻訳除外設定
キャッシュ削除、関連プラグイン停止、WP_MEMORY_LIMIT 増加
シンプルなメールアドレス入力フォームを新規作成 → 日本語は成功、英語はやはり失敗

1 likes

3Answer

Contact Form 7 を TranslatePress で多言語化して使っています。

Contact Form 7 とか全く分かりませんが、HTTP 404 エラーということで一言。

404 応答が返ってくるということは、名前解決ができてクライアントからの要求はサーバーに届き、サーバーで url に指定されているリソースを探したが見つからなかったということです。原因はほとんどが指定した url が間違っているということです。

間違いには、単純なスペルミス、相対パスの使い方の間違い、サーバーでのルーティングの間違い、フレームワークが指定するフォルダに無い、要求先サーバーを間違えたなどがあります。

他には、url は合っているがサーバーで処理中に何らかの問題があった時 (例えば DB にレコードがなかったとか) 404 応答を返すというようにプログラムされているケースもあるかもしれません。

いずれにせよほとんどは質問者さんでないと分からないことです。なので、まず質問者さんの方で、上記の辺りを調べてください。

1Like

It’s true that a 404 means the endpoint can’t be found, but in the case of Contact Form 7 with TranslatePress the cause is more specific. The form submission works in the default language but fails in English because the REST API endpoint is being translated. The request ends up pointing to /en/wp-json/contact-form-7/v1/... instead of the original /wp-json/... route, which does not exist.

To fix this:

Go to TranslatePress → Settings → Advanced and exclude /wp-json/ from translation.

Re-save permalinks under Settings → Permalinks. This refreshes the REST routes.

Double-check that the form shortcode in English is pointing to the correct Contact Form 7 ID.

Most people focus on cache or plugin conflicts, but the real solution here is making sure the REST endpoints are not translated. Once excluded, the 404 on the English form disappears.

1Like

すみません、色々な方に頼って解決いたしました。
色々プログラムをいじっても改善しませんでしたが、
Tlanslatepressの設定画面で、添付の赤枠にチェックを入れることで改善いたしました。

チェックの内容としては、以下です。msg.png

✅不足している動的コンテンツを修正
✅動的翻訳を無効にする

今後ともよろしくお願いいたします。

0Like

Your answer might help someone💌