How can I set up schema to use LodgingBusiness, subtype VacationRental?

Hi there,

How can I set up schema to use LodgingBusiness, subtype VacationRental?

Kind regards,

Jovica

Hi,

Please clarify: is this type not on the list, or what exactly is the issue? If it is in the list, you just need to select this type in HivePress > Settings > Listings > SEO, and then match the attributes. As for the price and reviews, if you have the Marketplace and Reviews extension, they will be automatically added to Schema.

Hi Andrii,

Vacation Rental schema is not in the list.

However, it is the one that Google uses for the holiday home rentals:

Kind regards,

Jovica

Please try using this code snippet to make this Schema type available:

add_filter(
	'hivepress/v1/schema_types',
	function( $types ) {
		$types['VacationRental'] = 'VacationRental';

		return $types;
	}
);

We’ll also update a list of Schema types in the next update.

Hope this helps

Thanks for this.

I have now enabled that schema:
image

However, I cannot link the listing attributes to the schema elements:
image

Kind regards,

Jovica

Unfortunately this temporary fix also requires a snippet with a list of properties you want to map for this type. Here’s an example with 2 properties, in the same way you can add more:

add_filter(
	'hivepress/v1/schema_properties',
	function( $properties ) {
		$properties['checkinTime']['types'] = 'VacationRental';
		$properties['petsAllowed']['types'] = 'VacationRental';

		return $properties;
	}
);

Hope this helps

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.