%page% tag did not appear

#44146
  • Resolved Dee Satriya
    Rank Math free

    I trying to migrate from AIO Seo Pack to Rank Math since it free and has a lot more feature compare to AIO Seo Pack Free. But my problem is the %page% did not work with my theme. I’m using Pixwell Theme from themeforest with Ruby Composer as page builder. The %page% seems no working only on homepage (title tag and meta description), it is work on category and autho archive.

    Maybe you could check it for me so I can full migrate to Rank Math.

    Thanks you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • 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.

Viewing 9 replies - 1 through 9 (of 9 total)

The ticket ‘%page% tag did not appear’ is closed to new replies.