Hello,
Thank you for contacting Rank Math today.
The %page% parameter in Rank Math can only be used on paginated pages but not the homepage.
Could you please share some more details of how you would like the titles to appear so that we can advise further?
Looking forward to helping you. Thank you.
Yes, but there is a paginated content in homepage, in my blog section.
Hello,
Thank you for the follow up.
The credentials you provided don’t seem to be working. Could you please check so we can look further.
Looking forward to helping you. Thank you.
Check it again, I just add new user.
Hello,
Rank Math %page% variables only work on the archive pages. Since your homepage is a static page, the variable is not working. To make it work, I added the following code in your theme’s functions.php file:
add_filter( 'rank_math/frontend/title', function( $title ) {
if ( ! is_front_page() ) {
return $title;
}
global $wp_query;
if ( ! empty( $wp_query->query[ 'paged' ] ) && $wp_query->query[ 'paged' ] > 1 ) {
return $title . ' ' . $wp_query->query[ 'paged' ];
}
return $title;
});
The paginated page title is now showing the page number with the main title. Can you please confirm?
Thank you.
Hello,
Yes it is working know. But can you make it like “Page 2” instead of only the page number please?
Thanks,
Hello,
I changed the code to the following:
add_filter( 'rank_math/frontend/title', function( $title ) {
if ( ! is_front_page() ) {
return $title;
}
global $wp_query;
if ( ! empty( $wp_query->query[ 'paged' ] ) && $wp_query->query[ 'paged' ] > 1 ) {
return $title . ' Page ' . $wp_query->query[ 'paged' ];
}
return $title;
});
I hope that helps.
Thanks, it work. I will save your code by the way.
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.