My app allows users to create a listing called a ‘property’ in my database. I want Google to crawl their properties but some times a user might pause their property so that it doesn’t show up in the search results of my app. When a ‘property’ is paused a field in the database called ‘isPaused’ is marked true and the search won’t count it.
If I expose ‘property’ on the sitemap Google won’t take into account the ‘isPaused’ field and will index those properties. I need advice, what would you do?
You can add a no-index tag conditionally to the page, based on whether the page’s thing is paused or not.
Obviously that won’t stop it being indexed by Google until they next crawl the page, so you can’t rely on that for hiding content from users - but it will tinge it from their index next time it’s crawled.
Thanks @adamhholmes for your help, I really like this idea. I can’t find any way to add a conditional to the HTML header, do you think this would work? Set a conditional state when page ‘isPaused’ = yes to META NAME=“robots” CONTENT=“noindex,nofollow” and a conditional state when isPaused = NO to [nothing]. Then in the HTML header use that conditional state as dynamic data. Would that work? Is there any easier way?