PoPIA Consent Popup

Aug 7, 2025 | POPI ACT, Wordpress

Categories

⏱ Estimated Reading Time: 5 minutes

PoPIA Consent Popup module

Add a POPIA Consent Popup without a plugin! This guide shows how to add a simple code-based banner to your website for user consent.

Index

What is PoPIA Consent
Why you need user consent
Copy the code
Frequently Asked Questions
Pro Tips
Useful Links

What is a POPIA Consent Popup Module?

A POPIA Consent Popup is a banner or popup that informs users your website collects personal information (like via forms, cookies, or contact tools) and requests their consent. It’s a way to notify users about data collection in compliance with South Africa’s Protection of Personal Information Act (POPIA).

It usually appears when a user first visits the website and includes a short message with a link to your Privacy or Cookie Policy and a button to acknowledge or accept.

Why You Need a POPIA Consent Popup Module

If your website collects any form of personal information—such as names, emails, or tracking data—you’re required under POPIA to inform users and get their consent.

A consent popup:

  • Builds trust with your visitors
  • Shows transparency in how data is handled
  • Helps align your website with privacy expectations
  • Can improve compliance with platforms like Google or Facebook

Even if you’re not running an online store, something as simple as a contact form or embedded video may be collecting personal info. A POPIA Consent Popup shows you take user privacy seriously.

PoPIA Consent Popup Code

Paste this popup code in Divi > Theme Options > Integration > Head section

If you don’t have Divi, use a plugin like “Header and Footer Scripts”

  1. Install the plugin “Insert Headers and Footers” by WPCode or similar.
  2. Go to Settings > Insert Headers and Footers.
  3. Paste the popup code below into the “Header” section (for scripts that go in <head>)
  4. Save changes.
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        /* Popup container */
        .popup {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 499;
        }

        .popup-content {
            background: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
            text-align: center;
            max-width: 400px;
        }

        .close-btn {
            background: green;
            color: white;
            border: none;
            padding: 10px 20px;
            cursor: pointer;
            border-radius: 5px;
            margin-top: 10px;
        }
    </style>
</head>
<body>

<div id="consentPopup" class="popup" style="display: none;">
    <div class="popup-content">
        <p>We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By using our website you consent to the use of our Cookie and Privacy Policy as well as our Terms and Conditions which can be found at the bottom of every page.</p>
        <button class="close-btn" onclick="closePopup()">I Accept</button>
    </div>
</div>

<script>
    function closePopup() {
        document.getElementById('consentPopup').style.display = 'none';
        localStorage.setItem('popupLastShown', Date.now()); // Store current timestamp
    }

    function shouldShowPopup() {
        let lastShown = localStorage.getItem('popupLastShown');
        let oneHour = 60 * 60 * 1000; // 1 hour in milliseconds

        if (!lastShown || (Date.now() - lastShown) > oneHour) {
            document.getElementById('consentPopup').style.display = 'flex';
        }
    }

    document.addEventListener("DOMContentLoaded", shouldShowPopup);
</script>

</body>

Click here to learn how to create Child Theme for Divi Themes

Frequently Asked Questions

Will code slow my website?+
No. The snippet is lightweight and loads instantly, so it won’t affect your website speed noticeably.
Will this affect SEO rankings?+
No, because the code is purely front-end display, it doesn’t impact SEO.
Can I change popup display frequency?+
Yes, tweak the localStorage time interval in the JavaScript to control how often it shows.
Can I change the text?+
Yes, the text in this module is only a standard and you can edit the text as you like.
Why should my website have a PoPIA consent?+
You have to notify user’s of what you are doing with their information wheter you use it or not. Read more about PoPIA Compliancy here.

Have Questions of your own? Contact us

💡 Pro Tips

Use child theme for styles.
Draft and Publish Privacy Policy
Draft and Publish Cookie Policy
Draft and Publish Terms & Conditions
Have a Cookie consent popup module