# Remove wrong structured data from every subpage – add "Sitelinks Search Box" to the homepage only

**URL:** <https://meta.discourse.org/t/remove-wrong-structured-data-from-every-subpage-add-sitelinks-search-box-to-the-homepage-only/219299>\
**Category:** Bug\
**Created:** [February 24, 2022, 5:45pm UTC](https://meta.discourse.org/t/remove-wrong-structured-data-from-every-subpage-add-sitelinks-search-box-to-the-homepage-only/219299 "2022-02-24T17:45:18Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![rrit](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@rrit](https://meta.discourse.org/u/rrit)\
**Post date:** [February 24, 2022, 5:45pm UTC](https://meta.discourse.org/t/remove-wrong-structured-data-from-every-subpage-add-sitelinks-search-box-to-the-homepage-only/219299/1 "2022-02-24T17:45:18Z")

</div>

TL;DR: Right now we are telling Google for **every** page, subpage, topic, whatsoever that the page itself has `"url":"https://www.example.com/"`  
– this is definitely wrong for a topic page with url like `https://meta.discourse.org/t/add-sitelinks-search-box-to-the-homepage-only/219299`

* * *

The Sitelinks Search Box’ code is implemented on every page, category and topic right now:

```xml
<script type="application/ld+json">
{
  "@context":"http://schema.org",
  "@type":"WebSite",
  "url":"https://www.example.com/",
  "potentialAction":{
    "@type":"SearchAction",
    "target":"https://www.example.com/search?q={search_term_string}",
    "query-input":"required name=search_term_string"
  }
}
</script>

```

E.g. see Google Search Console report ‘Enhancements’ → ‘[Sitelinks searchbox](https://search.google.com/search-console/r/sitelinks-searchbox/drilldown?hl=en)’

 ![grafik](https://global.discourse-cdn.com/meta/original/3X/6/8/68d84f5836ecc992fe21d08e05225eb57e47da38.png)

As of Google it should be added to the homepage only:

> **[Removing sitelinks search box documentation - Latest Google Search Documentation...](https://developers.google.com/search/updates?hl=en#bye-sitelinkbox)**
>
> This page details the latest major updates made to the Google Search Central documentation. | Learn about the latest and most recent Google Search Central documentation updates. Stay current with what's new at Google Search Central.

> [@](#):
>
> 1. **Implement the `WebSite` structured data element on the homepage for your site.**
> 
> - Add this markup only to the homepage, not to any other pages.

* * *

[https://github.com/discourse/discourse/pull/16157](https://github.com/discourse/discourse/pull/16157)

---

_[View the full topic](https://meta.discourse.org/t/remove-wrong-structured-data-from-every-subpage-add-sitelinks-search-box-to-the-homepage-only/219299)._
