SAFETY EXIT OR QUICK EXIT BUTTON
A safety exit or quick exit button is ideal for websites dealing with sensitive subjects such as domestic violence, rape, child abuse and others. When the user clicks the button they will instantly redirected to a URL of your choosing and a new tab / window will be opened to a URL of your choosing.
The code below works for html. You can copy paste and make changes. You can replace the url for the button destination
<!DOCTYPE html>
<html lang=”en”>
<body>
<button onclick=”safetyExit()”>
Safety Exit
</button>
<script>
function safetyExit() {
// change the document to
// Google homepage
location.replace(
“https://google.com”);
}
</script>
</body>
</html>
HOW TO ADD THIS CODE ON WORDPRESS USING ELEMENTOR
- Open your elementor code editor for the page where you want the button to appear, mostly it’s on the homepage.
- Get the html element from the elementor elements.
- Paste the code in the HTML editor.
- Click on update to save.
- Go to the page where you make the changes and click on the button.
The button will take you to any url that you chose. Once the button is clicked, you cannot go back to the previous page (meaning you have successfully replace your page with the new url)
You can add styling to the button using CSS.
Hope this solves or resolves your safety button problem. Kindly let me know if you need extra help implementing this on your website.
Thank you.