-
Hello,
I have a quick question for you.
Google sees title for our home page as “Sitename: Title” instead of “Title | Sitename”….. All the other pages are okay; the only different thing is the schema. All of our pages are “article”, and our homepage is “service”. I looked around the files, and found the only difference in settings->titles, in post-type.php,
$cmb->add_field(
[
‘id’ => ‘pt_’ . $post_type . ‘_title’,
‘type’ => ‘text’,
/* translators: post type name */
‘name’ => sprintf( esc_html__( ‘Single %s Title’, ‘rank-math’ ), $name ),
/* translators: post type name */
‘desc’ => sprintf( esc_html__( ‘Default title tag for single %s pages. This can be changed on a per-post basis on the post editor screen.’, ‘rank-math’ ), $name ),
‘classes’ => ‘rank-math-supports-variables rank-math-title’,
‘default’ => ‘%title% %page% %sep% %sitename%’,
‘attributes’ => [ ‘data-exclude-variables’ => ‘seo_title,seo_description’ ],
‘sanitization_cb’ => [ ‘\RankMath\CMB2’, ‘sanitize_textfield’ ],
and for homepage.php:
cmb->add_field(
[
‘id’ => ‘homepage_title’,
‘type’ => ‘text’,
‘name’ => esc_html__( ‘Homepage Title’, ‘rank-math’ ),
‘desc’ => esc_html__( ‘Homepage title tag.’, ‘rank-math’ ),
‘classes’ => ‘rank-math-supports-variables rank-math-title’,
‘default’ => ‘%sitename% %page% %sep% %sitedesc%’,
‘sanitization_cb’ => [ ‘\RankMath\CMB2’, ‘sanitize_textfield’ ],
‘attributes’ => [ ‘data-exclude-variables’ => ‘seo_title,seo_description’ ],
]
If we change homepage.php to:
cmb->add_field(
[
‘id’ => ‘homepage_title’,
‘type’ => ‘text’,
‘name’ => esc_html__( ‘Homepage Title’, ‘rank-math’ ),
‘desc’ => esc_html__( ‘Homepage title tag.’, ‘rank-math’ ),
‘classes’ => ‘rank-math-supports-variables rank-math-title’,
‘default’ => ‘%title% %page% %sep% %sitename%’,
‘sanitization_cb’ => [ ‘\RankMath\CMB2’, ‘sanitize_textfield’ ],
‘attributes’ => [ ‘data-exclude-variables’ => ‘seo_title,seo_description’ ],
]
Would it fix the problem? If not, what would fix this problem? I did enter the title manually in “Schema” tab, instead of “%seo_title%”…. it didn’t help either. I also looked into snippets PHP files, and I did not see anything there, besides pointing to this file.
Thank you for your help,
Alexis.
The ticket ‘SEO Title is not showing correctly in Google’ is closed to new replies.