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

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ธ.ค. 2024

ความคิดเห็น • 32

  • @Reialesa
    @Reialesa  ปีที่แล้ว +3

    Relevant videos:
    How to redirect users to a custom thank you page after checkout in WooCommerce: th-cam.com/video/scwoeFpl-fM/w-d-xo.html
    How to create a child theme in WordPress: th-cam.com/video/iRGn5Ypm1qw/w-d-xo.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);

  • @jovanperic4214
    @jovanperic4214 3 หลายเดือนก่อน +2

    It doesn't work on mobile devices!

  • @paulwhitehead1816
    @paulwhitehead1816 8 หลายเดือนก่อน

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

  • @MartinaLamos
    @MartinaLamos 8 หลายเดือนก่อน

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

    • @Reialesa
      @Reialesa  6 หลายเดือนก่อน +1

      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! 🙌

  • @Codesiderio
    @Codesiderio ปีที่แล้ว

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

    • @Reialesa
      @Reialesa  ปีที่แล้ว

      I do my best to keep things simple. Thank you very much for your kind words, I appreciate it! 🙌🙏

  • @motobandit5345
    @motobandit5345 ปีที่แล้ว +1

    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?

    • @Reialesa
      @Reialesa  ปีที่แล้ว

      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. 💪

    • @jejebenji
      @jejebenji 5 หลายเดือนก่อน

      same for me

  • @visionarybrands
    @visionarybrands ปีที่แล้ว

    Good morning, will this work in WIX classic?

    • @Reialesa
      @Reialesa  ปีที่แล้ว +1

      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! 💪

  • @cenkbel4082
    @cenkbel4082 ปีที่แล้ว

    can we redirect according to the countries of visitors?

    • @Reialesa
      @Reialesa  ปีที่แล้ว

      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! 💪

  • @yuphoriayu7674
    @yuphoriayu7674 2 หลายเดือนก่อน

    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 ?

    • @Reialesa
      @Reialesa  2 หลายเดือนก่อน

      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! 💪

  • @Riyass-w5s
    @Riyass-w5s ปีที่แล้ว

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

    • @Reialesa
      @Reialesa  ปีที่แล้ว

      Hello! Would you mind letting me know what exactly happens after you add it to the child theme? Do you get any errors?

  • @MdAlAmin-nz8vp
    @MdAlAmin-nz8vp ปีที่แล้ว

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

    • @Reialesa
      @Reialesa  11 หลายเดือนก่อน

      Hi! I'm sorry you're having issues. Does it work if you try to redirect to any other website?

  • @ingolfjohnsson3605
    @ingolfjohnsson3605 10 หลายเดือนก่อน

    am not seeing the code for redirect

    • @Reialesa
      @Reialesa  10 หลายเดือนก่อน

      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);

  • @houseofdreamsinfra
    @houseofdreamsinfra ปีที่แล้ว

    Where is the code?

    • @Reialesa
      @Reialesa  ปีที่แล้ว +1

      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);

  • @25-videos
    @25-videos 8 หลายเดือนก่อน

    Dude! 🔥

    • @Reialesa
      @Reialesa  6 หลายเดือนก่อน

      I'm glad you liked the video, thank you for your support! 💯🙌

  • @byDMMurphy
    @byDMMurphy ปีที่แล้ว

    Oops, no code.

    • @Reialesa
      @Reialesa  ปีที่แล้ว +1

      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);

  • @emmanuelivwighre5399
    @emmanuelivwighre5399 ปีที่แล้ว

    Great content

    • @Reialesa
      @Reialesa  ปีที่แล้ว

      Thank you very much, I appreciate that 🙏

  • @serghonest9
    @serghonest9 8 หลายเดือนก่อน

    "Without any plugin" -> uses Elementor.

    • @Reialesa
      @Reialesa  2 หลายเดือนก่อน

      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.