WooCommerce for Services

#9052
  • Resolved Psinergy Llc
    Rank Math free

    We use WooCommerce to show our services instead of products (we have a handful of products, but about 90% are services). How would it be possible to tag those as services instead of products? Thanks much!

    • This topic was modified 4 years, 10 months ago by Psinergy Llc. Reason: wanted to give an example of URL service
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    Thank you for contacting Rank Math today.

    Unfortunately Rank Math automatically adds the Product rich snippet to all products in WooCommerce post type. To be able to add the services schema to the products, I would suggest that you short circuit this addition process and generate a custom services schema for your products by hooking in to the following filter:

    /**
     * Filter to Short-circuit Schema if a 3rd party is interested in generating their own data.
     * Replace $schmea_type with schema name like article, review, etc.
     * @param bool  $value true/false Default false
     * @param array $parts Post Data
     * @param array $data  Schmea Data
     * 
     * @return bool
     */
    add_filter( "rank_math/snippet/rich_snippet_{$schema_type}", function( $value, $parts, $data ) {
    	return true;
    }, 10, 3 );

    I hope this info helps. Thank you.

    ​​​​​​

    Where do I put that? What do I do after I put it there?

    Hi there,

    Thanks for the question.

    This code should be added to your theme’s functions.php file. The first step will be to customize this code to remove the product rich snippet with the following code:

    add_filter( "rank_math/snippet/rich_snippet_product", function( $value, $parts, $data ) {
    	return true;
    }, 10, 3 );

    The next step will be to generate your custom services schema that will be submitted on the page. Please take a look at the developer filters on this page for more info on this: https://rankmath.com/kb/filters-hooks-api-developer/

    I hope this info helps. Thank you.

    While I have been able to remove the “product” scheme, I’ve been unable to figure out how to add in Service scheme to those items 🙁

    Is it possible to have the software just update that stuff easily (like with a button)? Like in a future release?

    Hi there,

    Thanks for the response.

    We would be happy to help you further.
    Please edit the first post on this ticket and include your WP logins in the designated Sensitive Data section.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

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

The ticket ‘WooCommerce for Services’ is closed to new replies.