Add rel="nofollow" to Pagination Links

Google & BingBot are hitting our site hard with pifragment in the querystring. How can we add rel="nofollow' to pagination URLs?

Parents Reply Children
  • I found these two pages that may help:  evolutionPager jQuery Plugin &  page UI Component 

    They have this code reference/example (I think it's the same in both examples)

    template: typeof options.configuration.Template !== 'undefined' ? options.configuration.Template : '' +
                    ' <% foreach(links, function(link, i) { %> ' +
                    '     <% if(link.type === "first") { %> ' +
                    '         <a href="<%: link.url %>" class="first" data-type="first" data-page="<%= link.page %>" data-selected="false"><span>«</span></a> ' +
                    '     <% } else if(link.type === "previous") { %> ' +
                    '         <a href="<%: link.url %>" class="previous" data-type="previous" data-page="<%= link.page %>" data-selected="false"><span><</span></a> ' +
                    '     <% } else if(link.type === "page") { %> ' +
                    '         <a href="<%: link.url %>" class="page<%= link.selected ? " selected" : "" %>" data-type="page" data-page="<%= link.page %>" data-selected="<%= link.selected ? "true" : "false" %>"><span><%= link.page %></span></a> ' +
                    '     <% } else if(link.type === "next") { %> ' +
                    '         <a href="<%: link.url %>" class="next" data-type="next" data-page="<%= link.page %>" data-selected="false"><span>></span></a> ' +
                    '     <% } else if(link.type === "last") { %> ' +
                    '         <a href="<%: link.url %>" class="last" data-type="last" data-page="<%= link.page %>" data-selected="false"><span>»</span></a> ' +
                    '     <% } %> ' +
                    '     <% if(i < (links.length - 1)) { %> ' +
                    '         <span class="separator"></span> ' +
                    '     <% } %> ' +
                    ' <% }); %> '
    
      

    I'm not sure how'd you drop that into the list.vm (I'm guessing maybe add a new file in the widget and call that file in $pagerOptions or $core_v2_ui.Pager?), but it seems like that's building the URLs, and maybe you could drop the rel="nofollow" into those <a> tags? 

  • I discovered this as well and was able to update my theme.js file to reflect the nofollow! Thanks for the tips to get this accomplished