HomePage Schema

#537328
  • Resolved Musa Ildirimzade
    Rank Math free

    Hello, I started using New Rank Math. But I can only edit the home page of the theme I use with “customizer”. So there is no Homepage in the wordpress pages tab. The theme I am using is Soledad. The feature I want to use for my homepage is custom schema.

    And many features, focus keyword and more. The only ones I can control are the Meta description and Title. Please help me.

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

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

    I checked the theme “soledad” and it looks like the frontpage is latest posts which lists down the posts of various categories. As you already pointed out that there’s no page, so schema and focus keyword is not available for frontpage using latest posts.

    Having said that, you can use our Pro plugin and create custom schema and assign it to homepage. You can read more about it here: https://rankmath.com/kb/schema-generator/

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

    Thank you.

    Ok, let’s say I have created a custom schema, how do I apply it to my homepage? I need to know this before I upgrade to the pro version. Is there such a setting? (for my situation)

    Please help.

    Hello,

    Thank you for providing additional information.

    After going through all the option, the best way to add custom schema to homepage is via filter.
    The code that needs to be added is:

    /**
     * Collect data to output in JSON-LD.
     *
     * @param array  $unsigned An array of data to output in json-ld.
     * @param JsonLD $unsigned JsonLD instance.
     */
    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    	return [];
    }, 99, 2);

    You can learn more about it here: https://rankmath.com/kb/filters-hooks-api-developer/#extend-json-ld-data
    Also, please go through this https://rankmath.com/kb/filters-hooks-api-developer/#adding-filters-and-hooks-in-rank-math-php to understand how to add filter to the website.

    Hope this helps.

    Thank you

    Ok, the only thing I don’t understand is, after adding this code, where do I add the custom schema, my new setting will open?

    so after adding the code, where do we add the custom schema? is there a tutorial?

    Hello,

    Please note that you may need to customize the code sent by my colleague above to add your custom schema.

    Here’s a sample filter you can refer to on how the filter can be used to apply a schema (logo):

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    	if((is_front_page() || is_home()) && isset($data['publisher'])){
    		$data['publisher']['logo'] = [
    			'@type' => 'ImageObject',
    			'@id' => 'https://mysite.com/#image',
    			'url' => 'https://mysite.com/myimage.png',
    			'contentUrl' => 'https://mysite.com/myimage.png',
    			'caption' => 'My image name',
    			'inLanguage' => 'es',
    			'width' => 600,
    			'heght' => 500
    		];
    	}
    	return $data;
    }, 99, 2);

    Hope that helps.

    Thank you.

    Since I don’t understand the code, I’m asking, how should it be with this code? Because the sample code you have told is very different/

    In the size customizer, the theme has its own schema setting. i want to say, when i used the sample code you gave, the logo scheme repeated on google rich snippet.

    Hello,

    The filter shared by my colleague above was a sample so you can modify the filter and add a custom schema on your site. You can share the schema you want to add to your homepage so we can assist you to modify the filter.

    However, I tried accessing your website but the site cannot be reached.

    You can follow this guide to fix the issue:
    https://kinsta.com/blog/err_connection_timed_out/

    Looking forward to helping you.

    Thank you.

    this filter, which is want to add. please modify 🙂 Thanks.

    My domain has changed to landbound.org

    Hello,

    The option to import the Schema from a URL or JSON is available in the PRO version of Rank Math.

    For adding it to the free version, you might need to hire a coder because the level of customization you are looking for falls beyond the scope of support we provide.

    Do note that we offer a 30 day refund policy so if the PRO version doesn’t work as you expect, you can ask for a full refund.

    We hope you understand. We can point you in the right direction but we cannot provide custom code.

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

The ticket ‘HomePage Schema’ is closed to new replies.