Modify Job Posting Schema with default data

#31158
  • Resolved Chuks21
    Rank Math free

    Good Morning

    Please i just got a manual action from google saying “JobPosting markup used on an expired job with the validThrough property set in the past”

    There are over 5000 jobs already published on the site and we are using the default data for job schema.

    Last time i contacted you, you gave me some codes that i will add to my function.php that will populate some values automatically. it actual worked fine.

    But the issue i m having right now is the “ValidThrough”, and its not possible for me to start editing all the posts one by one.

    Since 80% of the job openings we have on our sites expires 15 days after it get published, is it possible to come up with custom value of “ValidThrough” field set to 15 days in future from the post published date?

    What i mean is this:

    If a post is published on 1st May 2018, The ValidThrough value should be 15th May 2018. If i publish a post today being 9th Feb 2020, the validThrough will automatically read (9th + 15th) 24th Feb 2020.

    Thanks very much

    Chuks

    modify Job Posting Schema with default data

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math today.

    You can still use the same code to modify the Valifthtough variable as follows

    /**
     * Filter to modify Job Posting Schema with default data
     *
     * @param array $entity Snippet Data
     * @return array
     */
    add_filter( 'rank_math/snippet/rich_snippet_jobposting_entity', function( $entity ) {
        global $post;
        $entity['ValidThrough']= //add your desired valid through date here
        return $entity;
    });

    Looking forward to helping you. Thank you.

    ​​​​​​

    • This reply was modified 4 years, 8 months ago by Michael Davis.

    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 1 replies (of 1 total)

The ticket ‘Modify Job Posting Schema with default data’ is closed to new replies.