Support » Plugin: Yoast SEO » Error in SearchAction-code

  • Resolved YuriV

    (@yuriv)


    Hi,

    Google Search Console is giving errors on the sitelinks search box. It’s says: missing target and missing url. The source code of our homepage is showing this at the moment:

    {"@type":"SearchAction","target":"https://domain.net/?s={search_term_string}","query-input":"required name=search_term_string"}}

    I guess it has to be something like:

    "@type": "SearchAction",
    "target": "https://domain.net/?s={search_term_string}",
    "query-input": "required name=search_term_string"

    As far as I can see the false code is generated by Yoast in this file: plugins/wordpress-seo/frontend/schema/class-schema-website.php

    Where I found:

    $data['potentialAction'] = array(
    				'@type'       => 'SearchAction',
    				'target'      => $search_url,
    				'query-input' => 'required name=search_term_string',
    			);
    		}

    Any clue what’s wrong in that code?

    Thanks in advance

    • This topic was modified 2 years, 4 months ago by YuriV.
    • This topic was modified 2 years, 4 months ago by YuriV.
    • This topic was modified 2 years, 4 months ago by YuriV.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    Can you please share the exact site URL here with us where the issue remains occurring for you so that we can take a look at it?

    Thread Starter YuriV

    (@yuriv)

    You van find it on

    view-source:https://historiek.net

    But also on

    view-source:https://yoast.com

    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    We see the exact same Schema that you have shared with us and the only difference is the first example Schema isn’t indented but the second one is indentended.

    "@type": "SearchAction",
    "target": "https://domain.net/?s={search_term_string}",
    "query-input": "required name=search_term_string"
    
    "@type": "SearchAction",
    "target": "https://domain.net/?s={search_term_string}",
    "query-input": "required name=search_term_string"
    

    That said we have tested your site https://historiek.net/ using the Google Structured Data Testing tool and we don’t see any errors at all.

    Plugin Support Jerlyn

    (@jerparx)

    Closed. No further questions.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error in SearchAction-code’ is closed to new replies.