-
Hi,
I inspect my posts with SemRush. I have the same pb with many pages/posts
in Code source , tag header <H1> is different from Seo Title define by your plugin
In H1, I have title but not the customize rank Math Seo title
I have this pb with many page/posts
-
Hello,
Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.
I am not sure if I understand it well but the SEO Title will only appear in the Google Search Results and in the browser page title but it won’t change anything on the page. If you want that H1 to have the SEO Title, you should edit it, since the post/page title and the SEO title are different.
Looking forward to helping you. Thank you.
βββββββ
Hi Alberto
Maybe I’m very not clear
I know that H1=Tile
But I thought that if we changed the SEO title, the H1 tag = Seo title, and not title
My question: is it possible that H1 = Seo Title, and not Title?
Hello,
Well, it would be more about editing you the title of the post but if you are thinking about doing it automatically maybe you could achieve it using some WordPress filters (I haven’t tested it but something that comes to my mind is the following code):
function replace_title_with_seo_title( $title, $id = null ) { if($id!=null){ $title = '<h1>'.get_post_meta( $id, 'rank_math_title', true );.'</h1>'; } return $title; } add_filter( 'the_title', 'replace_title_with_seo_title', 10, 2 );
Looking forward to help you.
- This reply was modified 4 years, 4 months ago by Alberto.
Many Thanks Alberto
But if i insert this code in <head> , I have an error message
Hello,
You need to add it to the functions.php file (at the end) in your current theme. After that, it should work fine.
Looking forward to help you.
Sorry but Stntax error in this line :
$title = ‘<h1>’.get_post_meta( $id, ‘rank_math_title’, true );.'</h1>’;
syntax error, unexpected ‘.’
Hello,
Please remove the semi-colon before the final h1. The new line should be:
$title = β<h1>β.get_post_meta( $id, βrank_math_titleβ, true ).'</h1>β;
Hope that helps
Hello,
I have added some spacing in the h1 and the concatenation dot and it seems to work now. I have tested on a test site and there is no error. Are you adding the code in your theme functions.php?
function replace_title_with_seo_title( $title, $id = null ) { if($id!=null){ $title = '<h1>'. get_post_meta( $id, 'rank_math_title', true ).'</h1>'; } return $title; } add_filter( 'the_title', 'replace_title_with_seo_title', 10, 2 );
Looking forward to helping you. Thank you.
ββββββ
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
CATASTROPHIC !!
Sorry but after insert in functions.php
I have many bugs in all menus ( see screens in sensitive data)
and now in source code <H1> >H1> is empty !!!
Hello,
Since you were using Rank Math vars in the SEO Title, they need to be processed before printing the new title, I added it to the code:
function replace_title_with_seo_title( $title, $id = null ) { if($id!=null){ // We need to get the post var $currentPost = get_post($id); // Now we need to get the Rank Math SEO Title $seoTitle = get_post_meta( $id, 'rank_math_title', true ); // And finally we need to replace the Rank Math vars in the SEO Title $seoTitle = RankMath\Helper::replace_vars( $seoTitle, $currentPost ); // Now we can compose the new title $title = '<h1>'. $seoTitle .'</h1>'; } return $title; } add_filter( 'the_title', 'replace_title_with_seo_title', 10, 2 );
Looking forward to help you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Catastrophic Same !
H1 is empty on inspect element
For Menus, it’s horrible look
Hello,
We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WP logins in the designated Sensitive Data section.
It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping 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.
The ticket ‘different of your Seo title’ is closed to new replies.