Enable Sitelinks Searchbox for all pages

#269163
  • Resolved Rajat Das
    Rank Math free

    Hi, I am having trouble enabling the Sitelinks Searchbox schema for all pages. I have already added the following line of code (functions.php) as mentioned in the knowledge base (https://rankmath.com/kb/sitelinks-searchbox-schema/).


    /**
    * Filter to enable/disable SearchAction JSON-LD data
    */
    add_filter( 'rank_math/json_ld/disable_search', '__return_false' );

    By default the schema is showing for the home page only and posts doesn’t have the Sitelinks Searchbox schema

    When I use add_filter( 'rank_math/json_ld/disable_search', '__return_true' ); it removes the schema from home page.

    How do I add the schema to all the pages/posts.

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

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

    Rank Math automatically adds the Sitelinks searchbox to your homepage and you don’t need to configure it.

    We do not recommend adding the sitelinks search box to every page of the website as it is against Googles specification : https://developers.google.com/search/docs/advanced/structured-data/sitelinks-searchbox#adding-structured-data.

    Specification: Add this markup only to the homepage, not to any other pages.

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

    Oh I wasn’t aware of it. Thanks for your answer.

    Prabhat
    Rank Math agency

    Hello,

    You’re very welcome.

    Could you please let us know if you need our assistance with anything else?

    Looking forward to hearing back from you.

    Thank you.

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

The ticket ‘Enable Sitelinks Searchbox for all pages’ is closed to new replies.