Automatically Redirect From Any Page to Any Website / Domain in WordPress Without Any Plugins

preview_player
Показать описание
The JavaScript required to do this is pinned 📌 to the top comment.

Relevant videos:

Automatically redirecting your users somewhere can be very important. Redirecting to different pages after they purchase a product in your WooCommerce store is simple enough and, with many page builders, so is redirecting them after they fill out a form. But these redirects only work for the pages on the original domain, the one that's doing the redirecting, not for external websites. And they're instant, they happen right away and you can't delay them.

Make sure you use a child theme and back up your WordPress website before doing this!

#WordPress #redirect #automaticredirect

What I use to build amazing websites:

Get in touch:

Don’t be shy! Let me know what you’d like to see next, ask me anything related to design or just simply say hi.

Please note that some of the above are affiliate links, which means I earn a commission if you make a purchase, at no additional cost to you. Thank you very much if you decide to use them!
Рекомендации по теме
Комментарии
Автор

Relevant videos:

The JavaScript required to do this 👇


<script>
/* Redirect to an external (or internal) URL */
</script>


<script>
/* Redirect to an external (or internal) URL WITH a delay */
setTimeout(function() {
}, 4000);
</script>


/* 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(){
?>
<script>
}
</script>
<?php
}
add_action('wp_footer', 'reialesa_URL_redirect');


/* Redirect to any external (or internal) URL WITH 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(){
?>
<script>
setTimeout(function () {
}}, 4000);
</script>
<?php
}
add_action('wp_footer', 'reialesa_URL_redirect');

Reialesa
Автор

It doesn't work on mobile devices!

jovanperic
Автор

Great guide, quick and well explained for all kinds of users

Codesiderio
Автор

THANK YOU !!! you are amazing. it helped me A LOT

MartinaLamos
Автор

Great tutorial! Is there a way to put the order number on the new page?

paulwhitehead
Автор

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?

motobandit
Автор

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 ?

yuphoriayu
Автор

can we redirect according to the countries of visitors?

cenkbel
Автор

Good morning, will this work in WIX classic?

visionarybrands
Автор

when i did share this system creating link in facebook it does not work

MdAlAmin-nzvp
Автор

I tried adding this in a child theme. Not working for me. Can you help?

Riyass-ws
Автор

"Without any plugin" -> uses Elementor.

serghonest