0.0
No commit activity in last 3 years
No release in over 3 years
Add noindex tag for disallowed path in robots.txt file
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0
>= 0
 Project Readme

SeoNoindex

Add noindex tag in head for disallowed paths from robots.txt file

Installation

Add this line to your application's Gemfile:

gem 'seo_noindex'

And then execute:

$ bundle

Or install it yourself as:

$ gem install seo_noindex

If you're not running Rails, you'll have to add the middleware to your config.ru:

require 'seo_noindex'
use SeoNoindex::Middleware

Add helper to your view file in head section

<header>
  <%= robots_noindex_tag -%>
</header>

Example

For example in robots.txt we have this string:

Disallow: /admin

And if we follow https://sitename/admin we get this:

<meta name="robots" content="noindex">