Fix default schema not being applied to the opengraph meta tags

#311345
  • Resolved David Web Developer
    Rank Math free

    Hello,

    Thanks for the great plugin.

    I noticed what seems to be a bug. The default schema for a post type is not being applied to the opengraph meta tags, and only applies when one is set on the post/page level.

    If you take a look in the Opengraph class in /includes/modules/schema/class-opengraph.php around line 44 you’ll see that it checks for schemas against the current post only, and ignores any global level schema that has been set for a post type. This results in some missing meta tags.

    For example: if I set the default schema for posts as “Article” the meta tag article:published_time and article:modified_time will be missing from all the posts unless I set the schema type as “Article” on the individual posts. This is not practical if I have thousands of posts.

    The default schema is being applied to the JSON schema and is only missing in the meta tags.

    Please address this.

    Thank you.

    – David

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thanks for contacting us and sorry for any inconvenience that might have been caused due to that.

    This is the intended behavior. When you apply a default Schema, it is only applied to the Schema Markup of the new posts and doesn’t get saved in the postmeta table of your database. The OpenGraph tags rely on the data from the database. In order to save the Schema Data in the database, you will have to edit the Schema in the post editor and click on the Save for This Post option. Once done the meta tags will be applied to the posts.

    Hope this helps. Let us know if you need any other assistance.

    Thank you for your response, Jaideep.

    When you apply a default Schema, it is only applied to the Schema Markup of the new posts and doesn’t get saved in the postmeta table of your database

    The term “default” would imply it’s the fallback in case one isn’t set. If we have to manually set this it makes it pointless. To hear “this is the intended behavior” is a little disappointing from what is otherwise a well-made plugin

    In order to save the Schema Data in the database, you will have to edit the Schema in the post editor and click on the Save for This Post option. Once done the meta tags will be applied to the posts.

    This is very inconvenient for people migrating to your plugin who have thousands of posts. We should not have to have to manually save each post in order to apply a default schema.

    Jaideep, what is your suggestion for sites with thousands of posts who want to apply the default schema?

    Hello,

    Currently, there is no workaround for this. However, our plugin also adds the og:updated_time tag automatically to all the posts that will submit the modification time of the posts to social media platforms. For Google, it is submitted by the Schema.

    Having said that, I have forwarded this to the devs as a feature improvement for further discussion.

    Please don’t hesitate to get in touch in case you need any other assistance.

    Thanks.

    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.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘Fix default schema not being applied to the opengraph meta tags’ is closed to new replies.