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

Поделиться
HTML-код
  • Опубликовано: 7 ноя 2024

Комментарии • 32

  • @Reialesa
    @Reialesa  Год назад +3

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

  • @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! 🙌🙏

  • @paulwhitehead1816
    @paulwhitehead1816 7 месяцев назад

    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  5 месяцев назад +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! 🙌

  • @jovanperic4214
    @jovanperic4214 2 месяца назад +2

    It doesn't work on mobile devices!

  • @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

  • @yuphoriayu7674
    @yuphoriayu7674 Месяц назад

    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  Месяц назад

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

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

  • @25-videos
    @25-videos 7 месяцев назад

    Dude! 🔥

    • @Reialesa
      @Reialesa  5 месяцев назад

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

  • @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 11 месяцев назад

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

    • @Reialesa
      @Reialesa  10 месяцев назад

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

  • @emmanuelivwighre5399
    @emmanuelivwighre5399 Год назад

    Great content

    • @Reialesa
      @Reialesa  Год назад

      Thank you very much, I appreciate that 🙏

  • @ingolfjohnsson3605
    @ingolfjohnsson3605 9 месяцев назад

    am not seeing the code for redirect

    • @Reialesa
      @Reialesa  9 месяцев назад

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

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

  • @serghonest9
    @serghonest9 8 месяцев назад

    "Without any plugin" -> uses Elementor.

    • @Reialesa
      @Reialesa  Месяц назад

      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.