How Do I Add An Age Warning To An Adult Personal Brand Site?
OxyPages does not add an age warning for you. If your site is an adult personal brand site, add your own warning page to your site's code, for example an index.html that asks visitors to confirm they are 18 or over and a short script at the top of every other page. A click-through warning is a notice, not age or identity verification.
Updated
OxyPages does not add an age warning page for you. Our Terms of Service (Section 12.8) require an adult personal brand site to show a warning page before any other page, and you build that page into your own site. It is one extra HTML file and a few lines of script on each of your other pages.
The warning page must tell Visitors the site is for adults only and ask them to confirm they are 18 or over, or the age of majority where they are if that is higher, before they enter.
Step 1: Make The Warning Page Your Home Page
Rename your current home page from index.html to home.html. Then add a new
index.html with the warning:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Adults Only - Please Confirm</title>
<style>
body { margin: 0; min-height: 100vh; display: grid; place-items: center;
padding: 24px; font-family: system-ui, sans-serif;
background: #111; color: #f5f5f5; }
.box { max-width: 440px; text-align: center; line-height: 1.5; }
.actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.actions button, .actions a { padding: 12px 20px; border-radius: 8px; font-size: 16px; text-decoration: none; }
.actions button { background: #f5f5f5; color: #111; border: 0; cursor: pointer; }
.actions a { color: #f5f5f5; border: 1px solid #f5f5f5; }
</style>
</head>
<body>
<main class="box">
<h1>This website is for adults only</h1>
<p>It contains material intended only for adults. By entering, you confirm
that you are 18 or older, or the age of majority where you live if that
is higher, and that you agree to view it.</p>
<div class="actions">
<button id="enter" type="button">I Am 18 Or Older, Enter</button>
<a href="https://www.google.com">Leave</a>
</div>
</main>
<script>
document.getElementById("enter").addEventListener("click", function () {
sessionStorage.setItem("adults-ok", "yes");
var next = new URLSearchParams(location.search).get("next") || "";
// Only a plain path on this site, never another website.
var safe = /^\/[A-Za-z0-9._~\/-]*$/.test(next) && next.indexOf("//") !== 0;
location.href = safe ? next : "/home.html";
});
</script>
</body>
</html>
Step 2: Send Visitors Who Skipped It Back
Paste this at the very top of the <head> of every other page (home.html,
about.html and so on):
<script>
if (sessionStorage.getItem("adults-ok") !== "yes") {
location.replace("/?next=" + encodeURIComponent(location.pathname));
}
</script>
A visitor who opens an inner page directly sees the warning first, then lands back on the page they asked for.
Point any "Home" link and your logo at /home.html, not /, which is now the
warning page.
Step 3: Upload And Test
Upload the site as usual (see updating your website). Then open it in a private window and check that every page shows the warning first, and that Enter and Leave both work.
If your project is built with a framework (React, Vue, Astro and so on), put the same check in the code that runs first on every page, or add a warning screen to your app's layout.
What This Does And Does Not Do
- It is a notice, not age or identity verification. Anyone can click Enter. That is why the content itself must stay non-explicit under Section 12.8. Explicit content is not allowed on OxyPages, with or without a warning page.
- The answer lasts for the visit.
sessionStoragekeeps it until the tab or browser is closed. It stays in the visitor's own browser and is not sent anywhere. - JavaScript off means no redirect. A visitor with scripts switched off can still read an inner page by typing its address.
- Direct file links are not covered. A link straight to a photo opens the photo.
- Search engines mostly see the warning page, so expect inner pages to rank less well.
- A password is not a warning page. Password protection hides a site from everyone without the password, which is different from asking Visitors to confirm their age.
For what adult personal brand sites may and may not contain, read Section 12.8 of the Terms of Service.