How to remove page from the sitemap file generated by react-static?

907 Views Asked by At

According to documentation, setting route property noindex to true like the example below it would prevent the page to be included in sitemap:

<Route component={privacyPolicyPage} path="/privacy-policy" noindex="true"/>

For the sake of completeness, here the relevant code for route map:

//app.js

import React from 'react'
import { Root } from 'react-static'
import { Route, Switch, Redirect} from "react-router-dom";

<Switch>
    <Route exact path="/p1" component={About} />  
    ...
    <Route component={About} path="/about" priority="0.1" />
    <Route component={PrivacyPolicy} PrivacyPolicy path="/privacy-policy" noindex="true" />
    <Route component={p404} noindex="true" />

</Switch>

Yet, neither it removes the privacy-policy url or even change any priority.

It is my first time with reactjs framework, so it is most likely i miss understood something.

1

There are 1 best solutions below

0
On

The docs say that this prop is Boolean type, so please try this:

<Route component={privacyPolicyPage} path="/privacy-policy" noindex={true}/>

Using noindex="true" will pass a string value...