Schema manipulation via PHP / Code

#529820
  • Resolved MandrillSphinx
    Rank Math free

    Hi!

    Situation:
    There is a wordpress website with all listed jobs of the main company.
    Every company part has own websites where i want to show jobs added at the main companys site.
    I made an api to get these jobs and i managed to route them correctly.
    The global Rank Math settings are showing up correctly on the company parts website, cause these infos are set on every website.
    I also get the rank_math_schema_JobPosting for each job from the main website.

    Problem: i need the rank_math_schema_JobPosting data in the schema, too, of course! Is there a way out of the box to add the JobPosting data in the application/ld+json schema-markup or can you give me a hint how to manipulate it before it will be rendered?

    Greetings
    Kevin

Viewing 4 replies - 1 through 4 (of 4 total)
  • Nigel
    Rank Math business

    Hello,

    Thank you for contacting Rank Math for help with generating jobPosting schema from data imported from another website. and sorry for the slow response.

    You can use the Rank Math json_ld filter to edit the schema before it is rendered on the website. Please refer to this article for how: https://rankmath.com/kb/filters-hooks-api-developer/#extend-json-ld-data. The article also contains other functions in our filters and hooks API.

    With Rank Math PRO you can also create schema templates as described in this knowledge base article: https://rankmath.com/kb/schema-templates/

    Hope that answers you. Please let us know if you have questions.

    OK, i think i got it! Thanks! 🙂

    Thank you. I understand this part. Using $data let me manipulate values by keys.

    But: how to convert this to valid json ld? Because if just return the manipulated $data, there are keys in it!
    Is there a function converting this $data?

    $data:
    “@context”: “https://schema.org”,
    “@graph”: [
    {
    “place”: {
    “@type”: “Place”,
    “@id”:

    json ld:
    “@context”: “https://schema.org”,
    “@graph”: [
    {
    “@type”: “Place”,
    “@id”:

    Hello,

    Glad that everything has been sorted out. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

You must be logged in to reply to this ticket.