1. Home
  2. Developer
  3. Code Snippets
  4. Setting the remote location for Google for jobs

Setting the remote location for Google for jobs

If you want to set the allowed remote location in the Job posting (JobPosting) structured data. You will need to assign a custom field (customText22 in the example code) in Bullhorn and add this code to add to the JSON+ld data

add_filter( 'matador_bullhorn_import_save_job_jsonld', function( $ld, $job ) {

	if( ! empty( $job->customText22 ) ){
		$ld["jobLocationType"] = "TELECOMMUTE";
		foreach ( (array) $job->customText22 as $key => $value) {
			$ld["applicantLocationRequirements"][] = [
				"@type" => ( "usa" === strtolower( $value ) ) ? 'Country' : 'State',
				'name' => ( "usa" !== strtolower( $value ) ) ? $value . ', USA' : $value,
			]; 
		}
	}

return $ld;
}, 11, 2 );

This code will allow you to use a multi-picker in Bullhorn and set USA if the whole of US is allowed.
The Bullhorn picker in this example had “USA” and all the states as options.


If not in the US you will have to adjust as needed.

Updated on June 27, 2023
Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support