Single page titles based on tag?

#34279
  • Resolved Seoptiks
    Rank Math free

    I couldn’t find anything related to this in past tickets so thought I would ask. Is there a way to change the SEO page title based on a page category or tag? For example if I have a site which has several pages designated as services then I would like to make sure the word services gets inputted at the end of those pages, and other pages might need a different word. I realise I could do this with custom post types but I would prefer if I could just tag or categorize a page instead to achieve it?
    Any assistance would be greatly appreciated.

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math today.

    You can use the following filter to dynamically target the posts in this category and then modify the titles accordingly:

    /**
     * Filter to change the page title.
     * 
     * @param string $title
     */
    add_filter( 'rank_math/frontend/title', function( $title ) {
    	return $title;
    });

    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 1 replies (of 1 total)

The ticket ‘Single page titles based on tag?’ is closed to new replies.