Relevant videos: How to redirect users to a custom thank you page after checkout in WooCommerce: ruclips.net/video/scwoeFpl-fM/видео.html How to create a child theme in WordPress: ruclips.net/video/iRGn5Ypm1qw/видео.html The JavaScript required to do this 👇 /* Redirect to an external (or internal) URL */ window.location.href = 'www.youtube.com/@reialesa/videos'; /* Redirect to an external (or internal) URL WITH a delay */ setTimeout(function() { location.href = 'www.youtube.com/@reialesa/videos'; },4000); /* Redirect to any external (or internal) URL WITHOUT a delay - add this to your ''functions.php'' file under ''Appearance'' - ''Theme File Editor'' and replace the ''yourlink'' and 'yournewlink' with your own URLs */ function reialesa_URL_redirect(){ ?>
if (window.location == "yourlink.com/") { window.location.href = 'yournewlink.com/'; }
Hey man, when I add the Script into the HTML widget, it just reloads and reloads the page over and over again, so my Pixel event is fired like 20 times xD Is there any change lately?
Uh-oh! I'm sorry to hear that. Interesting, though. It still works the same way for me. 🤔 What I recommend you do first and foremost is clear out every cache. So, your CDN cache, your server cache and any plugin cache you might have. That often fixes things. Do you have any other JavaScript on the page? There could be a conflict, or even a conflict with a plugin. And the third reason I can think of is that you're accidentally removing the quotation marks or that something is either missing or added somewhere. It happens to me more often than I'd like to admit. Please make sure that you copied and edited everything correctly. 💪
Its working fine the problem is while live editing in elementor after few second its redirecting in live page to that url which we passed because of that im unable to edit the code again to increase the time what to do ?
The redirect, while in the Elementor editor, shouldn't be happening. The first thing I would recommend is trying a different browser. If that doesn't work, try clearing out every cache and go under 'Elementor' - 'Tools' - 'Regenerate Files & Data'. Let me know how it goes! 💪
Hi! I've never tried doing this in Wix, but if you can add in a code snippet (JavaScript) to a single page, it should work just fine. Let me know how it goes! 💪
Hi! You can but that requires some advanced PHP/JavaScript or, what I would recommend, a good plugin. What you're looking for is called a geolocation redirect. Unfortunately, I, personally, don't know which plugins are good so I can't recommend any, but I do know plenty of them exist. Good luck and let me know how it goes! 💪
Hi! It's available in the pinned comment. Here it is again 👇 /* Redirect to an external (or internal) URL */ window.location.href = 'www.youtube.com/@reialesa/videos'; /* Redirect to an external (or internal) URL WITH a delay */ setTimeout(function() { location.href = 'www.youtube.com/@reialesa/videos'; },4000); /* Redirect to any external (or internal) URL WITHOUT a delay - add this to your ''functions.php'' file under ''Appearance'' - ''Theme File Editor'' and replace the ''yourlink'' and 'yournewlink' with your own URLs */ function reialesa_URL_redirect(){ ?> if (window.location == "yourlink.com/") { window.location.href = 'yournewlink.com/'; } setTimeout(function () { if (window.location == "yourlink.com/") { window.location.href = 'yournewlink.com/'; }}, 4000);
Hi! It's in the pinned comment. Anyhow, here it is 👇 /* Redirect to an external (or internal) URL */ window.location.href = 'www.youtube.com/@reialesa/videos'; /* Redirect to an external (or internal) URL WITH a delay */ setTimeout(function() { location.href = 'www.youtube.com/@reialesa/videos'; },4000); /* Redirect to any external (or internal) URL WITHOUT a delay - add this to your ''functions.php'' file under ''Appearance'' - ''Theme File Editor'' and replace the ''yourlink'' and 'yournewlink' with your own URLs */ function reialesa_URL_redirect(){ ?> if (window.location == "yourlink.com/") { window.location.href = 'yournewlink.com/'; } setTimeout(function () { if (window.location == "yourlink.com/") { window.location.href = 'yournewlink.com/'; }}, 4000);
It's actually in the pinned comment 😉 Here it is: /* Redirect to an external (or internal) URL */ window.location.href = 'www.youtube.com/@reialesa/videos'; /* Redirect to an external (or internal) URL WITH a delay */ setTimeout(function() { location.href = 'www.youtube.com/@reialesa/videos'; },4000); /* Redirect to any external (or internal) URL WITHOUT a delay - add this to your ''functions.php'' file under ''Appearance'' - ''Theme File Editor'' and replace the ''yourlink'' and 'yournewlink' with your own URLs */ function reialesa_URL_redirect(){ ?> if (window.location == "yourlink.com/") { window.location.href = 'yournewlink.com/'; } setTimeout(function () { if (window.location == "yourlink.com/") { window.location.href = 'yournewlink.com/'; }}, 4000);
Yes, I use Elementor but it isn't necessary in this case. You can achieve this with the default editor (Gutenberg) or any other page builder. You just need a way to add HTML to the page.
Relevant videos:
How to redirect users to a custom thank you page after checkout in WooCommerce: ruclips.net/video/scwoeFpl-fM/видео.html
How to create a child theme in WordPress: ruclips.net/video/iRGn5Ypm1qw/видео.html
The JavaScript required to do this 👇
/* Redirect to an external (or internal) URL */
window.location.href = 'www.youtube.com/@reialesa/videos';
/* Redirect to an external (or internal) URL WITH a delay */
setTimeout(function() {
location.href = 'www.youtube.com/@reialesa/videos';
},4000);
/* Redirect to any external (or internal) URL WITHOUT a delay - add this to your ''functions.php'' file under ''Appearance'' - ''Theme File Editor'' and replace the ''yourlink'' and 'yournewlink' with your own URLs */
function reialesa_URL_redirect(){
?>
if (window.location == "yourlink.com/") {
window.location.href = 'yournewlink.com/';
}
setTimeout(function () {
if (window.location == "yourlink.com/") {
window.location.href = 'yournewlink.com/';
}}, 4000);
Great guide, quick and well explained for all kinds of users
I do my best to keep things simple. Thank you very much for your kind words, I appreciate it! 🙌🙏
Great tutorial! Is there a way to put the order number on the new page?
THANK YOU !!! you are amazing. it helped me A LOT
That's great to hear, Martina, I'm glad the video was helpful. Thank you very much for your kind words and for your support, I appreciate it! 🙌
It doesn't work on mobile devices!
Hey man, when I add the Script into the HTML widget, it just reloads and reloads the page over and over again, so my Pixel event is fired like 20 times xD
Is there any change lately?
Uh-oh! I'm sorry to hear that. Interesting, though. It still works the same way for me. 🤔
What I recommend you do first and foremost is clear out every cache. So, your CDN cache, your server cache and any plugin cache you might have. That often fixes things.
Do you have any other JavaScript on the page? There could be a conflict, or even a conflict with a plugin. And the third reason I can think of is that you're accidentally removing the quotation marks or that something is either missing or added somewhere. It happens to me more often than I'd like to admit. Please make sure that you copied and edited everything correctly. 💪
same for me
Its working fine the problem is while live editing in elementor after few second its redirecting in live page to that url which we passed because of that im unable to edit the code again to increase the time what to do ?
The redirect, while in the Elementor editor, shouldn't be happening. The first thing I would recommend is trying a different browser. If that doesn't work, try clearing out every cache and go under 'Elementor' - 'Tools' - 'Regenerate Files & Data'. Let me know how it goes! 💪
Good morning, will this work in WIX classic?
Hi! I've never tried doing this in Wix, but if you can add in a code snippet (JavaScript) to a single page, it should work just fine. Let me know how it goes! 💪
can we redirect according to the countries of visitors?
Hi! You can but that requires some advanced PHP/JavaScript or, what I would recommend, a good plugin. What you're looking for is called a geolocation redirect. Unfortunately, I, personally, don't know which plugins are good so I can't recommend any, but I do know plenty of them exist. Good luck and let me know how it goes! 💪
Dude! 🔥
I'm glad you liked the video, thank you for your support! 💯🙌
I tried adding this in a child theme. Not working for me. Can you help?
Hello! Would you mind letting me know what exactly happens after you add it to the child theme? Do you get any errors?
when i did share this system creating link in facebook it does not work
Hi! I'm sorry you're having issues. Does it work if you try to redirect to any other website?
Great content
Thank you very much, I appreciate that 🙏
am not seeing the code for redirect
Hi! It's available in the pinned comment. Here it is again 👇
/* Redirect to an external (or internal) URL */
window.location.href = 'www.youtube.com/@reialesa/videos';
/* Redirect to an external (or internal) URL WITH a delay */
setTimeout(function() {
location.href = 'www.youtube.com/@reialesa/videos';
},4000);
/* Redirect to any external (or internal) URL WITHOUT a delay - add this to your ''functions.php'' file under ''Appearance'' - ''Theme File Editor'' and replace the ''yourlink'' and 'yournewlink' with your own URLs */
function reialesa_URL_redirect(){
?>
if (window.location == "yourlink.com/") {
window.location.href = 'yournewlink.com/';
}
setTimeout(function () {
if (window.location == "yourlink.com/") {
window.location.href = 'yournewlink.com/';
}}, 4000);
Where is the code?
Hi! It's in the pinned comment. Anyhow, here it is 👇
/* Redirect to an external (or internal) URL */
window.location.href = 'www.youtube.com/@reialesa/videos';
/* Redirect to an external (or internal) URL WITH a delay */
setTimeout(function() {
location.href = 'www.youtube.com/@reialesa/videos';
},4000);
/* Redirect to any external (or internal) URL WITHOUT a delay - add this to your ''functions.php'' file under ''Appearance'' - ''Theme File Editor'' and replace the ''yourlink'' and 'yournewlink' with your own URLs */
function reialesa_URL_redirect(){
?>
if (window.location == "yourlink.com/") {
window.location.href = 'yournewlink.com/';
}
setTimeout(function () {
if (window.location == "yourlink.com/") {
window.location.href = 'yournewlink.com/';
}}, 4000);
Oops, no code.
It's actually in the pinned comment 😉 Here it is:
/* Redirect to an external (or internal) URL */
window.location.href = 'www.youtube.com/@reialesa/videos';
/* Redirect to an external (or internal) URL WITH a delay */
setTimeout(function() {
location.href = 'www.youtube.com/@reialesa/videos';
},4000);
/* Redirect to any external (or internal) URL WITHOUT a delay - add this to your ''functions.php'' file under ''Appearance'' - ''Theme File Editor'' and replace the ''yourlink'' and 'yournewlink' with your own URLs */
function reialesa_URL_redirect(){
?>
if (window.location == "yourlink.com/") {
window.location.href = 'yournewlink.com/';
}
setTimeout(function () {
if (window.location == "yourlink.com/") {
window.location.href = 'yournewlink.com/';
}}, 4000);
"Without any plugin" -> uses Elementor.
Yes, I use Elementor but it isn't necessary in this case. You can achieve this with the default editor (Gutenberg) or any other page builder. You just need a way to add HTML to the page.