Hello,
Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.
It is completely your choice if you want to keep the paginated pages indexed or not. However, it is recommended to noindex them if you have a lot of them as it can exhaust the crawl budget and slow down the indexing of your new posts.
You can follow the steps in this link to set your paginated pages to noindex:
https://rankmath.com/kb/how-to-noindex-paginated-pages/
Hope that helps.
Thank you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
So is there away of doing this in robots file
Hello,
The %page%
variable would only be added in the title, but the issue is about duplicate content.
If you still want to add the canonical URL to those pages, then you will have to set them as index first, from WP Dashboard > Rank Math > Titles & Meta > Misc Pages, and disable the Noindex Paginated Pages option.
Then add the code given below in your theme’s functions.php file to set the canonical URL as the URL of the main page:
add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
if ( is_product_category() && is_paged()) {
$link = $_SERVER['REQUEST_URI'];
$arr = explode('/p/', $link,);
$canonical = home_url($arr[0]);
}
return $canonical;
});
Hope that helps.
Thank you.
However just look at this again the canonical is not correct is 404 and redirecting to the homepage !!!!
Hi
So I also found this and read it but
https://support.rankmath.com/ticket/follownoindex-on-paginatied-woocommerce-product-categories/
OK i have a few issues here.
I have activated noindex for subpages.
But it doesn’t work for my woocommerce categories
For example
https://mytap.com.au/product-category/basin-tapware/?product-page=2
https://mytap.com.au/product-category/showers/?product-page=2
Also
If I use %page% in the snippet the pagination does not show in the title of the snippet
https://mytap.com.au/product-category/basin-tapware/?product-page=2
But if I use %PAGE% it does appear in the snippet
https://mytap.com.au/product-category/showers/?product-page=2
HOWEVER THE PAGINATION DOESN”T SHOW AT ALL IN THE PAGE TITLE META IN EITHER CASE – view source code of both pages
The login in sensitive data still applies
Many Thanks
The other thing is that this page retains the canonical for the paginated page
This is standard DIVI page with a shop module ( not a category page)
https://mytap.com.au/shower-heads-and-sets/?product-page=2
<title>Quality Shower Heads, Rails & Mixers Phoenix – MYTAP</title><link rel=”preload” href=”https://mytap.com.au/wp-content/uploads/2021/01/mytap-logoblack350.png” as=”image” imagesrcset=”https://mytap.com.au/wp-content/uploads/2021/01/mytap-logoblack350.png 350w, https://mytap.com.au/wp-content/uploads/2021/01/mytap-logoblack350-300×108.png 300w” imagesizes=”(max-width: 350px) 100vw, 350px” /><link rel=”preload” href=”https://mytap.com.au/wp-content/uploads/2022/05/standard-basin-mixer-icon-150×150.png” as=”image” imagesrcset=”https://mytap.com.au/wp-content/uploads/2022/05/standard-basin-mixer-icon-150×150.png 150w, https://mytap.com.au/wp-content/uploads/2022/05/standard-basin-mixer-icon-100×100.png 100w, https://mytap.com.au/wp-content/uploads/2022/05/standard-basin-mixer-icon-32×32.png 32w, https://mytap.com.au/wp-content/uploads/2022/05/standard-basin-mixer-icon.png 250w” imagesizes=”(max-width: 150px) 100vw, 150px” />
<meta name=”description” content=”Quality Shower Heads, Rails Sets and Mixers by Paris Phoenix Millennium. Free Shipping. Great prices super deals on Phoenix Shower products”/>
<meta name=”robots” content=”follow, index, max-snippet:-1, max-video-preview:-1, max-image-preview:large”/>
<link rel=”canonical” href=”https://mytap.com.au/shower-heads-and-sets/” />
Just seems it all is working differently for different types of content
Hello,
Because of the way you have those pages set up, the function is_paged()
from WordPress returns false, which means it’s not being detected as an actual paginated page, and as such any settings related to paginated pages are not applied on those.
To add a self-referencing canonical on those pages you can use the following filter:
add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
$url = home_url( $_SERVER['REQUEST_URI'] );
if(strpos($url, '?product-page=')) {
$canonical = $url;
}
return $canonical;
});
Hope this helps clarify your doubts.
Don’t hesitate to get in touch if you have any other questions.
Hi but thatdoesn’t seem to work as the canaonical has tghe paginattion
e.g <title>100+ Quality Kitchen Taps – Free Shipping – Buy Online</title>
<meta name=”description” content=”Modern Kitchen Taps from quality Millennium Phoenix and Parisi brands. Free Shipping Australia Wide. Best Online Prices. 7 and 15 Year warranty”/>
<meta name=”robots” content=”follow, index, max-snippet:-1, max-video-preview:-1, max-image-preview:large”/>
<link rel=”canonical” href=”https://mytap.com.au/kitchen-taps/?product-page=3″ />
Hello,
The filter shared by my colleague adds the self-referencing canonical URL. If you want to use the URL of the main page as the canonical URL, you can remove the filter as it is being added by default.
Let us know if you need any other assistance.
Hello,
I added the following filter to your site and now the canonical URL of the paginated product categories is set as the URL of the first page: https://pastebin.com/VcGzWm0H
Please check and let us know if you need any other assistance.
Thanks thats great but can you tell me why the difference re rel=next here
This page has it
<link rel=”canonical” href=”https://mytap.com.au/product-category/phoenix-tapware/” />
<link rel=”next” href=”https://mytap.com.au/product-category/phoenix-tapware/page/2/” />
THis page doesn’t
<link rel=”canonical” href=”https://mytap.com.au/shop/” />
<meta property=”og:locale” content=”en_US” />
Thanks
Also just to confirm you added this to the child theme functions file?
Hello,
Your shop and category pages are not returning actual paginated pages like my colleague explained above, that’s why the rel="next"
tag is not being applied.
Also, if you look at https://mytap.com.au/product-category/phoenix-tapware/ and https://mytap.com.au/product-category/phoenix-tapware/page/2/, both of them have the same content, and the actual link for the 2nd page of your category pages is https://mytap.com.au/product-category/phoenix-tapware/?product-page=2
Yes, the filter should be added in our child theme’s functions.php or rank-math.php file:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope that helps.
Thank you.
I’m investigating the multiple urls. Will get back to you if required – Thanks
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.