Skip to content

Commit

Permalink
Exclude search pages from indexing with robots meta tag instead of ro…
Browse files Browse the repository at this point in the history
…bots.txt (#289)

* Exclude search pages with robots meta tag instead of robots.txt
  • Loading branch information
walsh9 authored Jun 15, 2023
1 parent 21ba8a9 commit b412563
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pages/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,15 @@ useHeadSafe({
useServerHeadSafe({
meta: [{ property: 'og:title', content: pageTitle}]
})
if (query.value) {
useServerHead({meta: [{name: 'robots', content: 'noindex'}]})
}
useChartbeat()
useOptinMonster()
onMounted(() => {
$analytics.sendPageView({ page_type: 'search_page' })
getSearchResults()
Expand Down
1 change: 0 additions & 1 deletion public/robots-prod.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
User-agent: *
Disallow: /mt/
Disallow: /profile/
Disallow: /search?q=*

Sitemap: https://gothamist.com/sitemap.xml
Sitemap: https://gothamist.com/sitemap-news.xml

0 comments on commit b412563

Please sign in to comment.