現状・条件
問題を把握
Google Search Console ナビゲーション パネルの「拡張 → AMP」メニューをクリックすると、下記のようなエラーが出ています。

▲「許可されていない属性または属性値が HMTL タグにあります。」テキストをクリックします。

▲ ページ下の「例」を見るとエラーが出ている URL でエラー個所を把握しましょう。
※ https://www.example.com/contact/?amp=1 ← contact はお問い合わせページである!
問題の原因を探る
▼ 問題のお問い合わせページが正しい AMP ページか AMP テスト で検証して見ると、お問い合わせページは「有効な AMP ページではあいりません」と!
何故なの?

▲「検証の問題」部分にその原因が書いてあります。
問題の原因を特定
原因:属性「action」はタグ「FORM [method=POST]」で使用できません。
なるほど!!
言わば、ユーザがお問い合わせるとプログラムで処理するんですが、その方法が普通のウェブページでは OK だが、AMPページではダメですよと。。
確か、属性「action」→「action-xhr」に変更する必要があるようですが、それはプラグインの作成者にやってもらわないと。。( 対処外 )
代案として、お問い合わせページ自体を AMP ページから外します!
問題を修正
WordPress 管理画面から、
・押下:「固定ページ」>「固定ページ一覧」> 「お問い合わせ用ページ」

・ページ内:
固定ページの編集画面を下までスクロールします。
右側に「AMP 設定」メニューの「AMPページを生成しない 」にチェックを入れます。
「更新」ボタンをクリックします。


「お問い合わせ」ページが実際に AMP ページから除外されたか、AMP テスト ( ▲ )で「AMP ページではありません」と表示されれば OK です。
それでは、Google Search Console 側に、修正を検証するように依頼しましょう。
Google Search Console で修正を検証
Google Search Console にアクセスして下さい。
ナビゲーション パネルの「拡張 → AMP」メニューをクリックします。
▼「詳細」のエラー内容をクリックして下さい。

「修正を検証」ボタンをクリックします。

検証を開始するとメールで案内してくれます。

検証結果を待ちましょう!
※ 下記の記事は今回の件とすごく似ています。ご参考ください。
[2019/08/08 追記] 検証結果が来ました。問題はクリアされました!

コメント