Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

GDPR/CCPAのためにWordPressでCookieポップアップを追加する方法

WordPressサイトが訪問者のブラウザーにCookieを設定している可能性があることをご存知ですか?欧州連合のGDPRのようなさまざまな規制では、コンピューターにCookieを設定する前にユーザーの同意を得ることをサイトに義務付けています。

WordPressでは、さまざまなプラグインを使用して簡単にクッキーの同意を設定することができます。私たちは複数のツールをテストし、私たち自身のウェブサイトに実装しましたが、最良の選択肢はWPConsentとCookie Noticeであることがわかりました。

この投稿では、WordPressでCookieポップアップを追加する方法を紹介します。

How to Add cookies popup in WordPress

ブラウザーCookieは、ウェブサイトがユーザーのブラウザーに保存するために送信するデータを含む小さなファイルです。ほとんどのWordPressサイトは、さまざまな目的でCookieを設定しています。

例えば、初期設定では、WordPressは認証目的でCookieを使用し、ログイン中のユーザーのセッション情報を保存します。また、誰かがサイトにコメントを残すとCookieが設定されます。

これらとは別に、WordPressプラグインは、異なる情報を保存したり、リピーターを認識したりするために、独自のCookieを設定することもできます。

WordPressサイトがCookieを使用しているかどうかを確認する方法をご覧ください。

Cookieは非常に便利ですが、ユーザーに関する情報を収集し、サードパーティの広告プラットフォームと共有するために使用されることもあります。

そのため、ヨーロッパをはじめとするいくつかの国では、サイト所有者がクッキーの使用についてユーザーに知らせることが必須となっています。あなたのサイトがこれらの地域のオーディエンスをターゲットにしている場合、Cookie同意の免責事項を表示する必要があります。

Cookie notice preview

それを行う最も簡単な方法は、WordPressのGDPRプラグインを使用することです。WPConsentとCookie Noticeは最も人気のあるクッキー通知プラグインの2つで、他の多くの人気のあるWordPressプラグインと互換性があります。

とはいえ、WordPressでCookie同意ポップアップを簡単に表示する方法を見てみましょう。

WordPressウェブサイトにクッキーのポップアップを追加する最良の方法は、WPConsentを使用することです。

WPConsentを使えば、ウェブサイトのデザインに合わせたカスタムクッキーの同意ポップアップやバナーを簡単に作成できます。

さらに、警告を表示するだけのほとんどのクッキー通知プラグインとは異なり、WPConsentは、訪問者が同意を与えるまで、すべてのトラッキングスクリプトとクッキーを自動的にブロックすることで、ユーザーのプライバシーを実際に保護します。これは、あなたのサイトがGDPR法令に適切に従うことを保証するのに役立ちます。

プラグインについてさらに詳しく知りたい方は、WPConsentのレビューをご覧ください。

注: WPConsentには無料版もあります。しかし、このチュートリアルでは、より高度な機能を備えたProバージョンを使用します。

始めるには、WPConsentプラグインをインストールして有効化する必要があります。ヘルプが必要な場合は、WordPressプラグインのインストール方法のステップバイステップガイドをご覧ください。

プラグインが有効化されると、簡単なオンボーディングウィザードが起動します。さっそく「Let’s Get Started」ボタンをクリックして、5分でプラグインをセットアップしましょう。

Click the Let's Get Started button to use the setup wizard

まず、ライセンスキーを「ライセンスキー」フィールドにコピー&ペーストし、「キーを確認」ボタンをクリックしてください。ライセンスキーはWPConsentウェブサイトのアカウントエリアにあります。

ライセンスキーが認証されたら、「Scan Your Website」ボタンをクリックしてください。

Enter your license key and scan your website

WPConsentは次に、クッキーを使用している可能性のある既知のサードパーティスクリプト、コア機能、WordPressプラグインについて、ウェブサイト全体をスキャンします。

スキャンが終了すると、WPConsentはクッキーを設定したサービスの数を通知します。それらを確認するには「OK」ボタンをクリックしてください。

Completed WPConsent scan

これで、ウェブサイト上でどのサービスがクッキーを使用しているかを確認できます。私たちのテストサイトでは、WordPressのコメントとWPFormsがクッキーを使用していることがわかります。

Auto-Configure Selected(選択したサービスを自動設定する)」ボタンをクリックすると、検出されたサービスの説明、クッキーの持続時間、データポリシーURLなど、すべてのクッキーとプライバシー情報が自動的にインポートされ、設定されます。

Auto-configure the services that are using cookies on your site

クッキーデータが設定されたので、あなたのウェブサイトに表示するクッキーのポップアップやバナーのレイアウトと位置を選択できます。

Choose the cookie popup layout

レイアウトを選択すると、ページをスクロールしてプレビューを見ることができます。

ここから、クッキー・バナーのデザインに満足したら、「保存してセットアップを完了する」をクリックできます。または、「さらにバナースタイルを設定する」を選択して、クッキーポップアップをカスタマイズすることができます。

Further configure banner styles

Cookieポップアップ通知のカスタマイズ

さらにバナースタイルを設定する」をクリックすると、WPConsent ” バナーデザインページに移動します。

ここから、背景色、テキスト色、フォントサイズ、ボタンタイプ、ボタン色など、クッキーポップアップのスタイルを変更できます。

保存」ボタンをクリックして、スタイル設定の変更を保存することを忘れないでください。

Configure WPConsent cookie banner style settings

次に、「コンテンツ」タブをクリックして、クッキーのポップアップメッセージをカスタマイズできます。また、ページをスクロールして、ボタンテキストを編集し、ボタンの順序を変更し、ロゴやアイコンをアップロードすることもできます。

デザインに満足したら、「保存」ボタンをクリックします。

Edit the cookie popup message

これで、あなたのWordPressウェブサイトを訪問して、クッキーポップアップがどのように見えるかを実際に見ることができます。

See the cookie popup live on your WordPress website

WordPressサイトにクッキーポリシーを追加する

また、ウェブサイトのプライバシーポリシーにクッキーの宣言を追加する必要があります。プライバシーポリシーページをまだ作成していない場合は、WordPressでプライバシーポリシーページを作成する方法のガイドに従ってください。

WPConsentはクッキーポリシーを簡単に作成できます。あなたのウェブサイトを自動的にスキャンしてすべてのアクティブなクッキーを検出し、各クッキーの目的、期間、種類を文書化した詳細なクッキーポリシーを生成します。

クッキーポリシーを設定するには、WordPressの管理エリアからWPConsent ” ダッシュボードに行き、「クッキーポリシー」の隣にある「設定」ボタンをクリックします。

Configure cookie policy in WPConsent

これでWPConsentの「設定」ページが表示されます。ここからページを下にスクロールし、「クッキーポリシー」セクションまで進んでください。

ドロップダウンメニューから、クッキーポリシーに使用するページを選択できます。このチュートリアルでは、プライバシーポリシーページにクッキー宣言を追加します。

また、WPConsentが提供するショートコードをコピーする必要があります。

Select cookie policy page

ページ下部の「変更を保存」ボタンを忘れずにクリックしてください。

次に、プライバシーポリシーページを編集し、クッキー宣言を表示したい場所にショートコードを挿入するだけです。

Enter cookie declaration shortcode

クッキー宣言を見るには、ページを保存してプレビューする必要があります。これが、私たちのテストウェブサイトでの最初の数段落の見え方です:

Example of cookies policy page

方法2: クッキーポップアップにクッキー通知を追加する

Cookie Noticeを使えば、WordPressサイトにクッキーのポップアップを追加することもできます。これは使いやすい無料のプラグインです。ただし、WPConsentほど機能は豊富ではありません。

まず、Cookie Notice & Compliance for GDPR / CCPAプラグインをインストールして有効化する必要があります。詳しくは、WordPressプラグインのインストール方法のステップバイステップガイドをご覧ください。

有効化したプラグインは、追加設定なしで、訪問者に基本的なCookieポップアップをすぐに表示し始めます。初期設定のメッセージはほとんどのサイトに適しています。

Cookie notice default message

通知をカスタマイズしたい場合は、WordPressダッシュボードのCookieメニュー項目にアクセスする必要があります。

ここから、通知設定のセクションまでスクロールダウンするだけです。

Edit cookie notice message

このページでは、ポップアップメッセージとボタンのテキストをカスタマイズできます。

プライバシーポリシーページへのリンクを追加することもできます。まだ作成していない場合は、WordPressでプライバシーポリシーページを作成する方法をご覧ください。

その後、プライバシーポリシーのドロップダウンメニューからそのページを選択することができます。

Enable privacy policy link

WordPressのCookieプラグインは、訪問者が同意を拒否したり取り消したりする設定も提供します。

そのためには、「同意を拒否する」と「同意を取り消す」のチェックボックスをクリックするだけです。初期設定でほとんどのサイトに対応できます。

Refuse consent settings

通知のデザイン」セクションまでスクロールダウンすると、Cookie同意ポップアップの位置、アニメーション、ボタンのスタイル、および色を選択できます。

ボタンクラスを設定して、ポップアップにカスタムCSSを追加することもできます。

Edit design of notice

設定が完了したら、最後に「変更を保存」ボタンをクリックして設定を保存します。

これで、あなたのサイトにアクセスして、Cookie同意ポップアップを実際に見ることができます。

Cookie notice default message

ボーナス:MonsterInsightsでGDPRコンプライアンスを向上させる

MonsterInsightsはWordPressサイトに最適な分析ソリューションです。また、GDPRやその他のプライバシー規制へのコンプライアンスを向上させる最も簡単な方法です。

それは、MonsterInsightsがすぐに使えるEU Complianceアドオンを提供しているからです。MonsterInsightsが提供するEUコンプライアンスアドオンは、あなたのアナリティクス設定を自動的に変更し、個人情報保護法の遵守を支援します。

The MonsterInsights Google Analytics plugin

EUコンプライアンスアドオンはプレミアムプランに含まれています。最大の特徴は、Cookie NoticeとCookiebotの両方と自動的に統合されることです。

詳しくはMonsterInsightsのレビューをご覧ください。

最初のステップは、MonsterInsightsプラグインをインストールし、Googleアナリティクスアカウントに接続することです。詳しくは、MonsterInsightsを使ったGoogleアナリティクスのインストール方法をご覧ください。

MonsterInsightsをインストールしてセットアップしたら、EU Complianceアドオンをインストールして有効化する必要があります。

WordPress ダッシュボードのInsights ” Addonsページにナビゲーションしてください。次に、EU Complianceアドオンを見つけて、「インストール」ボタンをクリックします。

MonsterInsights EU compliance addon

アドオンは自動的に有効化されます。

MonsterInsightsの ” 設定 “ページで、”エンゲージメント “タブに切り替えることで確認できます。

EU Complianceセクションを見ると、アドオンがオンになっていることがわかります。

View EU compliance settings

画面の右側にある下矢印をクリックすると、アドオンがサイトに加えた設定変更の詳細なリストを見ることができます。

例えば、GoogleアナリティクスにおけるIPアドレスの自動匿名化、デモグラフィック、インタレストレポートの無効化、UserIDトラッキングの無効化などです。

View EU compliance settings in MonsterInsights

次に、MonsterInsightsとCookie NoticeやCookieBotのような様々なCookieプラグインとの互換性を見るためにスクロールダウンすることができます。

MonsterInsightsは、サイトにプラグインがインストールされている場合、自動的にGoogleアナリティクスのトラッキングコードを変更します。これにより、Googleアナリティクスでユーザーをトラッキングする前に、同意を得ることができます。

Compliance plugin integration

この投稿がWordPressサイトにCookie同意ポップアップを追加するのにお役に立てば幸いです。WordPressでYes/Noオプトインを作成する方法のステップバイステップガイドとWordPressに最適なポップアッププラグインもご覧ください。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

アバター

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

25件のコメントLeave a Reply

  1. Ralph

    Thank God there are plugins for that. I wish we as a whole internet could get rid of all that cookies, gdpr and other things and replace it with one but only one thing. It is absurd when we visit new website and before we even see content we have to close so many pop-ups.

    • WPBeginner Support

      It may be annoying but the GDPR was set up with good intentions, hopefully there will be better implementations as time goes on.

      Admin

  2. Chanel Burth

    Thank you for the article. Does this plugin give the option for people to accept or decline?

    • WPBeginner Support

      It does not as that would require it to interact with everything that sets a cookie and have the power to disable it which isn’t something a plugin would have easily.

      Admin

  3. Elliot Jolesch

    This article was very helpful but I wonder if it’s a little out of date.

    The plugin that you recommended, GDPR Cookie Consent Banner, has not been tested for the latest version of WP and apparently hasn’t been updated in 11 months.

    Are you planning an update to this article?

  4. Stephanie

    Thank you this was really helpful. One thing done on the site in under 5 minutes. Amazing!

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  5. Declan Howard

    How do I make sure my website does not drop cookies into a visitor’s computer? I do not need to do this.

    • WPBeginner Support

      It would depend on what tools and plugins you are using on your site, you would want to reach out to those to see if they add any cookies or not.

      Admin

  6. Deb Smith, Small Details

    We can ALWAYS count on WPBeginner to give us solid plugin recommendations. I’ve been a “beginner” for over a decade haha!

    • WPBeginner Support

      Thank you, glad our articles have been helpful :)

      Admin

  7. Farukh Hussain

    Hi,
    Thanks for sharing this useful post. However, many plugins make site loads slower. Can you please suggest some code to display this notification.

  8. Aurora

    Can you recommend a way to add a cookie consent without the use of a plugin? My site has too many plugins already.

  9. Sarah A

    Hi,
    Can you recommend a cookie consent for ‘opt in’ that is suitable for the new GDPR law?

  10. Julia

    Hi,
    I’m trying to set up an e-commerce website and have to comply with EU law regarding the use of cookies. How can I find out which cookies my website is using?
    Thanks

  11. Samuel

    Hi,

    I’m looking for a pop up box that imitates the one on the gucci website as it is a square, do you know of any?

  12. kulbir singh kang

    hi me kulbir singh

    something problem in my website ,,,,,when i open to this ,,it is automatically redirect on another multi pal site ,,,,when i open second time it is working properly

    and if when i clear cache cookies of browser (problem in all browser) ,then i go to ,,,same problem display on system

    please visit on my website ,,,and please tell me ,,,, what is solution of this problem

    is this problem of cookies or not ,,,,

  13. Maninder Pal Singh

    Thank you wpbeginner. I was looking for something exactly like this. Light weight plugin with a simple notification for the cookie policy.
    Thanks.

  14. Muhammad Ishfaq

    Thanks the post, the plugin works perfectly on all of my websites including link to the policy page.

  15. Eva B

    It has a glitch. The link to the policy page goes to an error page. I double-checked my spelling and looked on their support forum. There I saw that others left the same request for a fix. No response from developer. This plugin still works for me, but without the link.

    • WPBeginner Support

      @Eva thank you for notifying us, we have tried to contact plugin author as well. It seems like the plugin author didn’t mean to add this functionality. Currently the plugin is only good for adding a simple notification without a link, which satisfies the requirement for the cookie law in most EU countries. However, there should be a link so that users can read privacy policy.

      Admin

  16. Keith Davis

    Looks good guys and the developer says it is lightweight.
    I think I should be using this.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.