Each GeoDirectory category has a Schema Type setting. The structured data on a listing’s page uses the schema type of the listing’s default category. If that category has none, it uses LocalBusiness (Event for events).
Set the schema type of a category
- Go to Places > Categories and edit the category.
- Choose a type in the Schema Type dropdown.
- Update the category.
The dropdown already has a long list of schema.org types, grouped under their parent type. Look through it before adding your own. For example, MusicGroup sits under PerformingGroup, and Person is near the bottom.
Add a type that isn’t in the list
Use the geodir_cat_schemas filter. The array key is the schema.org type name and the value is the label shown in the dropdown:
add_filter( 'geodir_cat_schemas', function( $schemas ) {
$schemas['Product'] = 'Product';
return $schemas;
} );
Add the snippet with the Code Snippets plugin, then edit your category and the new type will be in the dropdown.
Only add real schema.org type names. GeoDirectory outputs the same listing details whichever type you pick, so test a listing page in Google’s Rich Results Test after you change it. Developers who need to change the full output can use the geodir_details_schema filter.
Why the default category matters is explained in what is the default category field for.