0

I have such a component that I need to hide from Google indexing, but this component is used on every page of the site.

const SmallCompaniesBlock = ({code, price, exchange, changes, beta}) => {
  return (
    <div className={styles["companies-item"]}>
      <div className={styles["item-code"]}>{code}</div>
      <div className={styles["item-wrapper"]}>
        <div className={styles["price-per-stock"]}>{price}$</div>
        <div className={styles["stock-exchange"]}>{exchange}</div>
      </div>
      <div className={styles["item-wrapper"]}>
        <div className={styles["stock-percent"]}>+0,10%</div>
        <div className={styles["stock-increase"]}>+128,6$</div>
      </div>
    </div>
  );
};

I tried the following options:

- data-nosnippet="true"

<div className={styles["companies-item"]} data-nosnippet="true">
     ....
</div>

- noindex tag

<noindex>
    <div className={styles["companies-item"]} data-nosnippet="true">
         ....
    </div>
</noindex> // but this only for bad browsers
  • Do you need to be copyable? Is using images in place of numbers good enough? – Dimava May 09 '23 at 19:29
  • This might qualify as "programming" and get an answer here, but this question has already been asked and answered at Webmasters: [Preventing robots from crawling specific part of a page](https://webmasters.stackexchange.com/questions/16390/preventing-robots-from-crawling-specific-part-of-a-page) – Stephen Ostermiller May 09 '23 at 19:30

0 Answers0