Duplicate blog listing page

SOLVE
Highlighted
dit
Occasional Contributor

Hello,

 

Our SEO team have indicated that we have a duplicate page for our blog and each category within our blog.

 

We have blog.domain.com and blog.domain.com/page/1, they show identical content. Is there any way to kill off page/1 of each?

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Advisor | Platinum Partner

Hi @dit 

 

Best practice is to have self-referencing canonical URLs for all paginated pages, so yes, in most cases don't point canonicals to the first page, but everyone's paginated pages, content, and site is different, so this setting exists so that your SEO can test and make the best call. I rarely find that paginated pages add value to the search results.

I would argue "...setting the blog listing page's canonical URL to the first page prevents search engines from finding any subsequent paginated pages." isn't technically correct as Google will crawl the pagination links, discover the content and make its own call as to whether to honour the canonical.

 

Another approach to this would be to change your blog listings templates pagination code to point the first paginate link to / instead of /page/1.  Your pagination code might look something like this

 

 

{% if not simple_list_page %}
        <div class="blog-pagination">
        {% set page_list = [-2, -1, 0, 1, 2] %}
        {% if contents.total_page_count - current_page_num == 1 %}{% set offset = -1 %}
        {% elif contents.total_page_count - current_page_num == 0 %}{% set offset = -2 %}
        {% elif current_page_num == 2 %}{% set offset = 1 %}
        {% elif current_page_num == 1 %}{% set offset = 2 %}
        {% else %}{% set offset = 0 %}{% endif %}

        <div class="blog-pagination-left">
            {% if last_page_num %}<a class="prev-link" href="{{ blog_page_link(last_page_num) }}"><i class="fa fa-angle-double-left"></i></a>{% endif %}
            {% if contents.total_page_count > 5 %}
                {% if current_page_num >= 4 %}
                    <a href="{{ blog_page_link(1) }}" >1</a>
                    <a class="elipses" href="{% if current_page_num <= 5 %}{{ blog_page_link(1) }}{% else %}{{ blog_page_link(current_page_num - 5) }}{% endif %}">...</a>
                {% endif %}
            {% endif %}
        </div>
        <div class="blog-pagination-center">
            {% for page in page_list %}
                {% set this_page = current_page_num + page + offset %}
                {% if this_page > 0 and this_page <= contents.total_page_count %}
                    <a {% if this_page == current_page_num %}class="active"{% endif %} href="{{ blog_page_link(this_page) }}">{{ this_page }}</a>
                {% endif %}
            {% endfor %}
        </div>
        <div class="blog-pagination-right">
            {% if contents.total_page_count > 5 %}
                {% if contents.total_page_count - current_page_num > 2 %}
                    <a class="elipses" href="{% if contents.total_page_count - current_page_num <= 5 %}{{ contents.total_page_count }}{% else %}{{ blog_page_link(current_page_num + 5) }}{% endif %}">...</a>
                    <a href="{{ blog_page_link(contents.total_page_count) }}">{{ contents.total_page_count }}</a>
                {% endif %}
            {% endif %}
            {% if next_page_num %}<a class="next-link" href="{{ blog_page_link(current_page_num + 1) }}"><i class="fa fa-angle-double-right"></i></a>{% endif %}
        </div>
        </div>
        {% endif %}
    </div>


You could change the code as follows (changes in bold) to check if this is the first page of pagination and set it to your default blog page ( {{ group.absolute_url }} - or replace that with href="/" if you prefer.)

 

 

 

        {% if not simple_list_page %}
        <div class="blog-pagination">
        {% set page_list = [-2, -1, 0, 1, 2] %}
        {% if contents.total_page_count - current_page_num == 1 %}{% set offset = -1 %}
        {% elif contents.total_page_count - current_page_num == 0 %}{% set offset = -2 %}
        {% elif current_page_num == 2 %}{% set offset = 1 %}
        {% elif current_page_num == 1 %}{% set offset = 2 %}
        {% else %}{% set offset = 0 %}{% endif %}

        <div class="blog-pagination-left">
            {% if last_page_num %}<a class="prev-link" href="{{ group.absolute_url }}"><i class="fa fa-angle-double-left"></i></a>{% endif %}
            {% if contents.total_page_count > 5 %}
                {% if current_page_num >= 4 %}
                    <a href="{{ blog_page_link(1) }}" >1</a>
                    <a class="elipses" href="{% if current_page_num <= 5 %}{{ blog_page_link(1) }}{% else %}{{ blog_page_link(current_page_num - 5) }}{% endif %}">...</a>
                {% endif %}
            {% endif %}
        </div>
        <div class="blog-pagination-center">
            {% for page in page_list %}
                {% set this_page = current_page_num + page + offset %}
                {% if this_page > 0 and this_page <= contents.total_page_count %}
                   {% if this_page == 1 %}
                   <a {% if this_page == current_page_num %}class="active"{% endif %} href="{{ group.absolute_url }}">{{ this_page }}</a>
                   {% else %} 
                    <a {% if this_page == current_page_num %}class="active"{% endif %} href="{{ blog_page_link(this_page) }}">{{ this_page }}</a>
                   {% endif %}
                {% endif %}
            {% endfor %}
        </div>
        <div class="blog-pagination-right">
            {% if contents.total_page_count > 5 %}
                {% if contents.total_page_count - current_page_num > 2 %}
                    <a class="elipses" href="{% if contents.total_page_count - current_page_num <= 5 %}{{ contents.total_page_count }}{% else %}{{ blog_page_link(current_page_num + 5) }}{% endif %}">...</a>
                    <a href="{{ blog_page_link(contents.total_page_count) }}">{{ contents.total_page_count }}</a>
                {% endif %}
            {% endif %}
            {% if next_page_num %}<a class="next-link" href="{{ blog_page_link(current_page_num + 1) }}"><i class="fa fa-angle-double-right"></i></a>{% endif %}
        </div>
        </div>
        {% endif %}

 

 

Note this doesn't stop the blog /page/1 being generated, you just won't be linking to it. Another approach could be to check if the url path contains /page/1 and noindex (just) that pagination page or add a canonical (if you haven't already set a canonical via the blog settings.)  Add something like the following to  your blog listing pages header HTML

 

 

{% if request.path is string_containing "/page/1" %}
<meta name="robots" content="noindex">
{% endif %}

 

 

 


Did my post help answer your query? Help the Community by marking it as a solution.

Matthew Shepherd

An Inbound Growth Agency
Platinum HubSpot Partner

4 Replies 4
Advisor | Platinum Partner

Hi @dit 

 

The /page/1 is part of your blog listing template's pagination functionality. Instead of killing it off you could set the canonical for each paginated page of your blog to point back to the first page.

 

hs-blog-canonical.PNG

 

 

This article explains how to do this: https://knowledge.hubspot.com/articles/kcs_article/cos-blog/how-does-hubspot-address-duplicate-conte...


Did my post help answer your query? Help the Community by marking it as a solution.

Matthew Shepherd

An Inbound Growth Agency
Platinum HubSpot Partner

Reply
0 Upvotes
dit
Occasional Contributor

Hi Matthew, 

 

Thanks for the link but I'm a bit confused as this specifically mentions not setting canonical URLs to the listing pages:

 

Please note: for the Blog listing pages setting, HubSpot recommends that you don't add canonical URLs to blog listing pages. While search engines may flag blog listing pages as duplicate content, setting the blog listing page's canonical URL to the first page prevents search engines from finding any subsequent paginated pages.

Reply
0 Upvotes
Advisor | Platinum Partner

Hi @dit 

 

Best practice is to have self-referencing canonical URLs for all paginated pages, so yes, in most cases don't point canonicals to the first page, but everyone's paginated pages, content, and site is different, so this setting exists so that your SEO can test and make the best call. I rarely find that paginated pages add value to the search results.

I would argue "...setting the blog listing page's canonical URL to the first page prevents search engines from finding any subsequent paginated pages." isn't technically correct as Google will crawl the pagination links, discover the content and make its own call as to whether to honour the canonical.

 

Another approach to this would be to change your blog listings templates pagination code to point the first paginate link to / instead of /page/1.  Your pagination code might look something like this

 

 

{% if not simple_list_page %}
        <div class="blog-pagination">
        {% set page_list = [-2, -1, 0, 1, 2] %}
        {% if contents.total_page_count - current_page_num == 1 %}{% set offset = -1 %}
        {% elif contents.total_page_count - current_page_num == 0 %}{% set offset = -2 %}
        {% elif current_page_num == 2 %}{% set offset = 1 %}
        {% elif current_page_num == 1 %}{% set offset = 2 %}
        {% else %}{% set offset = 0 %}{% endif %}

        <div class="blog-pagination-left">
            {% if last_page_num %}<a class="prev-link" href="{{ blog_page_link(last_page_num) }}"><i class="fa fa-angle-double-left"></i></a>{% endif %}
            {% if contents.total_page_count > 5 %}
                {% if current_page_num >= 4 %}
                    <a href="{{ blog_page_link(1) }}" >1</a>
                    <a class="elipses" href="{% if current_page_num <= 5 %}{{ blog_page_link(1) }}{% else %}{{ blog_page_link(current_page_num - 5) }}{% endif %}">...</a>
                {% endif %}
            {% endif %}
        </div>
        <div class="blog-pagination-center">
            {% for page in page_list %}
                {% set this_page = current_page_num + page + offset %}
                {% if this_page > 0 and this_page <= contents.total_page_count %}
                    <a {% if this_page == current_page_num %}class="active"{% endif %} href="{{ blog_page_link(this_page) }}">{{ this_page }}</a>
                {% endif %}
            {% endfor %}
        </div>
        <div class="blog-pagination-right">
            {% if contents.total_page_count > 5 %}
                {% if contents.total_page_count - current_page_num > 2 %}
                    <a class="elipses" href="{% if contents.total_page_count - current_page_num <= 5 %}{{ contents.total_page_count }}{% else %}{{ blog_page_link(current_page_num + 5) }}{% endif %}">...</a>
                    <a href="{{ blog_page_link(contents.total_page_count) }}">{{ contents.total_page_count }}</a>
                {% endif %}
            {% endif %}
            {% if next_page_num %}<a class="next-link" href="{{ blog_page_link(current_page_num + 1) }}"><i class="fa fa-angle-double-right"></i></a>{% endif %}
        </div>
        </div>
        {% endif %}
    </div>


You could change the code as follows (changes in bold) to check if this is the first page of pagination and set it to your default blog page ( {{ group.absolute_url }} - or replace that with href="/" if you prefer.)

 

 

 

        {% if not simple_list_page %}
        <div class="blog-pagination">
        {% set page_list = [-2, -1, 0, 1, 2] %}
        {% if contents.total_page_count - current_page_num == 1 %}{% set offset = -1 %}
        {% elif contents.total_page_count - current_page_num == 0 %}{% set offset = -2 %}
        {% elif current_page_num == 2 %}{% set offset = 1 %}
        {% elif current_page_num == 1 %}{% set offset = 2 %}
        {% else %}{% set offset = 0 %}{% endif %}

        <div class="blog-pagination-left">
            {% if last_page_num %}<a class="prev-link" href="{{ group.absolute_url }}"><i class="fa fa-angle-double-left"></i></a>{% endif %}
            {% if contents.total_page_count > 5 %}
                {% if current_page_num >= 4 %}
                    <a href="{{ blog_page_link(1) }}" >1</a>
                    <a class="elipses" href="{% if current_page_num <= 5 %}{{ blog_page_link(1) }}{% else %}{{ blog_page_link(current_page_num - 5) }}{% endif %}">...</a>
                {% endif %}
            {% endif %}
        </div>
        <div class="blog-pagination-center">
            {% for page in page_list %}
                {% set this_page = current_page_num + page + offset %}
                {% if this_page > 0 and this_page <= contents.total_page_count %}
                   {% if this_page == 1 %}
                   <a {% if this_page == current_page_num %}class="active"{% endif %} href="{{ group.absolute_url }}">{{ this_page }}</a>
                   {% else %} 
                    <a {% if this_page == current_page_num %}class="active"{% endif %} href="{{ blog_page_link(this_page) }}">{{ this_page }}</a>
                   {% endif %}
                {% endif %}
            {% endfor %}
        </div>
        <div class="blog-pagination-right">
            {% if contents.total_page_count > 5 %}
                {% if contents.total_page_count - current_page_num > 2 %}
                    <a class="elipses" href="{% if contents.total_page_count - current_page_num <= 5 %}{{ contents.total_page_count }}{% else %}{{ blog_page_link(current_page_num + 5) }}{% endif %}">...</a>
                    <a href="{{ blog_page_link(contents.total_page_count) }}">{{ contents.total_page_count }}</a>
                {% endif %}
            {% endif %}
            {% if next_page_num %}<a class="next-link" href="{{ blog_page_link(current_page_num + 1) }}"><i class="fa fa-angle-double-right"></i></a>{% endif %}
        </div>
        </div>
        {% endif %}

 

 

Note this doesn't stop the blog /page/1 being generated, you just won't be linking to it. Another approach could be to check if the url path contains /page/1 and noindex (just) that pagination page or add a canonical (if you haven't already set a canonical via the blog settings.)  Add something like the following to  your blog listing pages header HTML

 

 

{% if request.path is string_containing "/page/1" %}
<meta name="robots" content="noindex">
{% endif %}

 

 

 


Did my post help answer your query? Help the Community by marking it as a solution.

Matthew Shepherd

An Inbound Growth Agency
Platinum HubSpot Partner

Occasional Contributor

Is this important for SEO? Would this improve it?

Reply
0 Upvotes