What MetaTags for Rails does
MetaTags is a Ruby gem for Ruby on Rails applications that writes HTML head metadata from controller and view code. It renders page titles, descriptions, canonical link elements, robots and noindex directives, favicon and manifest links, pagination rel next and prev links, and alternate links for multilingual or multi-regional URLs. Configuration ships with defaults for truncation and rendering, and an install generator creates an initializer to override them.
It also covers social sharing: Open Graph tags and X card tags, which the repository says still matter for search snippets and previews. The gem supports namespaced custom tags, repeated tags from arrays, and mirrored values so one value can populate several tags. The project states that it manages HTML head metadata only and does not generate structured data or JSON-LD, robots.txt, sitemaps, internal links, or page content.
Key features
- Titles and descriptions
- Sets page titles and description meta tags, accepting a string or array for titles, used by browsers, social previews, and search engines.
- Robots and noindex
- Emits robots, googlebot, and bingbot hashes plus noindex, nofollow, and follow combinations to control indexing.
- Canonical URL links
- Renders canonical link elements that help search engines consolidate duplicate URLs across a site.
- Open Graph tags
- Turns pages into graph objects with Open Graph tags, plus X card tags for social sharing previews.
- Hreflang alternate links
- Builds alternate link elements for multi-regional and multilingual URLs, alongside RSS and mobile links.
- Pagination rel links
- Adds previous and next link elements that describe a paginated sequence of pages.
- Custom namespaced tags
- Creates any namespace by passing a symbol name and hash, and repeats meta tags by passing arrays.
- Mirrored tag values
- Mirrors meta tag values so one value populates several tags without repeating it in code.
- Initializer install generator
- Rails generator creates config/initializers/meta_tags.rb where truncation and rendering defaults are overridden.
- Turbo and pjax support
- Documented setup for keeping meta tags correct when pages load through Turbo or jQuery.pjax.
- Manifest and favicon links
- Emits rel manifest and favicon link elements plus image_src, amphtml, Open Search, and meta refresh tags.
- Array truncation boundaries
- Setting config.truncate_array_items_at_boundaries preserves whole items when arrays passed to title or keywords exceed limits.
How it works
- Add the meta-tags gem to the Gemfile and run bundle install.
- Run rails generate meta_tags:install to create config/initializers/meta_tags.rb with adjustable truncation and rendering defaults.
- Add the display_meta_tags call to the main layout head section.
- Define values with instance variables or the set_meta_tags method in controllers.
- Pass options such as title, description, canonical, robots, or Open Graph hashes to render the tags.
Plans and pricing
Distributed as a free MIT-licensed Ruby gem installed from RubyGems via the Gemfile; no paid tiers are listed.
Integrations and platforms
Works with
- Ruby on Rails
- Ruby
- Turbo
- jQuery.pjax
Available as
- Web
Repository facts
- Repositorykpumuk/meta-tags
- LanguageRuby
- Stars2801
- Forks278
- LicenceMIT
- Created2008-09-17
- Last commit2026-11-24
- Open issues9
- meta-tags
- opengraph
- opengraph-tags
- rails
- ruby
- search-engine-optimization
- seo
- seo-meta
- seotools
- twitter-cards
Services and details
Does SEO work itself
YesFree plan or free tools
YesAPI or MCP server
Yes
No information yet on keyword research, content optimization, writes content with AI, technical audits, rank tracking, backlinks and link building, local SEO, AI search visibility, free trial, WordPress plugin, browser extension, built for agencies. The website did not say; check with the vendor.
About the company
- Company kpumuk
- Website: github.com/kpumuk/meta-tags
Listing compiled from public sources and the product's own website. Last updated 2026-11-12. Report a correction or request removal. Back to GitHub repos.