Getting the rendered meta title value in PHP

#107334
  • Resolved Jeffery Ng
    Rank Math free

    Version of Mathrank: Any.

    Right now, if I set meta title value of a page, I can use the following to retrieve it:
    get_post_meta( $pageID, ‘rank_math_title’, true );

    But if I try to use the same method to retrieve the meta title for a page that is just using the “default” settings (the one that is built from the settings in the admin pages), I get no results.

    I looked through https://rankmath.com/kb/filters-hooks-api-developer/ but it’s all information about changing the data, not retriving it.

    In PHP, is there a way to get the final rendered meta title value for a given page/post/custom type?
    Is there a filter, or hook, or api that I can query?

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math today.

    Please use following function to get the final rendered title: RankMath\Paper\Paper::get()->get_title()

    I hope that helps. 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 1 replies (of 1 total)

The ticket ‘Getting the rendered meta title value in PHP’ is closed to new replies.