Yes, that fixes the link. Thank you, the site is almost done.
Now to fully resolve this I need any page that is not page 1 in the archive to become noindex and nofollow.
I've noticed that every big site that does something similar paginates using parameters to easily implement this:
hidden link >>> hidden link
hidden link >>> hidden link
What is the way to do this in Toolset?
Is it possible to do pagination using parameters?
Simply adding <meta name="robots" content="noindex, nofollow" /> to Page 2 onwards will fix it.
Your Ajax automatic loading for pagination I see it also doesn't create pagination but it does automatic transition which is not good for my case.
Unfortunately, there isn't such kind of built-in feature within Toolset plugins, the pagination link of archive page is defined in your WordPress setting:
Dashboard-> Settings-> Permalink, for example, option "Plain", it will change all permalink settings of your website to URL parameter based links.
More help:
https://wordpress.org/support/article/using-permalinks/
I believe I found the solution on the RankMath forum but need help to customize it for Toolset.
Can you please help me customize this to:
if the taxonomy is Courses or Free Courses and page is 2 or higher make it noindex and nofollow. Make it follow and index for default first-page result that doesn't have pagination number added to it.
Thank you.
/**
* Allows filtering of the robots meta data.
*
* @param array $robots The meta robots directives.
*/
add_filter( 'rank_math/frontend/robots', function( $robots ) {
if(is_paged() && is_category()){
$robots['index'] = "index";
$robots['follow'] = "follow";
}
return $robots;
});
I suggest you replace the is_category() function of the codes you mentioned above with another function is_tax(), for example, replace this line from:
if(is_paged() && is_category()){
With:
if(is_paged() && is_tax('courses')){
More help:
https://developer.wordpress.org/reference/functions/is_tax/
Determines whether the query is for an existing custom taxonomy archive page.
My issue is resolved now. Thank you!