Meta title is not getting updated by %currentyear% shortcode

#7063
  • Resolved Anonymous
    Rank Math free

    https://support.rankmath.com/ticket/auto-add-dynamic-year-in-wordpress-post-titles/

    function my_custom_RM_title_replace_vars( $title, $id = null ) {

    return RankMath\Helper::replace_vars( $title );
    }
    add_filter( ‘the_title’, ‘my_custom_RM_title_replace_vars’, 10, 2 );

    I have added this piece of code its working fine in post title. But not in meta tags

    But its not changing anything in meta tags

    • This topic was modified 5 years, 10 months ago by .
    • This topic was modified 5 years, 10 months ago by .
Viewing 5 replies - 1 through 5 (of 5 total)
  • Anonymous
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Anonymous
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Anonymous
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Anonymous
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    To override this customization, please add this code to your functions.php file:

    add_filter( 'rank_math/frontend/title', function( $title ) {
    	$var = "%currentyear%";
    	$title = str_replace("%currentyear%",RankMath\Helper::replace_vars($var),$title);
    	return $title;
    });
    

    I hope this info helps. Thank you.

    Looking forward to helping you. Thank you.

    ​​​​​​​

    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.

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

The ticket ‘Meta title is not getting updated by %currentyear% shortcode’ is closed to new replies.