Webmaster Area·Age Verification Generator

Age Verification Generator

Generate a customizable age gate for your adult website

Remember user choice (cookie, 30 days)
Include "Exit" button (redirects to Google)

Use [age] as a placeholder for the minimum age value.

My Site

This website contains age-restricted materials. By entering, you confirm you are at least 18 years old.

<!-- Age Verification Gate - Generated by Porn-Directory.net -->
<div id="age-gate-overlay" style="
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
">
  <div style="
    background: #1a1a1a;
    color: #ffffff;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 40px;
    max-width: 460px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  ">
    <h1 style="
      font-size: 24px;
      font-weight: 700;
      margin: 0 0 8px 0;
      color: #ffffff;
    ">My Site</h1>
    <div style="
      width: 50px;
      height: 3px;
      background: #BC1521;
      margin: 0 auto 20px;
      border-radius: 2px;
    "></div>
    <p style="
      font-size: 15px;
      line-height: 1.6;
      color: #aaa;
      margin: 0 0 28px 0;
    ">This website contains age-restricted materials. By entering, you confirm you are at least 18 years old.</p>
    <div style="display: flex; flex-direction: column; gap: 12px;">
      <button id="age-gate-enter" style="
        display: block;
        width: 100%;
        padding: 14px 32px;
        font-size: 16px;
        font-weight: 700;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        background: #BC1521;
        color: #ffffff;
        transition: background 0.2s;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      " onmouseover="this.style.background='#9e0003'" onmouseout="this.style.background='#BC1521'"
      >I am 18+ - Enter</button>
      <button id="age-gate-exit" style="
        display: block;
        width: 100%;
        padding: 14px 32px;
        font-size: 15px;
        font-weight: 600;
        border: 2px solid #aaa;
        border-radius: 6px;
        cursor: pointer;
        background: transparent;
        color: #aaa;
        transition: opacity 0.2s;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      ">Exit</button>
    </div>
  </div>
</div>

<script>
(function() {
  
  function setAgeCookie() {
    var d = new Date();
    d.setTime(d.getTime() + (30 * 24 * 60 * 60 * 1000));
    document.cookie = "age_verified=1;expires=" + d.toUTCString() + ";path=/;SameSite=Lax";
  }

  function hasAgeCookie() {
    return document.cookie.split(";").some(function(c) {
      return c.trim().indexOf("age_verified=") === 0;
    });
  }

  if (hasAgeCookie()) {
    var overlay = document.getElementById("age-gate-overlay");
    if (overlay) overlay.style.display = "none";
    return;
  }

  document.getElementById("age-gate-enter").addEventListener("click", function() {
    setAgeCookie();
    document.getElementById("age-gate-overlay").style.display = "none";
  });
  
  document.getElementById("age-gate-exit").addEventListener("click", function() {
    window.location.href = "https://www.google.com";
  });
})();
</script>
<!-- End Age Verification Gate -->

Paste this code right after the opening <body> tag in your HTML.

  • 1.Cookie-based verification is the minimum standard. Most adult sites use this approach. The generated code sets a 30-day cookie so returning visitors are not asked again.
  • 2.Some jurisdictions require actual age verification. Regions like the UK, France, and certain US states may require ID-based verification. This tool generates a basic disclaimer gate only -- consult local laws for stricter requirements.
  • 3.Always include an exit option. Providing a clear way to leave (typically redirecting to a safe site like Google) is expected by regulators and ad networks.
  • 4.Add an RTA label meta tag. The Restricted to Adults (RTA) label helps parental control software filter your site. Add this to your <head>:
  • <meta name="RATING" content="RTA-5042-1996-1400-1577-RTA">
  • 5.Set up a proper robots.txt. Use our Robots.txt Generator to configure search engine crawling and complete your compliance setup.
  • 6.Generate proper meta tags. Use our Meta Tag Generator to add the RTA label and other SEO tags to your site in one step.