Hello,
We apologize for the issue you are facing with Rank Math’s meta titles and schema settings. It’s understandable that you want to have more control over how your schema title/name is generated, especially when it comes to optimizing for search engines and user experience.
To customize the schema title/name separately from the meta title, you can follow these steps:
-
Edit the Schema Settings: Go to the post or page where you want to change the schema title. In the Rank Math meta box, navigate to the Schema tab.
-
Set Custom Headline: In the Schema Builder, you can manually set the Headline for your schema. Instead of using %seo_title%
, you can enter a custom title that reflects what you want for the schema.
-
Save Changes: After making your changes, ensure you save them to apply the new schema title.
By doing this for each post or product, you can ensure that the schema title/name is exactly what you want it to be, without including unnecessary elements like your website’s name or other optimizations that are not relevant to the schema.
Currently, there isn’t a global setting in Rank Math to change this behavior by default across all posts and pages, but we appreciate your feedback on this matter. We will consider it for future updates.
If you have any further questions or need assistance with specific settings, please feel free to reply to this ticket, and a human agent from our support team will assist you further.
Sources:
Google Shows A Different Meta Title/Description For My Site » Rank Math
This is an automated reply from Rank Math Support Bot. Your ticket has been assigned to a human agent and we will get back to you shortly.
Hi,
that does not really work.
For one, you cannot change the Woocommerce product schema on the product page in the Rank Math section. It is locked.
Second, you can change it for pages but it still shows the wrong name for the “isPartOf” name from the webpage.
Hello,
Thank you for contacting support,
It is the expected behavior of the WooCommerce product schema since it fetches all the data from the products automatically according to your settings and makes your products schema-ready:
https://rankmath.com/kb/woocommerce-product-schema/
If you want to create a custom product schema you can refer to this guide: https://rankmath.com/kb/schema-generator/. This can however only be done using the PRO version.
Still, you are using the Free version and don’t have access to the schema template option you unset the default webpage schema and append a custom webpage schema. You can modify the following snippet:
add_filter( 'rank_math/json_ld', function( $schemas, $jsonld ) {
// Unset the default WebPage schema
unset( $schemas['WebPage'] );
// Remove custom WebPage schemas added by Rank Math or other sources
foreach ( $schemas as $key => $schema ) {
if ( 'webpage' === strtolower( $schema['@type'] ) ) {
unset( $schemas[ $key ] );
}
}
// Add custom WebPage schema
$customWebPageSchema = array(
"@type" => "WebPage",
"@id" => "https://example.com/custom-article/#webpage", // Update this with your URL
"url" => "https://example.com/custom-article/", // Update this with your URL
"name" => "Custom Article Title", // Update this with your title
"datePublished" => "2024-05-18T08:11:28+00:00", // Update with your published date
"dateModified" => "2024-06-09T08:46:47+00:00", // Update with your modified date
"isPartOf" => array(
"@id" => "https://example.com/custom-article/#website" // Update this with your website ID
),
"inLanguage" => "en-US" // Update this with your language code
);
$schemas['WebPage'] = $customWebPageSchema;
return $schemas;
}, 99, 2 );
Here’s how you can add filter/hook to your WordPress site: https://rankmath.com/kb/wordpress-hooks-actions-filters/
We hope this helps. Please let us know if you have further questions or concerns.
Thank you.
Thanks, this would not work since you would have to do it manually for each and every page…
And regarding the Woocommerce product: how can the schema title be changed to not fetch the seo title but the default Woocommerce product title? I think this should be the default, you will see it in every webshop that the meta title for a product is different than the schema title.
Thank you.
Hello,
In this case, if you want to change the product name in the schema same as your product title for all of your products, then you can use the following filter on your website:
add_filter( "rank_math/snippet/rich_snippet_product_entity", function( $entity ) {
global $post;
entity['name'] = wc_get_product( get_the_ID() )->get_title();
return $entity;
});
Hope that helps.