How to put url in organization schema?

#700079
  • Resolved Junuk Seo
    Rank Math free

    hello.

    I would like to put a url field in my Organization Schema that specifies my website, for example, like the code below.

    "@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://kblissvn.com/#organization","name":"Kbliss","url":"https://kblissvn.com/","sameAs":["https://.....

    The Organization Schema generated by RankMeses by default does not include this url field. Can you please let me know if there is a way to add the ur field using Functions.php or if there is another way?

    Thank you.

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

    We appreciate your concern about adding the URL field to the Organization Schema. The Organization Schema generated by Rank Math does not include the URL field by default. However, you can add the URL field to the Organization Schema using the following code snippet in your functions.php file:

    add_filter( 'rank_math/json_ld', function( $data ) {
        $data['Organization']['url'] = 'https://rankmath.com/wp-content/uploads/2021/03/select-url.jpg';
        return $data;
    });

    Please ensure that you replace 'https://rankmath.com/wp-content/uploads/2021/03/select-url.jpg' with your actual website URL.

    We recommend adding this code snippet to your child theme’s functions.php or rank-math.php. Adding it to your parent theme could mean that you’ll lose all changes upon updating when your theme developer releases an update.

    If you have any further questions or need assistance with this, please feel free to ask.

    Sources:
    Remove Organization Schema from Your Website » Rank Math
    Configuring “Schema Markup” in Rank Math » Rank Math
    How to Import Schema From Any URL Using Rank Math » Rank Math
    Using Rank Math’s Local SEO Module » Rank Math

    Hello,

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to this issue.

    Kindly ignore the Bot’s reply and you can remove the filter code from your site. If you add this field by filling the URL textfield in WordPress Dashboard > Rank Math > Titles & Meta > Local SEO:

    After doing that clear all site and server cache and check the Organisation Schema again.

    Let us know how this goes. Please let us know if you have further questions or concerns.

    Thank you.

    Junuk Seo
    Rank Math free

    I tried the code the bot gave me, but the URL is displayed like this

    "@context":"https://schema.org","@graph":[{"url":"https://kblissvn.com/"},{"@type":"Organization","@id":"https://kblissvn.com/#organization","name":"Kbliss","sameAs":....

    The Url field is not being inserted inside the Organization schema.

    Junuk Seo
    Rank Math free

    Hi, Thanks for asnwering

    I’ve already entered the URL in that field and emptied the cache, but it still doesn’t work.

    On my website, it looks like this

    rank-math-schema">{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://kblissvn.com/#organization","name":"KBLISS"}

    I’m sending you the address of my website and the admin page.

    Junuk Seo
    Rank Math free

    Hello,

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

    Thank you.

    Hello,

    We have added this filter to your child theme’s functions.php file to add the URL of your site into the Organization schema

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    if( isset( $data['publisher'] )) {
    		$data['publisher']['url'] = 'https://kblissvn.com/';
    		return $data;
    } 
    	return $data;
    }, 99, 2);

    You may also check the source code if it’s already working fine.

    Hope that helps.

    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 ‘How to put url in organization schema?’ is closed to new replies.