Split: Bulk edit schema

#94465
  • Resolved Adam Helman
    Rank Math free

    Thanks Michael,

    Ok, so I added this to my functions.php:

    add_filter( "rank_math/snippet/rich_snippet_event_entity", "adz_event_schema_org_meta" );
    function adz_event_schema_org_meta($entity) {
    	$entity['organizer']['@type']	= "Organization";
    	$entity['organizer']['name']	= "Event 2 Event";
    	$entity['organizer']['url']		= "https://event2event.co.uk";
    	$entity['performer'] 			= "Organization";
    	
    	return $entity;
    }

    This is for an Event type – but when I view the page’s source those fields are still empty (except one which I think Rank Math is auto-filling) – see this screen shot.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello,

    Thank you for the follow up.

    You can use it as follows to add your performer and organizer:

    
    /**
     * Filter to change the schema data.
     * Replace $schema_type with schema name like article, review, etc.
     * @param array $entity Snippet Data
     * @return array
     */
    add_filter( "rank_math/snippet/rich_snippet_event_entity", function( $entity ) {
            $entity['organizer']['@type']	= 'Organization';
    	$entity['organizer']['name']	= 'Event 2 Event';
    	$entity['organizer']['url']	= 'https://event2event.co.uk';
    	$entity['performer']['name']	= 'Organization";	
     return $entity;
    });
    

    That should do it.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hi – thanks. Unfortunately no change (sorry) 🙁

    Aside from adding [name] to performer, your code looks exactly the same as mine (bar me actually defining a function name) – is that a fair observation?

    In which case, a couple of things:

    1) Spotted mixed quotation marks at the end of the “performer” line, but amended that
    2) Looking at the JSON template for Event, “performer” doesn’t have any subfields, it just has a value of either “Person” or “Organisation”. In which case, my version is correct (I believe) – but correct or not, when I view the page source, the following still hasn’t changed:

    [‘organizer’][‘@type’] is still showing as “Person”
    [‘organizer’][‘url’] is still showing as empty (“”)

    So it looks like the hook isn’t being triggered, or I’m not looking at the results properly?

    Thanks
    Adam

    Hello,

    We can take a closer look at the settings. Please edit the first post on this ticket and include your WordPress 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,

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

    Thank you.

    Hello,

    The schema you are checking is not being added by Rank math that is why the data doesn’t seem to update. It is likely being added by your events plugin or another plugin on your site. You can confirm this by disabling Rank math temporary and you will see the schema is still generated.

    Please check the screenshots I have added in the sensitive section. You will need to find the plugin generating this and either disable it or set Rank math schema to none to avoid duplicate and probably conflicting schema on your pages

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hi Michael

    I appreciate you looking and that does make sense. The Event Tickets and Event Calendar plugins may well be responsible for adding the schema – I’ll look into it.

    If they are, and I can disable that happening from those plugins, are you saying RM will then add it (if I have enabled it in RM), and then my filter will work?

    Hello Adam,

    Eliminating the extra markup will help us rule out probability of a conflict. We can then move on to troubleshoot Rank math schema as the only schema on your page, if the filter doesn’t work.

    Looking forward to helping you. Thank you.

    ​​​​​​

    I did briefly look and this doesn’t look like it will happen anytime soon as they have no option to toggle schema on or off.

    I suggest we close this ticket, and when or if the event folks allow it to be disabled I’ll then see if the filter works, and if it doesn’t then I’ll raise a new ticket.

    Thanks for your help so far… 🙂

    Alberto
    Rank Math business

    Hello,

    We are super happy that we were able to help you with your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

    • This reply was modified 4 years, 1 month ago by Alberto.
Viewing 9 replies - 1 through 9 (of 9 total)

You must be logged in to reply to this ticket.