Add new fields

  • I have added some codes to the schema in the file link attached to sensitive data. Now, I want to add the fields for the added properties without affecting the plugin capability. Also, I want these settings to be permanently present in the schema with any modifications required after updating the plugin. Thanks!

Viewing 9 replies - 16 through 24 (of 24 total)
  • Hello,

    Thank you for contacting Rank Math today.

    I have logged in to your site but I could not reproduce the error. Is this error reported on a specific page? If so, could you share a link?

    Looking forward to helping you. Thank you.

    ​​​​​​

    Removing the coding and reinstalling the plugin solved the issue.

    Can you please do the hard work of providing me the code of adding only one field; ONLY ONE?. Like I want to add a field for the property ‘birthDate’; please show me the example only for this field. After getting a little idea, I can do the rest work on my own. Even if you feel that this is difficult, please see the code I have provided above which didn’t work for me and I am facing the problem which doesn’t allow me to add some schemas. You can edit only one line of code and reply. Thanks!

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Deactivating, removing and installing the plugin fixed the issue.

    Can you please do the hard work of providing me the code of adding only one field; ONLY ONE? Like I want to add a field for the property ‘birthDate’; please show me the example only for this field. After getting a little idea, I can do the rest work on my own. Even if you feel that this is difficult, please see the code I have provided above which didn’t work for me and I am facing the problem which doesn’t allow me to add some schemas. You can edit only one line of code and reply. Thanks!

    I want your help in adding only one field here; ONLY ONE FIELD AND NO MORE CUSTOMIZATION

    https://imgur.com/a/sKc9eEp

    schema: person
    field to be added: Birth Date
    schema property: birthDate

    Thank you so much!

    Hi Pravesh,

    Thanks for the reply.

    I am glad that you have been able to fix the errors.
    It is not possible to add a new field attribute that does not exist in the plugin. You have to disable the person schema generated by Rank Math and then pass an array of your complete JSON-LD data to the filter.

    An alternative that would seem simpler for your use case is to use the following JSON-lD generator tool to generate the Person schema: https://jsonld.com/json-ld-generator/ and then add the generated schema to the header of your pages. You can use the header and footer injector plugin for this.

    Here is an example of the complete script that you would need to add to your site header:

    <script type='application/ld+json'>
    {
      "@context": "http://www.schema.org",
      "@type": "person",
      "name": "Name",
      "jobTitle": "Job title",
      "gender": "male",
      "image": "image-url",
      "address": {
         "@type": "PostalAddress",
         "streetAddress": "12345",
         "postOfficeBoxNumber": "25",
         "addressLocality": "city",
         "addressRegion": "state",
         "postalCode": "123",
         "addressCountry": "country"
      },
      "email": "test@gmail.com",
      "birthDate": "2020-04-21",
      "alumniOf": "alumni of",
      "birthPlace": "birth place",
      "memberOf": "republican",
      "nationality": "Chinese",
      "telephone": "012542"
    }
    </script>

    We are looking forward to helping you. Thank you.

    Thanks for the reply but I want to extend the functionality of Rank Math by the code you had provided. I don’t think this options fits for my site as data is different everytime. So, adding more fields in the schema generated by rank math within the post is what I want.

    If this is not possible at the moment, it’s okay. You can add more fields in the next update or leave it the way as it is now. I will try the plugins of other developers in the future as no-one has worked on it till date as per my research. Thanks!

    It would have been better if I got the reply that we cannot add more fields in the beginning instead of the code to be added in the functions.php that brought a false hope.

    If it’s not possible, you can mark this thread as solved though it’s not. 🙂 Thanks!

    Hi there,

    Thanks for the reply.

    Please let us know if we can help with anything else.

Viewing 9 replies - 16 through 24 (of 24 total)

The ticket ‘Add new fields’ is closed to new replies.