-
I have a custom page template built in PHP, so there is not rankmath settings i can edit for this page.
There is not post type it’s a post type archive.I’m trying to write a custom title and meta description in the template with the following code but it’s not working.
get_header();
$queried_object = get_queried_object();
$post_type = get_taxonomy( $queried_object->taxonomy )->object_type[0];// Set custom title and meta description for SEO
if ( function_exists( 'rank_math' ) ) {
$page_title = 'Insurance Marketplace: Buy Insurance Online at the Lowest Prices';
$meta_description = 'Navigate the insurance marketplace and buy insurance online now. Enjoy the convenience of finding the lowest prices tailored for your needs.';rank_math()->titles->title = $page_title;
rank_math()->titles->description = $meta_description;
}
?>
The ticket ‘add custom title and meta to a page template’ is closed to new replies.