Hi guys, I have scanned Screaming Frogs and faced a pagination issue when migrating from WordPress to HubSpot, and I noticed it only appears on page 2. I have tried some solutions but can not fix them, could you please help me to check this issue? Thank you!
Description
URLs contained in either, or both, the rel=“next” and rel=“prev” attributes of the page, are not found as a hyperlink in an HTML anchor element on the page itself. Paginated pages should be linked to with regular links to allow users to click and navigate to the next page in the series. They also allow Google to crawl from page to page, and PageRank to flow between pages in the series.
How To Fix
Ensure paginated URLs are linked to within <a> tags. This will allow them to be crawled and indexed, and pass PageRank onto any URLs they link to.
Here is my pagination code:
{% if contents.total_page_count > 1 %}
{% 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="archive-pagination clearfix bsg-pagination-numeric">
<ul>
{% if last_page_num %}
<li class="pagination-previous" >
<a href="{{ blog_page_link(last_page_num) | regex_replace("/page/1$", "") }}">
<span aria-hidden="true">«</span>
<span class="sr-only d-none d-md-inline">Previous</span>
</a>
</li>
{% endif %}
{# Previous #}
{% if contents.total_page_count > 5 %}
{% if current_page_num >= 4 %}
<li><a href="{{ blog_page_link(1) | regex_replace("/page/1$", "") }}">1</a></li>
{# Ignore ... when the total is 6 pages #}
{% if current_page_num >= 5 and contents.total_page_count > 6 %}
<li class="pagination-omission">...</li>
{% endif %}
{% endif %}
{% endif %}
{# List paginate #}
{% for page in page_list %}
{% set this_page = current_page_num + page + offset %}
{% if this_page > 0 and this_page <= contents.total_page_count %}
<li {% if this_page == current_page_num %}class="active"{% endif %}>
<a href="{{ blog_page_link(this_page) | regex_replace("/page/1$", "") }}">{{ this_page }}</a>
</li>
{% endif %}
{% endfor %}
{# Next #}
{% if contents.total_page_count > 5 %}
{# Ignore ... when the total is 6 pages #}
{% if contents.total_page_count - current_page_num > 3 and contents.total_page_count > 6 %}
<li class="pagination-omission">...</li>
{% endif %}
{% if contents.total_page_count - current_page_num > 2 %}
<li><a href="{{ blog_page_link(contents.total_page_count) }}">{{ contents.total_page_count }}</a></li>
{% endif %}
{% endif %}
{% if next_page_num %}
<li class="pagination-next">
<a href="{{ blog_page_link(current_page_num + 1) }}">
<span class="sr-only d-none d-md-inline">Next</span>
<span aria-hidden="true">»</span>
</a>
</li>
{% endif %}
</ul>
</div>
{% endif %}
Hey, @09747 Did you make any progress with this one? If not, I have a couple of suggestions:
You can temporarily try to use plain HTML links with hard-coded URLs in your pagination. If Screaming Frog correctly identifies these, then I’d look into how your dynamic URLs are being generated or rendered.
You can also try simplifying your loop and pagination:
We’ve encountered an issue with our website’s pagination system that we’re hoping to get some help with. Our pagination includes detailed rel=“prev” and rel=“next” attributes within <a> tags, but despite this, we keep receiving notifications from Screaming Frogs indicating “Pagination URL Not in Anchor Tag.”
Here’s a snippet of our pagination HTML for reference:
<nav role=“navigation” aria-labelledby=“pagination-heading”>
<h3 id=“pagination-heading” class=“visually-hidden”>Pagination</h3>
<ul class=“pagination”>
<li class=“page-item pager__item–first”><a href=“?page=0” title=“Go to first page” class=“page-link”><span aria-hidden=“true”>«</span></a></li>
<li class=“page-item pager__item–previous”><a href=“?page=1” title=“Go to previous page” rel=“prev” class=“page-link”><span aria-hidden=“true”>‹</span></a></li>
<li class=“page-item “><a href=”?page=0” title=“Go to page 1” class=“page-link”>1</a></li>
<li class=“page-item “><a href=”?page=1” title=“Go to page 2” class=“page-link”>2</a></li>
<li class=“page-item active”><a href=“?page=2” title=“Current page” class=“page-link”>3</a></li>
<li class=“page-item “><a href=”?page=3” title=“Go to page 4” class=“page-link”>4</a></li>
<li class=“page-item “><a href=”?page=4” title=“Go to page 5” class=“page-link”>5</a></li>
<li class=“page-item pager__item pager__item–ellipsis”><a href=“#”>…</a></li>
<li class=“page-item pager__item–next”><a href=“?page=3” title=“Go to next page” rel=“next” class=“page-link”><span aria-hidden=“true”>›</span><span class=“sr-only”>››</span></a></li>
<li class=“page-item pager__item–last”><a href=“?page=98” title=“Go to last page” class=“page-link”><span aria-hidden=“true”>»</span><span class=“sr-only”>Last »</span></a></li>
</ul>
</nav>
Despite implementing these links correctly, Screaming Frogs is reporting that our pagination URLs are not in anchor tags. We’ve reviewed our code and ensured that the rel=“prev” and rel=“next” attributes are properly included within <a> tags.
Could anyone shed some light on why we might be receiving this error? Has anyone else encountered similar issues with Screaming Frogs and pagination systems?