How to display Exit Splash or Exit message for wordpress Blog or website
Step 1: Copy the below script and paste inside the <head> </head> tags of your website or blog header. If it’s a wordpress blog, in the themes – > header.php would contain both the header and the body tags.
function CreateCookie(name, value, expiredays)
var todayDate = new Date();
todayDate.setDate(todayDate.getDate() + expiredays);
document.cookie = name + ” = ” + value + “; expires=” +
todayDate.toGMTString() + “;”;
var numOfCookies = document.cookie.length;
var nameOfCookie = cookiename + “=”;
var cookieLen = nameOfCookie.length;
while (x <= numOfCookies)
var y = (x + cookieLen);
if (document.cookie.substring(x, y) == nameOfCookie)
x = document.cookie.indexOf(” “, x) + 1;
if (x == 0)
if ((endOfCookie = document.cookie.indexOf(“;”,val)) == -1)
endOfCookie = document.cookie.length;
return unescape(document.cookie.substring(val, endOfCookie));
// This is what the prompt will ask the visitor when they leave your website.
if (confirm(” We would request you to sign up for the OrangeCopper Blog weekly newsletter before leaving – Click OK “))
// This is what the prompt will say if they choose to see what you asked above.
alert(” Thank you! Please fill your email in top right corner form on the Blog page loading “);
// This is what the prompt will say if they choose to not see what you asked
alert(” No Problem, see you again Good Luck! “);
var userCookie = ReadCookie(“_chups”);
if (userCookie == null)
// User is here at first time
// propose to visit site
//create coockie key (30 days)
CreateCookie(“_chups”, 1, 30);
Find the <Body> tag in your webpage or blog header.php and replace it with
Upload and you are done!! (feel free to edit the exit messages marked in blue as per your requirement).
Note: I thought this could help you and save a lot of time and money as there are websites who even charge for plugins and scripts that is as simple as this. Cheers !!
Site Tool Center(script credit)