Hello @thatmme,
Thank you for contacting support.
If you are using the HowTo block from our plugin and would like to change the name you can apply the following custom filter on your website:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
$data['howto']['name'] = 'My custom title for HowTo Schema markup'; //Change to the title you want for your page
return $data;
}, 99, 2);
Hope this helps solve your issues.
Don’t hesitate to get in touch if you have any other questions.
Thank you for very much, but does that mean if I want it on another page for a different title, says, my next “howto” is: How To Visit Our School Without School Bus” Do I need to go and paste the same code all over again on function.php and change the text name. I am sorry, I am just confused?
Because we are intending to add many howtos on our website and which title will be different from the page title obviously.
Hello @thatmme,
You can modify the snippet to follow a specific pattern for the HowTo title.
You can easily modify the title when using the HowTo Schema from the Schema Generator of Rank Math, but when using the HowTo block, to have a different title, you’ll need to use the snippet.
There are two approaches you can follow here:
1. Use the HowTo Schema from the Schema Generator available in the PRO version and add the shortcode from the Schema to the content to extract the data.
2. Either define a pattern in the Snippet or add a custom field using a plugin like ACF to the posts/pages and add the required HowTo title there.
Further, use the get_field() function to fetch the value of that field and use it in the snippet provided in our previous reply.
The final code in this case would be something like:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
$data['howto']['name'] = get_field('field_name'); //Replace 'field_name' with the name of the created feild
return $data;
}, 99, 2);
Hope that helps. Thank you.
Thank you so much. this solve issue.
sorry, when i tried the code, my editor the name field is not editable.
scrrenshot: https://snipboard.io/oFMNqG.jpg
secreenshot: https://snipboard.io/GKwZP2.jpg
screenshot 3: https://snipboard.io/HDRobL.jpg
The field “name1” is not editable for me to put the name for my howto schema.
i have resolved it. I never added any field earlier. It’s working perfectly now.
Hello @thatmme,
We’re really glad that it is working properly and that the solution helped.
Please feel free to reach out to us in case you need any other assistance. We are here to assist.
of course. i am really grateful for your team.