Making external Links nofollow

New home Forums Pro Add-on Making external Links nofollow

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #66491
    MKAff
    Participant

    Hey,
    thanks for the awesome plugin!

    I’ve just got a quick question: How to mark external Links in the table below the embedded map as nofollow.

    So far, we’ve used this trick here (https://www.wpgmaps.com/forums/topic/making-the-link-inside-the-info-balloon-nofollow/). With 8.1. you’ve apparently restructured your code. What’s the 8.1. solution for this or – even better – could you implement this option in one of your upcoming updates?

    Keep up the great work & best regards,
    Max

    #66493
    Steven
    Moderator

    Hi there,

    Thank you so much for getting in touch, we really appreciate your time.

    Unfortuantely, this is a very specific scenario, so changing this will affect every WP Google Maps user’s website.

    We have adjusted the core code of WP Google Maps to function differently so I took a quick look at the core code and I believe a simple adjustment might help with this.

    Could I kindly ask you to navigate to the wp-google-maps-pro/js/v8/pro-info-window.js file and adjust the line “283”
    From:
    var a = $(“”);

    To:
    var a = $(“”);

    Kindly let me know if this perhaps works for you?

    Kindest Regards,
    Steven De Beer

    #66529
    MKAff
    Participant

    Hey,
    thanks for your reply!

    I think, you meant adding rel=’nofollow’ to this code line:

    var a = $(““) -> var a = $(““);

    Unfortunately, this didn’t quite do the job.

    I also tried adding this line

    a.attr(“ref”,”nofollow”)

    below, but it also did’nt work.

    Do you have any other hints?

    Thanks in advance!

    #66540
    Steven
    Moderator

    Hi there,

    Thank you so much for getting back to me.

    My sincerest apologies for the inconvenience, I am not quite sure what occurred with my copy paste there.

    Kindly see the screenshot attached simply for reference.

    You will need to enable and disable the Developer mode via Maps -> Settings -> Advanced as this will allow the scripts to recompile.

    Kindest Regards,
    Steven De Beer

    • This reply was modified 2 years, 8 months ago by Steven.
    Attachments:
    You must be logged in to view attached files.
    #77031
    cleopatra
    Member

    Reviving this thread (please let me know if I need to start a new thread?), was about to start a new one but it’s the same question… how do I make external links nofollow (both in the marker listing and the info balloon)?

    #77045
    Matthew
    Moderator

    Hi @cleopatra,

    Thank you for getting in touch with us, we do appreciate your time.

    We may continue in this thread, thus please my you provide me with the link to your map so that I may write the respective custom JS code needed for this?

    I look forward to hearing back from you.

    Kindest Regards,
    Matthew

    #77171
    cleopatra
    Member

    Sorry for the delayed response, I didn’t get a notification.
    My website:

    Where to stay

    #77231
    Matthew
    Moderator

    Hi @cleopatra,

    Thank you for getting back to me and for your time on this, I really appreciate it!

    Thank you for the link, I have thus taken a look at your map and have written your respective code thus please may you save the below code into the “Custom JS” setting block (Maps -> Settings -> Advanced Settings):

    jQuery(function($){
      $(document).on('markerlistingupdated.wpgmza', function(){
        $('.wpgmaps_mlist_row').each(function(){
          let row = $(this);
          row.find('a').each(function(){
            let link = $(this);
            link.attr('rel', 'nofollow');
          })
        })
      })
    
      $(document).on('infowindowopen.wpgmza', function(event){
        let infowindow = $(event.target.element);
        infowindow.find('a').each(function(){
          let link = $(this);
          link.attr('rel', 'nofollow');
        })
      })
    })

    Once this has been done, please may you clear your browser cache and confirm if this helps?

    I look forward to hearing back from you.

    Kindest Regards,
    Matthew

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.