• Resolved montford3333

    (@montford3333)


    • I’m using Divi theme.
    • I have YouTube videos on my site.
    • I don’t want related videos to play at the end.
    • If Wordfence is deactivated, custom code stops related videos by adding &rel=0′ to end of all YouTube video URL’s. (See code below.)
    • If I activate Wordfence it blocks the code from running.
    • How to I configure Wordfence to permit my code to run?

      Thanks
      CJ

      Code (added to Divi Theme options, Integration, <head> of blog.)
      ==============================================================

      <script>
      jQuery(document).ready(function($ ) {
      $('.et_pb_video iframe').attr( "src", function( i, val ) {
      return val + '&rel=0';
      });
      });
      </script>
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support WFAdam

    (@wfadam)

    Hello @montford3333 and thanks for reaching out to us!

    Have you tried running Learning Mode on the firewall while playing these videos to let Wordfence know this is a normal activity?

    You can turn on Learning Mode by going to Firewall > Manage WAF, under Web Application Firewall Status, change it to Learning Mode. Then perform the actions that were not working. When you are finished, switch this back to Enabled and Protecting. See if the videos are working correctly now.

    https://www.wordfence.com/help/firewall/learning-mode/ is a great resource for more information on Managing WAF and using Learning mode.

    You could also try to watch the videos while having your Live Traffic window open. Once you see what is causing the code to be blocked, you could whitelist that action. Sort of a workaround to the Learning Mode.

    Let me know if this helps!

    Thanks!

    Thread Starter montford3333

    (@montford3333)

    Hi Adam,
    No luck I’m afraid. I had already tried Learning Mode and nothing gets blocked in Live Traffic when I play my YouTube videos on the site.
    ??
    Thanks CJ

    Thread Starter montford3333

    (@montford3333)

    Hi Adam,
    I decided to circumnavigate the problem.
    I achieved this by moving all my videos from YouTube to a paid plan on Vimeo.
    Problem solved.
    Regards
    CJ

    Plugin Support WFAdam

    (@wfadam)

    Hello again @montford3333

    Glad you could find a resolution!

    Thanks!

    • This reply was modified 4 years, 3 months ago by WFAdam.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Stop YouTube Related Videos – Wordfence blocking custom code’ is closed to new replies.