• I have a site that is comprised of multiple CMS, and does not use the WordPress search. I suggest either making the search schema optional, or give us a way to customize it. I am fine with a filter, hook, or front-end options.

    Thank you!

    Maybe a filter already exists? I looked on Git, but wasn’t really savvy enough to find what I was looking for.

    Barbara

    https://www.ads-software.com/plugins/wordpress-seo/

Viewing 3 replies - 16 through 18 (of 18 total)
  • Aha, I did look there Mike but I couldn’t find it. Anyhow, having looked a little deeper, it appears it’s due to my theme editor being in the child theme. Selecting the parent file creates the possibility of editing this. Thank you.

    One query – on the Structured Data test, my ‘Organization’ receives the all good. It’s only the WebSite which features the errors (being the search functionality).

    Would the error on the WebSite section prohibit the Organization section from working correctly in the SERP’s? i.e. my Organization section contains my social links – would these work regardless of the error in the WebSite section?

    I ask because that’s primarily what I want to achieve. If they should be working regardless of the WebSite section errors, I would rather leave the functions.php file alone!

    Thanks guys.

    May I kindly ask if anyone has any idea for the above please?

    Thanks!

    I found the issue and the change needed in the plugin in order to make it validate properly.

    However, just know that this change will be overwritten once an update is made. Hopefully the guys over at Yoast will make this change in the next update.

    in class-json-ld.php:

    public function website() {
    		$this->data = array(
    			'@context' => 'https://schema.org/',
    			'@type'    => 'WebSite',
    			'url'      => $this->get_home_url(),
    			'name'     => $this->get_website_name(),
    		);
    
    		$this->add_alternate_name();
    		$this->internal_search_section();
    
    		$this->output( 'website' );
    	}

    needs to be changed to

    public function website() {
    		$this->data = array(
    			'@context' => 'https://schema.org/True',
    			'@type'    => 'WebSite',
    			'url'      => $this->get_home_url(),
    			'name'     => $this->get_website_name(),
    		);
    
    		$this->add_alternate_name();
    		$this->internal_search_section();
    
    		$this->output( 'website' );
    	}

    Basically, the Schema.org link just needs to have /True added to the end of it. I tried this in the structured data tool validator and it seemed to work just fine.

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Feature Request: Make LD JSON Search Schema Optional’ is closed to new replies.