← Back to all products

Meta Tag Generator

$19

Generate SEO-optimized meta tags including title, description, OG tags, and Twitter cards.

📁 9 files
JSONMarkdownPythonCI/CD

📄 Product Preview

Try the interactive reader and demo tools below, or get the full product with all content unlocked.

📖 Interactive Reader (Free Preview) ⚙ Try Demo Tools 📦 Download Free Sample

📁 File Structure 9 files

meta-tag-generator/ ├── LICENSE ├── README.md ├── examples/ │ └── site_config.json ├── free-sample.zip ├── guide/ │ ├── 01_features.md │ ├── 02_configuration-reference.md │ └── 03_cli-flags.md ├── index.html └── src/ └── meta_tag_generator.py

📖 Documentation Preview README excerpt

Meta Tag Generator

Part of the SEO Toolkit by CodeVault

Generate comprehensive HTML meta tags, Open Graph tags, and Twitter Card tags from a simple JSON config file. Never hand-write meta tags again.

Features

  • Generates all essential meta tags from a single config
  • Full Open Graph support (og:title, og:image, og:type, etc.)
  • Twitter Card tags (summary, summary_large_image)
  • Validates your config and warns about common SEO mistakes
  • Title length check (Google truncates at ~60 chars)
  • Description length check (max 160 chars)
  • Missing canonical URL detection
  • Multiple output formats: tag block, full HTML document, JSON report
  • Strict mode for CI/CD pipelines (exit 1 on any issue)
  • Python stdlib only — zero dependencies

Quick Start


# Generate meta tags from a config file
python src/meta_tag_generator.py --config examples/site_config.json

# Generate a full HTML document
python src/meta_tag_generator.py --config examples/site_config.json --format html

# Validate without generating output
python src/meta_tag_generator.py --config examples/site_config.json --validate-only

# Output as JSON report (great for CI/CD)
python src/meta_tag_generator.py --config examples/site_config.json --format json

# Write to file
python src/meta_tag_generator.py --config examples/site_config.json --output head.html

Configuration Reference

Create a JSON file with these fields:

FieldTypeRequiredDescription
titlestringYesPage title (aim for 50-60 chars)
descriptionstringYesMeta description (aim for 120-160 chars)
charsetstringNoCharacter encoding (default: utf-8)
viewportstringNoViewport settings (default: width=device-width, initial-scale=1.0)
theme_colorstringNoBrowser theme color (e.g., #00FF88)
canonical_urlstringYesThe canonical URL for the page
languagestringNoHTML lang attribute (default: en)
authorstringNoPage author
robotsstringNoRobots directive (default: index, follow)
keywordsarrayNoList of keywords
og_typestringNoOpen Graph type (default: website)
og_titlestringNoOG title (falls back to title)
og_descriptionstringNoOG description (falls back to description)
og_imagestringYesOG image URL (1200x630 recommended)
og_image_widthintNoOG image width in pixels
og_image_heightintNoOG image height in pixels

... continues with setup instructions, usage examples, and more.

📄 Code Sample .py preview

src/meta_tag_generator.py #!/usr/bin/env python3 """ Meta Tag Generator — SEO Toolkit by DataNest Generate comprehensive HTML meta tags, Open Graph tags, and Twitter Card tags from a simple JSON or YAML-like configuration. Outputs a ready-to-paste <head> block or a standalone HTML file. Why this exists: Manually writing meta tags is tedious and error-prone. Miss one og:image dimension and your social previews look broken. This tool generates all the tags you need from a single config, validates required fields, and warns you about common mistakes (missing descriptions, titles too long, etc.) before you deploy. Usage: python meta_tag_generator.py --config site.json python meta_tag_generator.py --config site.json --output head.html python meta_tag_generator.py --config site.json --format json License: MIT """ from __future__ import annotations import argparse import json import logging import sys import html from dataclasses import dataclass, field from pathlib import Path from typing import Any # --------------------------------------------------------------------------- # Constants # --------------------------------------------------------------------------- # Google typically displays 50-60 characters for titles TITLE_MAX_LENGTH = 60 TITLE_WARN_LENGTH = 50 # Meta descriptions should be 150-160 characters DESC_MAX_LENGTH = 160 DESC_WARN_LENGTH = 120 # Common charset values VALID_CHARSETS = {"utf-8", "iso-8859-1", "windows-1252", "ascii"} # Supported Open Graph types (subset of og:type values) # ... 467 more lines ...
Buy Now — $19 Back to Products