Support » Plugin: WP Job Manager » google jobs

  • I have a question regarding Google jobs feed.

    I have noticed on some other job listings they have buttons for other locations to apply for a job. We only have the one, the main website!

    Is it possible to add in the job listing a custom field for our listings on other job sites? i.e. indeed etc.

    https://ibb.co/MM2fWnG
    We advertise our jobs on 4 other sites but not sure what custom meta field we need to add? Can anyone advise?

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 17 total)
  • Thread Starter pantsman28

    (@pantsman28)

    I noticed the one job advert I was especially interested is using WpJobboard?

    But where is the support for this plugin?

    Thread Starter pantsman28

    (@pantsman28)

    just not getting any help with this questions from anywhere?

    This is probably just the Google Jobs Schema markup … have you even looked to see what is required by Google for this? There’s numerous filters for you to be able to modify the schema/structured data.

    Here’s example code for adding custom structured data:
    https://gist.github.com/tripflex/c36b2e7a3f212bbeb8cefbf530080ea0

    If you’re expecting to get a response only an hour or two after posting in here … you have very high expectations for a free plugin.

    Thread Starter pantsman28

    (@pantsman28)

    Judging by the lack of replies to any questions on this plugin support I am surprised to get a reply. Funny I though this place was the place to get support from not only the plugin developers but from the community???

    Thanks @tripflex for your reply. I was looking through the Google Jobs Schema markup and couldn’t find the answer. I assume we can use the custom field in the job listing post to add the markup, but I haven’t found what that is yet.

    Thread Starter pantsman28

    (@pantsman28)

    Looking at the Google Structured Data Testing Tool all job listings are failing on streetAddress and baseSalary.

    Even though I add in the recommended geolocation_formatted_address in the custom fields and the salary field code

    add_filter( 'submit_job_form_fields', 'frontend_add_salary_field' );
    function frontend_add_salary_field( $fields ) {
      $fields['job']['job_salary'] = array(
        'label'       => __( 'Salary (£)', 'job_manager' ),
        'type'        => 'text',
        'required'    => true,
        'placeholder' => 'e.g. 20000',
        'priority'    => 7
      );
      return $fields;
    }
    add_filter( 'job_manager_job_listing_data_fields', 'admin_add_salary_field' );
    function admin_add_salary_field( $fields ) {
      $fields['_job_salary'] = array(
        'label'       => __( 'Salary (£)', 'job_manager' ),
        'type'        => 'text',
        'placeholder' => 'e.g. 20000',
        'description' => ''
      );
      return $fields;
    }
    add_action( 'single_job_listing_meta_end', 'display_job_salary_data' );
    function display_job_salary_data() {
      global $post;
    
      $salary = get_post_meta( $post->ID, '_job_salary', true );
    
      if ( $salary ) {
        echo '<li>' . __( 'Salary:' ) . ' £' . esc_html( $salary ) . '</li>';
      }
    }

    function.php code to display salary.

    Thread Starter pantsman28

    (@pantsman28)

    ok, what about this support then?
    I did have a look at the salary side of things when I visited https://github.com/Automattic/WP-Job-Manager

    On my local test it did break the Job listings all Jobs view, so reluctant to test on a live site.

    But still answer to either my original question or the fix for street address google jobs schema?

    Plugin Support bindlegirl

    (@bindlegirl)

    Hi @pantsman28 !

    Have you checked out the document we have here: https://wpjobmanager.com/document/fixing-structured-data-issues/

    We have a GitHub issue about adding the salary field for the Google Structured data here: https://github.com/Automattic/WP-Job-Manager/issues/1320

    Thread Starter pantsman28

    (@pantsman28)

    @bindlegirl

    I had a look at the google Structured data and some of the other possible changes to files and hooks. Managed to clear out the old methods and used the new filter hooks and this works. This should be implemented in the next update.

    Still getting an error on
    `jobLocation
    type
    Place
    address
    Missing field “jobLocation.address.streetAddress” (optional)`

    The loco translate method doesn’t work. Even tried different geolocation_address, geolocation_formatted_address…. in custom fields nothing seems to work? I assume this is custom mapped in the plugin somewhere?

    I have asked google community about my original question about multiple ways to apply, as this is nowhere to be seen in the documentation or in the github community for this plugin

    Thread Starter pantsman28

    (@pantsman28)

    UPDATE: Location in the job listing > job data – is actually the schema for jobLocation.address.streetAddress

    Putting the full address into this field satisfies Google Markup, we use this location field to categories jobs to allow us to show jobs from the same area our landing pages.

    • This reply was modified 1 month, 1 week ago by pantsman28. Reason: found function
    Plugin Support bindlegirl

    (@bindlegirl)

    @pantsman28 It sounds like you have managed to solve the Google schema problems. Did I get that right? Or, do you still need help with this?

    Thread Starter pantsman28

    (@pantsman28)

    Out of interest, I am modifying the salary schema in the functions.php to include a new field which is to replace the job location builtin to the plugin.

    I am aware I need to include a location markup for google jobs, our jobs don’t show a full address (Long story – common practice for Agencies)

    As I don’t want it to have duplicate schemas. Do anyone know of hook to remove the scheme from the builtin plugin?

    Happy to share my code once I have finished.

    Plugin Support bindlegirl

    (@bindlegirl)

    @pantsman28

    Is this what you are looking for:

    add_filter( 'wpjm_get_job_listing_structured_data', '__return_false' );

    Thread Starter pantsman28

    (@pantsman28)

    does this only effect locations? because if so then yes

    Thread Starter pantsman28

    (@pantsman28)

    Tested this, this removals all job listing structured data.

    Thread Starter pantsman28

    (@pantsman28)

    Ok to explain things better ‘Location’ is a viewable field on the frontend of the site. We only use a area location, i.e. Worcester

    As you know this creates errors for google job listings as it’s an incomplete address. However, I see the plugin maps streetAddress etc.

    To get around this I have used the salary function code to rewrite a new field called ‘Address’ This field will be a full address to cater for google jobs schema, but not visible on the frontend to the public.

    The code so far

    /* START ADD ADDRESS */ 
    add_filter( 'submit_job_form_fields', 'frontend_add_address_field' );
    
    function frontend_add_address_field( $fields ) {
      $fields['job']['job_address'] = array(
        'label'       => __( 'Address', 'job_manager' ),
        'type'        => 'text',
        'required'    => true,
        'placeholder' => 'e.g. 20000',
        'priority'    => 8
      );
      return $fields;
    }
    add_filter( 'job_manager_job_listing_data_fields', 'admin_add_address_field' );
    function admin_add_address_field( $fields ) {
      $fields['_job_address'] = array(
        'label'       => __( 'Address', 'job_manager' ),
        'type'        => 'text',
        'placeholder' => 'Worcester',
        'description' => ''
      );
      return $fields;
    }
    add_action( 'single_job_listing_meta_end', 'display_job_address_data' );
    
    function display_job_address_data() {
      global $post;
    
      $address = get_post_meta( $post->ID, '_job_address', true );
    
      if ( $address ) {
        echo '<li class="hideadd">' . __( 'Address:' ) . ' ' . esc_html( $address ) . '</li>';
      }
    }
    // Add Google structured data
    add_filter( 'wpjm_get_job_listing_structured_data', 'add_basesaddress_data');
    
    function add_basesaddress_data( $data ) {
    global $post;
    
    $data['jobLocation'] = [];
    $data['jobLocation']['@type'] = 'Place';
    $data['jobLocation']['address'] = [];
    $data['jobLocation']['address']['@type'] = 'PostalAddress';
    $data['jobLocation']['address']['streetAddress'] = get_post_meta( $post->ID, '_job_address', true );
    $data['jobLocation']['address']['addressLocality'] = [];
    $data['jobLocation']['address']['addressRegion'] = [];
    $data['jobLocation']['address']['postalCode'] = [];
    $data['jobLocation']['address']['addressCountry'] = 'UK';
    
    return $data;
    }
    /* END ADD ADDRESS */ 
    

    Now the street address becomes visible in the job data and on the frontend of the single job listing. How I can hide this from public view or competitors.
    https://ibb.co/hR1Tprb
    How do you map [‘addressLocality’] to the custom fields or to the existing job_listing_location_structured_data ?

    • This reply was modified 1 month, 1 week ago by pantsman28. Reason: gramma
Viewing 15 replies - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.