Detecting Page 2+ On Blog Listing Pages

SOLVE
New Contributor

I'm looking for a way to detect for paginated blog listing pages.

 

For example:

 

website.com/blog/topic/thetopic/2

website.com/blog/topic/anothertopic/3

website.com/blog/page/2

website.com/blog/page/3

 

The following examples are fine and I don't want them to be included:

 

website.com/blog

website.com/blog/topic/thetopic

website.com/blog/topic/anothertopic

 

I just want to be able to add a noindex meta tag on anything deeper than page 1 for these listings. Anyone have a way to identify them with an if statement?

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Highlighted
HubSpot Product Team

You should be able to do this by using the token:

current_page_num 

 

For example: 

{% if current_page_num > 1 %}
<!-- Your HTML -->
{% endif %}

 

I hope that helps,

Anthony

1 Reply 1
Highlighted
HubSpot Product Team

You should be able to do this by using the token:

current_page_num 

 

For example: 

{% if current_page_num > 1 %}
<!-- Your HTML -->
{% endif %}

 

I hope that helps,

Anthony