Blog, Website & Page Publishing

FurqanAli
Participant

Facing issue of "duplicate pages without canonical" on most of the blog pages which has pagination.

SOLVE

Based on a report from Ahref I'm getting some URLs from the blog pages that are without canonical such as pagination links or blogs with specific tag links can someone clarify how we can resolve this issue?

0 Upvotes
1 Accepted solution
SFurlong
Solution
Contributor | Diamond Partner
Contributor | Diamond Partner

Facing issue of "duplicate pages without canonical" on most of the blog pages which has pagination.

SOLVE

I want to post this here for anyone else who comes across it. I was able to implement a fairly straightforward solution with that information:

 

  {% require_head %}
    {% set prevPage = current_page_num - 1 %}
    
    {% if current_page_num > 1 %}
      <link rel="canonical" href="{{ content.absolute_url }}">
      <link rel="prev" href="{{ group.absolute_url }}/page/{{ prevPage }}" />
      {% if next_page_num %}
      <link rel="next" href="{{ group.absolute_url }}/page/{{ next_page_num }}" />
      {% endif %}
    {% else %}
      <link rel="canonical" href="{{ group.absolute_url }}">
      {% if next_page_num %}
      <link rel="next" href="{{ group.absolute_url }}/page/{{ next_page_num }}" />
      {% endif %}
    {% endif %}
  {% end_require_head %}

 

This could probably be improved on more if needed, unfortunately the /page/ slug of the URL is hardcoded in my setup but it works for my case.

View solution in original post

9 Replies 9
FurqanAli
Participant

Facing issue of "duplicate pages without canonical" on most of the blog pages which has pagination.

SOLVE

@LMeert thanks for the reply I can share the URL with you please check the examples below:

- blog/tag/meetings/page/1
- /blog/tag/meetings 
- /template/page/1 

Mostly related to paginated urls also can I no index these pages is it safe so they don't appear in the report?

0 Upvotes
KStAngel
Contributor

Facing issue of "duplicate pages without canonical" on most of the blog pages which has pagination.

SOLVE

Hi @FurqanAli,
I'm guessing you solved this by now since this is an older post, but here's what I've found that fixed this issue on our blog. 

  • In your HubSpot account, click the settings settings icon in the main navigation bar.
  • In the left sidebar menu, navigate to Website > Pages.
  • Click the SEO & Crawlers tab.
  • For pages and blog posts, select "Add self-referencing canonical URLs...".
  • For blog listing pagesselect a "Set each blog listing page's canonical URL to the first page in its series".

KStAngel_3-1705683602854.png

 

I'm not sure why Hubspot recommends the "Don't add canonical URLs to any blog listing pages" setting. On this post they say "search engines may be unable to find subsequent pages for your blog listing page." which leads me to believe that they expect it will add a canonical URL pointing to the index page from all listing pages, but in practice, that does not seem to be the case.

 

Here's how these settings rendered on my company's Hubspot blog:

Index page (equivalent to your /blog/tag/meetings) shows a self-referencing canonical, and a proper rel="next". Good.

KStAngel_4-1705683662099.png


Page 1 (equivalent of your blog/tag/meetings/page/1) shows a canonical to the index page a proper rel="next". Great! That should make Google happy.

KStAngel_5-1705683790237.png

 

Page 2 (to confirm no negative effects). This looks good. It'd be better if page 2 had a self-referencing canonical (more on that here: https://ahrefs.com/blog/canonical-tags/), but at least it's not adding a canonical to index thus stopping it's unique content from being indexed.

KStAngel_7-1705685641350.png

 

0 Upvotes
SFurlong
Contributor | Diamond Partner
Contributor | Diamond Partner

Facing issue of "duplicate pages without canonical" on most of the blog pages which has pagination.

SOLVE

@KStAngel - Is this something that was custom developed? When I set those identical settings, I see the same issues originally mentioned. All blog page canonicals point to the original blog page and no prev/next are present. What you show is exactly what I'm looking to do but it doesn't seem HubSpot handles it this way by default. Good to know there is some way out there to do this though!

 

Also, I found a post in the idea forum that seems to be asking for this - but not much traction on it:


https://community.hubspot.com/t5/HubSpot-Ideas/Third-quot-Canonical-URL-quot-option-for-blog-listing...

0 Upvotes
KStAngel
Contributor

Facing issue of "duplicate pages without canonical" on most of the blog pages which has pagination.

SOLVE

Hi @SFurlong, I can't say for sure that the settings would work the same for everyone. I was working off of a customized template that might have had some of it's own stuff going on.

Digging through some notes from a year, it seems I ended up doing a little more work on this after this post, and modifying our blog template based on an article I can no longer access here: https://community.hubspot.com/t5/Share-Your-Work/SEO-fix-to-add-page-number-to-canonical-link-to-lis...


In case it helps you, what I ended up doing was adding the snipped below in the "Additional <head> markup" area of our blog's Listing page template.
<!--Listing Template Canonical Addition v3-->
{% if current_page_num>1 %}
<link rel="canonical" href="{{ content.absolute_url }}">
{% else %}
<link rel="canonical" href="{{ group.absolute_url }}">
{% endif %}

KStAngel_0-1741291822946.png

 

Settings are now:

KStAngel_1-1741291974670.png

 

 

I don't think this will address missing rel="next", but hope if helps get you going in the right direction.

SFurlong
Solution
Contributor | Diamond Partner
Contributor | Diamond Partner

Facing issue of "duplicate pages without canonical" on most of the blog pages which has pagination.

SOLVE

I want to post this here for anyone else who comes across it. I was able to implement a fairly straightforward solution with that information:

 

  {% require_head %}
    {% set prevPage = current_page_num - 1 %}
    
    {% if current_page_num > 1 %}
      <link rel="canonical" href="{{ content.absolute_url }}">
      <link rel="prev" href="{{ group.absolute_url }}/page/{{ prevPage }}" />
      {% if next_page_num %}
      <link rel="next" href="{{ group.absolute_url }}/page/{{ next_page_num }}" />
      {% endif %}
    {% else %}
      <link rel="canonical" href="{{ group.absolute_url }}">
      {% if next_page_num %}
      <link rel="next" href="{{ group.absolute_url }}/page/{{ next_page_num }}" />
      {% endif %}
    {% endif %}
  {% end_require_head %}

 

This could probably be improved on more if needed, unfortunately the /page/ slug of the URL is hardcoded in my setup but it works for my case.

SFurlong
Contributor | Diamond Partner
Contributor | Diamond Partner

Facing issue of "duplicate pages without canonical" on most of the blog pages which has pagination.

SOLVE

This is wonderful - thank you so much!

0 Upvotes
KStAngel
Contributor

Facing issue of "duplicate pages without canonical" on most of the blog pages which has pagination.

SOLVE

I added a product suggestion in hopes this could be addressed on the Hubspot side:
https://community.hubspot.com/t5/HubSpot-Ideas/Use-Best-Practices-for-Blog-Canonical-Tagging/idi-p/9...

0 Upvotes
TitiCuisset
Community Manager
Community Manager

Facing issue of "duplicate pages without canonical" on most of the blog pages which has pagination.

SOLVE

Hi @FurqanAli 

 

Thank you for reaching out.

 

I want to tag some of our experts on this - @Kevin-C @LMeert @Anton do you know what may be happening here?

 

I would also recommend connecting with HubSpot Technical Support, as Support is included in your subscription and they will be able to provide real-time assistance for this matter, where you are able to share screenshots and further information about this!

 

Thank you!

Best

Tiphaine


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.

0 Upvotes
LMeert
Guide | Platinum Partner
Guide | Platinum Partner

Facing issue of "duplicate pages without canonical" on most of the blog pages which has pagination.

SOLVE

Hi @TitiCuisset,

 

Never had this issue before.
Maybe @FurqanAli you could share the website url and give us a precise example of a page missing a canonical tag so we can better understand what is your problem and find a solution to it ?

 

Thanks,

Ludwig

Agence Mi4 - Data DrivenCTO @ Mi4
Hubspot Platinum Partner and Integration Expert

Passionate human, very curious about everything data and automation.

Any problem with Hubspot you need help solving ?

Let me know !