SEO improvement (rel prev/next)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
Hi,

A suggestion is to edit the method CreatePageLink in the class Pager:

    protected virtual string CreatePageLink(int pageNumber, string text, string cssClass)
    {
            var localizationService = EngineContext.Current.Resolve<ILocalizationService>();
            var liBuilder = new TagBuilder("li");
            if (!String.IsNullOrWhiteSpace(cssClass))
                liBuilder.AddCssClass(cssClass);

      var aBuilder = new TagBuilder("a");
            aBuilder.SetInnerText(text);
            aBuilder.MergeAttribute("href", urlBuilder(pageNumber));
            if (text == localizationService.GetResource("Pager.Next")) aBuilder.MergeAttribute("rel", "next");
            if (text == localizationService.GetResource("Pager.Previous")) aBuilder.MergeAttribute("rel", "prev");

            liBuilder.InnerHtml += aBuilder;

            return liBuilder.ToString(TagRenderMode.Normal);
    }


Doing this would add rel=prev or rel=next to the links on the paginated pages. This could be an improvement to search engines crawling the page.
8 years ago
Thanks a lot for suggestion. I've just created a work item
8 years ago
Looks like according to this official Google documentation you have to insert <link> element to the <head> rather than adding "rel=prev/next" to the links.
5 years ago
Release new plugin Google Pagination Links (SEO)
https://www.foxnetsoft.com/nopgooglepaginationtag
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.