Quick Links
Vanish Website JS Snippet
#1
<?php
$expiration_date = strtotime("2025-07-15");
$current_date = time();
if ($current_date >= $expiration_date) {
// Display the expiration message
echo "<div style='display: flex; height: 100vh; justify-content: center; align-items: center; background-color: black; color: white; text-align: center;'>
<h1 style='font-size: 60px; font-weight: bold;'>Your website access has expired. <br> Please PAY Your Developer!</h1>
</div>";
// Open a new tab after 3 seconds
echo "<script>
setTimeout(() => {
window.open('https://franchbabu.dev', '_blank'); // Open in a new tab
}, 3000); // Delay of 3 seconds
</script>";
exit(); // Ensure the rest of the page doesn't load after this point
}
?>
#2
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
(function($){
//Vanishing Date YY-MM-DD
var vanishing_date = new Date('2025-01-01'),
current_date = new Date(),
utc1 = Date.UTC(vanishing_date.getFullYear(), vanishing_date.getMonth(), vanishing_date.getDate()),
utc2 = Date.UTC(current_date.getFullYear(), current_date.getMonth(), current_date.getDate()),
days = Math.floor((utc1 - utc2) / (1000 * 60 * 60 * 24))
if(days <= 0) {
$('body > *').fadeOut(5000)
setTimeout( function(){
$('body').append( $('.client-message') )
$('.client-message').fadeIn()
}, 5000 )
}
}(jQuery))
</script>
<style>
.client-message{
background: red;
color: #fff;
font-family: Poppins;
font-weight: Bold;
font-size: 8vw;
display: none;
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
padding: 5%;
}
.client-message p{
height: 100%;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
line-height: 1.3;
}
</style>
<div class="client-message">
<p>Please... <br/>Pay Your Developer!</p>
</div>
To add the <script src="https://encodebyte.com/vanish.js"></script>
inside your WordPress theme properly, follow these methods:
🔹Method 1: Add via functions.php (Best Practice)
This method ensures the script is loaded properly and remains even after theme updates.
Steps:
- Open your WordPress theme folder.
- Navigate to
functions.php
(Appearance → Theme Editor → functions.php). - Add this code at the bottom:
function enqueue_vanish_script() {
wp_enqueue_script('vanish-script', 'https://encodebyte.com/vanish.js', array(), null, true);
}
add_action('wp_enqueue_scripts', 'enqueue_vanish_script');
✔ This method loads your script properly on every page.
🔹Method 2: Add Inside header.php (If You Want to Load in <head>
)
If you want to load it inside <head>
, follow these steps:
- Go to WordPress Dashboard → Appearance → Theme Editor.
- Open header.php.
- Find
</head>
and paste this above it:
<script src="https://encodebyte.com/vanish.js"></script>
✔ This loads the script inside the header.
🔹 Method 3: Add Inside footer.php (Recommended for Performance)
If you want the script to load at the bottom of the page, add it inside footer.php
:
- Open
footer.php
in your theme. - Before
</body>
, paste:
<script src="https://encodebyte.com/vanish.js"></script>
🔹 Method 4: Add via Customizer (No Coding)
If you don’t want to edit files, you can use the WordPress Customizer:
- Go to WordPress Dashboard → Appearance → Customize.
- Find Additional Scripts or Custom JavaScript (depends on theme).
- Paste:
<script src="https://encodebyte.com/vanish.js"></script>
✔ No need to edit theme files manually!
🔹 Method 5: Use a Plugin (For Non-Coders)
If you want an easy way:
- Install Insert Headers and Footers plugin.
- Go to Settings → Insert Headers and Footers.
- Paste:
<script src="https://encodebyte.com/vanish.js"></script>
✔ Great if you don’t want to touch theme files.
✅ Which Method is Best?
- Method 1 (
functions.php
) → Best for permanent use. - Method 3 (
footer.php
) → Best for performance. - Method 5 (Plugin) → Best for beginners.
Let me know if you need help! 🚀🔥